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>
This commit is contained in:
Matt DeVillier 2022-12-18 14:59:31 -06:00 committed by Martin L Roth
parent 63cde524b7
commit c0edb925e6
3 changed files with 14 additions and 0 deletions

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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);