[PATCH 2/9] tpm: Avoid code bloat when not using EFI_TCG2_PROTOCOL

Simon Glass sjg at chromium.org
Wed Jun 5 05:25:14 CEST 2024


It does not make sense to enable all SHA algorithms unless they are
needed. It bloats the code and in this case, causes chromebook_link to
fail to build.

Add a condition to TPM to correct this. Note that the original commit
combines refactoring and new features, which makes it hard to see what
is going on.

Fixes: 97707f12fda tpm: Support boot measurements

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 lib/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Kconfig b/lib/Kconfig
index 189e6eb31aa..70b32362ada 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -438,10 +438,10 @@ config TPM
 	bool "Trusted Platform Module (TPM) Support"
 	depends on DM
 	imply DM_RNG
-	select SHA1
-	select SHA256
-	select SHA384
-	select SHA512
+	select SHA1 if EFI_TCG2_PROTOCOL
+	select SHA256 if EFI_TCG2_PROTOCOL
+	select SHA384 if EFI_TCG2_PROTOCOL
+	select SHA512 if EFI_TCG2_PROTOCOL
 	help
 	  This enables support for TPMs which can be used to provide security
 	  features for your board. The TPM can be connected via LPC or I2C
-- 
2.34.1



More information about the U-Boot mailing list