From 2fcc034705d010d44d3424059519f8487889e594 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 25 Jul 2018 08:06:21 -0600 Subject: [PATCH] mb/google/octopus: add variant devicetree update callback The variants of the octopus family have their own schedule and needs for modifying settings based on the phase of the build schedule while also needing to maintain support for previous builds. Therefore, utilize the SoC callback, mainboard_devtree_update(), but just callback into the newly introduced variant_update_devtree(). The indirection allows for the ability to move the call around earlier than the mainboard_devtree_update() if needed while maintaining consistency in the naming of the variant API. BUG=b:111808427,b:111743717 TEST=built Change-Id: If1c2f60cabe65b5f1c6a04dd60e056e50c4993df Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/27637 Tested-by: build bot (Jenkins) Reviewed-by: Justin TerAvest --- src/mainboard/google/octopus/mainboard.c | 13 +++++++++++++ .../variants/baseboard/include/baseboard/variants.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c index eda44bad11..fa2075bc3d 100644 --- a/src/mainboard/google/octopus/mainboard.c +++ b/src/mainboard/google/octopus/mainboard.c @@ -16,12 +16,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -110,3 +112,14 @@ const char *smbios_mainboard_sku(void) return sku_str; } + +void __weak variant_update_devtree(struct device *dev) +{ + /* Place holder for common updates. */ +} + +void mainboard_devtree_update(struct device *dev) +{ + /* Defer to variant for board-specific updates. */ + variant_update_devtree(dev); +} diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index 87ab7fd2a0..c9d7d7bf85 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -41,4 +41,8 @@ const struct cros_gpio *variant_cros_gpios(size_t *num); struct nhlt; void variant_nhlt_init(struct nhlt *nhlt); +/* Modify devictree settings during ramstage. */ +struct device; +void variant_update_devtree(struct device *dev); + #endif /* BASEBOARD_VARIANTS_H */