diff options
author | Tarun Tuli <taruntuli@google.com> | 2022-10-29 17:17:46 +0000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-02 21:37:36 +0000 |
commit | 8924280eb1024401082ac3a7f84eaf2498963ce6 (patch) | |
tree | 27bd3cb7435166201abad4ca2cd83f4917bc5b75 /src/mainboard | |
parent | c32d7b42bc61fece5c48d0b1db6bb7cb6c28d45f (diff) |
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>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/google/hatch/ramstage.c | 15 | ||||
-rw-r--r-- | src/mainboard/google/hatch/variants/baseboard/gpio.c | 7 | ||||
-rw-r--r-- | src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h | 6 |
3 files changed, 28 insertions, 0 deletions
diff --git a/src/mainboard/google/hatch/ramstage.c b/src/mainboard/google/hatch/ramstage.c index ff466a34a8..6cce734c90 100644 --- a/src/mainboard/google/hatch/ramstage.c +++ b/src/mainboard/google/hatch/ramstage.c @@ -55,7 +55,22 @@ static void mainboard_chip_init(void *chip_info) 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 eab831aabf..c65375e2ec 100644 --- a/src/mainboard/google/hatch/variants/baseboard/gpio.c +++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c @@ -433,3 +433,10 @@ const struct pad_config *__weak variant_early_gpio_table(size_t *num) *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 125f7388a1..62479eb6cd 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 @@ const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num); /* 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); |