diff options
Diffstat (limited to 'src/mainboard/google')
-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); |