Nick Vaccaro has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60274 )
Change subject: soc/intel/common/block/gpio: add variant_gpio_lock_config() ......................................................................
soc/intel/common/block/gpio: add variant_gpio_lock_config()
Add variant_gpio_lock_config() to give variants a way to provide a list of gpios that the variant wants locked, such as gpios connected to the TPM.
BUG=b:208827718 TEST=None
Signed-off-by: Nick Vaccaro nvaccaro@google.com
Change-Id: I3edc309335b2751a85b479250ee0c470ea842c2e --- M src/soc/intel/common/block/include/intelblocks/gpio.h M src/soc/intel/common/block/smm/smihandler.c 2 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/60274/1
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio.h b/src/soc/intel/common/block/include/intelblocks/gpio.h index 91f9abe..cf86c10 100644 --- a/src/soc/intel/common/block/include/intelblocks/gpio.h +++ b/src/soc/intel/common/block/include/intelblocks/gpio.h @@ -264,6 +264,12 @@ const struct gpio_lock_config *mb_gpio_lock_config(size_t *num);
/* + * Returns an array of gpio_lock_config entries that the variant + * deems security risks that should be locked down. + */ +const struct gpio_lock_config *variant_gpio_lock_config(size_t *num); + +/* * Returns the pmc_gpe to gpio_gpe mapping table * */ diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c index 32de2f6..86f00ae 100644 --- a/src/soc/intel/common/block/smm/smihandler.c +++ b/src/soc/intel/common/block/smm/smihandler.c @@ -323,12 +323,20 @@ return NULL; }
+__weak const struct gpio_lock_config *variant_gpio_lock_config(size_t *num) +{ + *num = 0; + return NULL; +} + static void soc_lock_gpios(void) { const struct gpio_lock_config *soc_gpios; const struct gpio_lock_config *mb_gpios; + const struct gpio_lock_config *variant_gpios; size_t soc_gpio_num; size_t mb_gpio_num; + size_t variant_gpio_num;
/* get list of gpios from SoC */ soc_gpios = soc_gpio_lock_config(&soc_gpio_num); @@ -336,6 +344,9 @@ /* get list of gpios from mainboard */ mb_gpios = mb_gpio_lock_config(&mb_gpio_num);
+ /* get list of gpios from variant */ + variant_gpios = variant_gpio_lock_config(&variant_gpio_num); + /* Lock any soc requested gpios */ if (soc_gpio_num) gpio_lock_pads(soc_gpios, soc_gpio_num); @@ -343,6 +354,10 @@ /* Lock any mainboard requested gpios */ if (mb_gpio_num) gpio_lock_pads(mb_gpios, mb_gpio_num); + + /* Lock any variant requested gpios */ + if (variant_gpio_num) + gpio_lock_pads(variant_gpios, variant_gpio_num); }
static void finalize(void)