diff options
author | Matt DeVillier <matt.devillier@amd.corp-partner.google.com> | 2022-09-23 14:51:12 -0500 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-10-13 19:07:39 +0000 |
commit | 5f69b867f0c9ec9c0afab4df70a3d0d06809957a (patch) | |
tree | dc320f04ae04bc6d0ac29077ac9cd2e3dec67c2e | |
parent | ffa79073d35306c22d66a966400457a6bb2be656 (diff) |
mb/google/skyrim: Allow variants to override romstage GPIO table
Switch from gpio_configure_pads() to gpio_configure_pads_with_override()
so variants can override romstage GPIO defaults. Rename baseboard
function and add an weak empty override function to be used by variants.
Will be used for touchscreen power sequencing in a follow-on commit.
Change-Id: I45586237919cd07a171beac57f3510e26338f67f
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67811
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
3 files changed, 17 insertions, 8 deletions
diff --git a/src/mainboard/google/skyrim/romstage.c b/src/mainboard/google/skyrim/romstage.c index cf93fc5685..ce25ee9182 100644 --- a/src/mainboard/google/skyrim/romstage.c +++ b/src/mainboard/google/skyrim/romstage.c @@ -5,11 +5,11 @@ void mb_pre_fspm(FSP_M_CONFIG *mcfg) { - size_t base_num_gpios; - const struct soc_amd_gpio *base_gpios; + size_t num_base_gpios, num_override_gpios; + const struct soc_amd_gpio *base_gpios, *override_gpios; - /* Initialize PCIe reset. */ - variant_romstage_gpio_table(&base_gpios, &base_num_gpios); - - gpio_configure_pads(base_gpios, base_num_gpios); + baseboard_romstage_gpio_table(&base_gpios, &num_base_gpios); + variant_romstage_override_gpio_table(&override_gpios, &num_override_gpios); + gpio_configure_pads_with_override(base_gpios, num_base_gpios, + override_gpios, num_override_gpios); } diff --git a/src/mainboard/google/skyrim/variants/baseboard/gpio.c b/src/mainboard/google/skyrim/variants/baseboard/gpio.c index b234a5dee3..b44114e48c 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/gpio.c +++ b/src/mainboard/google/skyrim/variants/baseboard/gpio.c @@ -202,12 +202,18 @@ static const struct soc_amd_gpio romstage_gpio_table[] = { PAD_GPO(GPIO_6, HIGH), }; -__weak void variant_romstage_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) +void baseboard_romstage_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) { *size = ARRAY_SIZE(romstage_gpio_table); *gpio = romstage_gpio_table; } +__weak void variant_romstage_override_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) +{ + *size = 0; + *gpio = NULL; +} + void baseboard_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) { *size = ARRAY_SIZE(base_gpio_table); diff --git a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h index 73ccc03991..4d71c5cc5c 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h @@ -39,6 +39,9 @@ void variant_espi_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); void variant_tpm_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); /* This function provides GPIO settings in romstage. */ -void variant_romstage_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); +void baseboard_romstage_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); + +/* This function allows variant to override any GPIO init in romstage. */ +void variant_romstage_override_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); #endif /* __BASEBOARD_VARIANTS_H__ */ |