diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2022-12-17 11:45:40 -0600 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-12-21 13:38:06 +0000 |
commit | 53bf72b131d68216b589306ab68b787a6de4c18c (patch) | |
tree | f8ce831f8266214c81ead30b7ce6240d02882db5 | |
parent | 0822ce8b08aa96c74a3d1a0d6b717c019924e8c3 (diff) |
mb/google/octopus: 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: I4a8e11945ae64b000051989089e0ebae22896c6b
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70905
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
4 files changed, 16 insertions, 0 deletions
diff --git a/src/mainboard/google/octopus/romstage.c b/src/mainboard/google/octopus/romstage.c index 47daba23dd..210efc687b 100644 --- a/src/mainboard/google/octopus/romstage.c +++ b/src/mainboard/google/octopus/romstage.c @@ -5,13 +5,20 @@ #include <console/console.h> #include <ec/google/chromeec/ec.h> #include <memory_info.h> +#include <soc/gpio.h> #include <soc/meminit.h> #include <soc/romstage.h> void mainboard_memory_init_params(FSPM_UPD *memupd) { + const struct pad_config *pads; + size_t pads_num; + meminit_lpddr4_by_sku(&memupd->FspmConfig, variant_lpddr4_config(), variant_memory_sku()); + + pads = variant_romstage_gpio_table(&pads_num); + gpio_configure_pads(pads, pads_num); } static void save_dimm_info_by_sku_config(void) diff --git a/src/mainboard/google/octopus/variants/baseboard/Makefile.inc b/src/mainboard/google/octopus/variants/baseboard/Makefile.inc index f28c3d6ce5..06f125c862 100644 --- a/src/mainboard/google/octopus/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/octopus/variants/baseboard/Makefile.inc @@ -1,6 +1,7 @@ bootblock-y += gpio.c romstage-y += memory.c +romstage-y += gpio.c ramstage-y += gpio.c ramstage-y += nhlt.c diff --git a/src/mainboard/google/octopus/variants/baseboard/gpio.c b/src/mainboard/google/octopus/variants/baseboard/gpio.c index 2238a9ffda..60431c2faf 100644 --- a/src/mainboard/google/octopus/variants/baseboard/gpio.c +++ b/src/mainboard/google/octopus/variants/baseboard/gpio.c @@ -377,6 +377,13 @@ variant_sleep_gpio_table(size_t *num, int slp_typ) return sleep_gpio_table; } +const struct pad_config *__weak +variant_romstage_gpio_table(size_t *num) +{ + *num = 0; + return NULL; +} + static const struct cros_gpio cros_gpios[] = { CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), CROS_GPIO_WP_AH(PAD_SCC(GPIO_PCH_WP), GPIO_COMM_SCC_NAME), diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index a1ee5d02ea..ce18809756 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -15,6 +15,7 @@ const struct pad_config *variant_override_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); const struct pad_config *variant_early_override_gpio_table(size_t *num); const struct pad_config *variant_sleep_gpio_table(size_t *num, int slp_typ); +const struct pad_config *variant_romstage_gpio_table(size_t *num); /* Baseboard default swizzle. Can be reused if swizzle is same. */ extern const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle; |