From c6d41ecbed60564fbee0d79677853ac8416d8004 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Sun, 17 Sep 2023 14:46:16 -0500 Subject: [PATCH] mb/google/brya: Init TPM in bootblock when not using vboot Brya queries the TPM in early ramstage (pre-device init) to determine if the CR50 has support for long-pulse interrupts. If the TPM (and underlying I2C controller) hasn't already been setup in verstage, it will fail to do so in ramstage since the I2C controller has not yet been initialized. To work around this, initialize the TPM in bootblock for the non-vboot case, to ensure the I2C controller is set up when needed in early ramstage. TEST=build/boot google/brya (banshee), verify no I2C errors in cbmem console when initializing TPM in early ramstage. Change-Id: I26f0711a9cc4c2eb9837f258cadf391d337994c9 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/78028 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/mainboard/google/brya/bootblock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mainboard/google/brya/bootblock.c b/src/mainboard/google/brya/bootblock.c index c24e9590e2..0d0662bb8c 100644 --- a/src/mainboard/google/brya/bootblock.c +++ b/src/mainboard/google/brya/bootblock.c @@ -2,6 +2,7 @@ #include #include +#include void bootblock_mainboard_early_init(void) { @@ -9,6 +10,10 @@ void bootblock_mainboard_early_init(void) size_t num; pads = variant_early_gpio_table(&num); gpio_configure_pads(pads, num); + + /* Init TPM in non-vboot case so ready in early ramstage before i2c init */ + if (!CONFIG(VBOOT)) + tlcl_lib_init(); } void bootblock_mainboard_init(void)