diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2022-12-18 14:59:31 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-12-23 00:15:45 +0000 |
commit | c0edb925e67b946320dbdfe1a68c4f19ca161d6e (patch) | |
tree | c4ee098ceb8f741c8532a9295b8ad56adc4d93c7 | |
parent | 63cde524b7c749374003fd1ed3ffd5985f7e8b0c (diff) |
mb/google/hatch: Add method to set GPIOs in romstage
Add method variant_romstage_gpio_table() with empty weak implementation
to allow variants to override as needed for touchscreen power
sequencing (to be implemented in a subsequent commit). Call method
in romstage to program any GPIOs the variant may need to set.
TEST=tested with rest of patch train
Change-Id: I1939387b5bb98d6d282fd044e9ce8780dbe0d2c5
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71058
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | src/mainboard/google/hatch/romstage.c | 5 | ||||
-rw-r--r-- | src/mainboard/google/hatch/variants/baseboard/gpio.c | 6 | ||||
-rw-r--r-- | src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h | 3 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/mainboard/google/hatch/romstage.c b/src/mainboard/google/hatch/romstage.c index eb5153c133..710f1cea99 100644 --- a/src/mainboard/google/hatch/romstage.c +++ b/src/mainboard/google/hatch/romstage.c @@ -31,6 +31,8 @@ void mainboard_memory_init_params(FSPM_UPD *memupd) struct cnl_mb_cfg memcfg; int mem_sku; int is_single_ch_mem; + const struct pad_config *pads; + size_t pads_num; variant_memory_params(&memcfg); mem_sku = variant_memory_sku(); @@ -53,4 +55,7 @@ void mainboard_memory_init_params(FSPM_UPD *memupd) } cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg); + + pads = variant_romstage_gpio_table(&pads_num); + gpio_configure_pads(pads, pads_num); } diff --git a/src/mainboard/google/hatch/variants/baseboard/gpio.c b/src/mainboard/google/hatch/variants/baseboard/gpio.c index c65375e2ec..609fbf742a 100644 --- a/src/mainboard/google/hatch/variants/baseboard/gpio.c +++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c @@ -434,6 +434,12 @@ const struct pad_config *__weak variant_early_gpio_table(size_t *num) return NULL; } +/* Weak implementation of romstage gpio */ +const struct pad_config *__weak variant_romstage_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) { 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 62479eb6cd..0ec473b284 100644 --- a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h @@ -24,6 +24,9 @@ int variant_memory_sku(void); /* Return variant specific gpio pads to be configured during sleep */ const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num); +/* Return GPIO pads that need to be configured during romstage */ +const struct pad_config *variant_romstage_gpio_table(size_t *num); + /* Return GPIO pads that need to be configured before ramstage */ const struct pad_config *variant_early_gpio_table(size_t *num); |