The recently added support for TPM2 measured boot added a description of
the TPM to the device tree, but failed to take the build configuration
into account, and so it adds it unconditionally.

Fix this, by #define'ing a TPM2_ENABLE CPP macro that can be referenced
in the device tree source file.

Signed-off-by: Ard Biesheuvel <ard.biesheu...@arm.com>
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc        | 7 ++++++-
 Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc 
b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
index cddd34e65389..9307edefb11a 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
@@ -511,7 +511,12 @@ [Components.common]
   #
   # DT support
   #
-  Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.inf
+  Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.inf {
+    <BuildOptions>
+!if $(TPM2_ENABLE) == TRUE
+      *_*_*_DTCPP_FLAGS = -D TPM2_ENABLE
+!endif
+  }
 
   #
   # Firmware update
diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts 
b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
index e77a372393fb..47ac27109929 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
@@ -27,9 +27,11 @@
     };
 };
 
+#ifdef TPM2_ENABLE
 &tpm {
     status = "okay";
 };
+#endif
 
 &gpio {
     gpio-line-names = "DSW3-PIN1",  "DSW3-PIN2",  "DSW3-PIN3",    "DSW3-PIN4",
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57074): https://edk2.groups.io/g/devel/message/57074
Mute This Topic: https://groups.io/mt/72878902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to