public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io
Cc: leif@nuviainc.com, Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support
Date: Wed,  8 Apr 2020 19:00:31 +0200	[thread overview]
Message-ID: <20200408170031.898-1-ard.biesheuvel@arm.com> (raw)

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.biesheuvel@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


             reply	other threads:[~2020-04-08 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 17:00 Ard Biesheuvel [this message]
2020-04-08 20:58 ` [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support Leif Lindholm
2020-04-09  5:50   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200408170031.898-1-ard.biesheuvel@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox