mb/google/volteer: 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: Ib3c2a0e849006b7bf70cbd0bf6f32aa01ccf1bc4
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71180
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2022-12-21 08:18:34 -06:00 committed by Martin L Roth
parent 1263622106
commit 7413815a01
4 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,8 @@
void mainboard_memory_init_params(FSPM_UPD *mupd)
{
const struct pad_config *pads;
size_t pads_num;
const struct mb_cfg *board_cfg = variant_memory_params();
const struct mem_spd spd_info = {
.topo = MEM_TOPO_MEMORY_DOWN,
@ -22,6 +24,9 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
memcfg_init(mupd, board_cfg, &spd_info, half_populated);
memcfg_variant_init(mupd);
pads = variant_romstage_gpio_table(&pads_num);
gpio_configure_pads(pads, pads_num);
}
void __weak memcfg_variant_init(FSPM_UPD *mupd)

View File

@ -3,6 +3,7 @@
bootblock-y += gpio.c
romstage-y += gpio.c
romstage-y += memory.c
ramstage-y += gpio.c

View File

@ -462,6 +462,12 @@ const struct pad_config *__weak variant_sleep_gpio_table(u8 slp_typ,
return NULL;
}
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(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),

View File

@ -15,6 +15,7 @@ const struct pad_config *baseboard_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num);
const struct pad_config *variant_override_gpio_table(size_t *num);
const struct pad_config *variant_romstage_gpio_table(size_t *num);
const struct mb_cfg *variant_memory_params(void);
int variant_memory_sku(void);