From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.16238.1586365241858418690 for ; Wed, 08 Apr 2020 10:00:41 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5839C31B; Wed, 8 Apr 2020 10:00:41 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (unknown [10.37.8.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E26D3F52E; Wed, 8 Apr 2020 10:00:40 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif@nuviainc.com, Ard Biesheuvel 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 Message-Id: <20200408170031.898-1-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 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 --- 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 { + +!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