security/tpm: Fix TCPA log feature

Until now the TCPA log wasn't working correctly.

* Refactor TCPA log code.
* Add TCPA log dump fucntion.
* Make TCPA log available in bootblock.
* Fix TCPA log formatting.
* Add x86 and Cavium memory for early log.

Change-Id: Ic93133531b84318f48940d34bded48cbae739c44
Signed-off-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/29563
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
diff --git a/src/security/tpm/Makefile.inc b/src/security/tpm/Makefile.inc
index 34ead8f..c05fb55 100644
--- a/src/security/tpm/Makefile.inc
+++ b/src/security/tpm/Makefile.inc
@@ -12,11 +12,16 @@
 
 ## TSPI
 
-ramstage-y += tspi/tspi.c tspi/log.c
-romstage-y += tspi/tspi.c tspi/log.c
+ramstage-y += tspi/tspi.c
+romstage-y += tspi/tspi.c
 
-verstage-$(CONFIG_VBOOT) += tspi/tspi.c tspi/log.c
-postcar-$(CONFIG_VBOOT) += tspi/tspi.c tspi/log.c
+verstage-$(CONFIG_VBOOT) += tspi/tspi.c
+postcar-$(CONFIG_VBOOT) += tspi/tspi.c
+
+ramstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+romstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+verstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+postcar-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
 
 endif # CONFIG_TPM1
 
@@ -36,10 +41,15 @@
 
 ## TSPI
 
-ramstage-y += tspi/tspi.c tspi/log.c
-romstage-y += tspi/tspi.c tspi/log.c
+ramstage-y += tspi/tspi.c
+romstage-y += tspi/tspi.c
 
-verstage-$(CONFIG_VBOOT) += tspi/tspi.c tspi/log.c
-postcar-$(CONFIG_VBOOT) += tspi/tspi.c tspi/log.c
+verstage-$(CONFIG_VBOOT) += tspi/tspi.c
+postcar-$(CONFIG_VBOOT) += tspi/tspi.c
+
+ramstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+romstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+verstage-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
+postcar-$(CONFIG_VBOOT_MEASURED_BOOT) += tspi/log.c
 
 endif # CONFIG_TPM2