public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support
@ 2020-04-08 17:00 Ard Biesheuvel
  2020-04-08 20:58 ` Leif Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2020-04-08 17:00 UTC (permalink / raw)
  To: devel; +Cc: leif, Ard Biesheuvel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support
  2020-04-08 17:00 [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support Ard Biesheuvel
@ 2020-04-08 20:58 ` Leif Lindholm
  2020-04-09  5:50   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2020-04-08 20:58 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: devel

On Wed, Apr 08, 2020 at 19:00:31 +0200, Ard Biesheuvel wrote:
> 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>

Reviewed-by: Leif Lindholm <leif@nuviainc.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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support
  2020-04-08 20:58 ` Leif Lindholm
@ 2020-04-09  5:50   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2020-04-09  5:50 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel

On 4/8/20 10:58 PM, Leif Lindholm wrote:
> On Wed, Apr 08, 2020 at 19:00:31 +0200, Ard Biesheuvel wrote:
>> 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>
> 
> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> 

Pushed, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-09  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08 17:00 [PATCH edk2-platforms 1/1] Platform/DeveloperBox: omit TPM from DT when building without TPM support Ard Biesheuvel
2020-04-08 20:58 ` Leif Lindholm
2020-04-09  5:50   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox