Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/68821 )
Change subject: mb/google/hatch: Add variant finalize support for hatch devices ......................................................................
mb/google/hatch: Add variant finalize support for hatch devices
Provide a variant_finalize() method and call to be invoked from mainboard_ops.final
BUG=b:245953688 TEST=Hatch and variants build BRANCH=Hatch
Signed-off-by: Tarun Tuli taruntuli@google.com Change-Id: I9253ed4be1b08d0c7f65526c9b26dbcd00ffccc7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68821 Reviewed-by: Nick Vaccaro nvaccaro@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/hatch/ramstage.c M src/mainboard/google/hatch/variants/baseboard/gpio.c M src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h 3 files changed, 48 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nick Vaccaro: Looks good to me, approved
diff --git a/src/mainboard/google/hatch/ramstage.c b/src/mainboard/google/hatch/ramstage.c index ff466a3..6cce734 100644 --- a/src/mainboard/google/hatch/ramstage.c +++ b/src/mainboard/google/hatch/ramstage.c @@ -55,7 +55,22 @@ variant_ramstage_init(); }
+void __weak variant_final(void) +{ +} + +static void mainboard_final(void *chip_info) +{ + const struct pad_config *variant_finalize; + size_t variant_gpios; + variant_finalize = variant_finalize_gpio_table(&variant_gpios); + gpio_configure_pads(variant_finalize, variant_gpios); + + variant_final(); +} + struct chip_operations mainboard_ops = { .init = mainboard_chip_init, .enable_dev = mainboard_enable, + .final = mainboard_final, }; diff --git a/src/mainboard/google/hatch/variants/baseboard/gpio.c b/src/mainboard/google/hatch/variants/baseboard/gpio.c index eab831a..c65375e 100644 --- a/src/mainboard/google/hatch/variants/baseboard/gpio.c +++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c @@ -433,3 +433,10 @@ *num = 0; return NULL; } + +/* Weak implementation of finalize gpio */ +const struct pad_config *__weak variant_finalize_gpio_table(size_t *num) +{ + *num = 0; + return NULL; +} diff --git a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h index 125f738..62479eb 100644 --- a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h @@ -27,12 +27,18 @@ /* Return GPIO pads that need to be configured before ramstage */ const struct pad_config *variant_early_gpio_table(size_t *num);
+/* Return GPIO pads that need to be configured after ramstage */ +const struct pad_config *variant_finalize_gpio_table(size_t *num); + /* Modify devictree settings during ramstage. */ void variant_devtree_update(void);
/* Perform variant specific initialization early on in ramstage. */ void variant_ramstage_init(void);
+/* Perform variant specific mainboard finalization */ +void variant_final(void); + /* Perform variant specific mainboard initialization */ void variant_mainboard_enable(struct device *dev);