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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78028
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/mainboard/google/brya/bootblock.c b/src/mainboard/google/brya/bootblock.c
index c24e959..0d0662b 100644
--- a/src/mainboard/google/brya/bootblock.c
+++ b/src/mainboard/google/brya/bootblock.c
@@ -2,6 +2,7 @@
 
 #include <baseboard/variants.h>
 #include <bootblock_common.h>
+#include <security/tpm/tss.h>
 
 void bootblock_mainboard_early_init(void)
 {
@@ -9,6 +10,10 @@
 	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)