U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neha Malcom Francis <n-francis@ti.com>
To: Manorit Chawdhry <m-chawdhry@ti.com>
Cc: <sjg@chromium.org>, <marcel.ziswiler@toradex.com>,
	<u-boot@lists.denx.de>,  <vigneshr@ti.com>, <nm@ti.com>,
	<u-kumar1@ti.com>, <kamlesh@ti.com>, <afd@ti.com>,
	<mkorpershoek@baylibre.com>
Subject: Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
Date: Wed, 22 Nov 2023 11:22:07 +0530	[thread overview]
Message-ID: <d57ffe06-4f4a-4fa7-89ad-4527769a3389@ti.com> (raw)
In-Reply-To: <20231122052045.2hdlhvag6lz3t3pk@uda0497581>

Hi Manorit

On 22/11/23 10:50, Manorit Chawdhry wrote:
> Hi Neha,
> 
> On 15:40-20231115, Neha Malcom Francis wrote:
>> Reduce redundancy in code by using templates to generate the A72 boot
>> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
>> (for legacy boot following devices J721E and AM65x).
>>
>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>> ---
>>   arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>>   .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>>   arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>>   arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>>   arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>>   arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>>   arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>>   arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>>   8 files changed, 54 insertions(+), 1488 deletions(-)
>>
>> diff --git a/arch/arm/dts/k3-am625-sk-binman.dtsi b/arch/arm/dts/k3-am625-sk-binman.dtsi
>> index 41277bf4bf..b7b5368886 100644
>> --- a/arch/arm/dts/k3-am625-sk-binman.dtsi
>> +++ b/arch/arm/dts/k3-am625-sk-binman.dtsi
>> @@ -141,10 +141,7 @@
>>   
>>   #ifdef CONFIG_TARGET_AM625_A53_EVM
>>   
>> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>>   #define SPL_AM625_SK_DTB "spl/dts/k3-am625-sk.dtb"
>> -
>> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>>   #define AM625_SK_DTB "u-boot.dtb"
>>   
>>   &binman {
>> @@ -155,55 +152,11 @@
>>   		};
>>   	};
>>   	ti-spl {
>> -		filename = "tispl.bin";
>> -		pad-byte = <0xff>;
>> +		insert-template = <&ti_spl_template>;
>>   
>>   		fit {
>> -			description = "Configuration to load ATF and SPL";
>> -			#address-cells = <1>;
>> -
>>   			images {
>> -
>> -				atf {
>> -					description = "ARM Trusted Firmware";
>> -					type = "firmware";
>> -					arch = "arm64";
>> -					compression = "none";
>> -					os = "arm-trusted-firmware";
>> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
>> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
>> -					ti-secure {
>> -						content = <&atf>;
>> -						keyfile = "custMpk.pem";
>> -					};
> 
> For ATF/OP-TEE Firewalling, can you keep these nodes intact? Just keep
> the ti-secure inside atf and tee nodes similar to how you have done that
> for DM as all the ATF/OPTEE nodes in the tispl.bin would be different
> for devices w.r.t certifications but we can still use templates for
> other common stuff.
> 

I believe you will still be able to process firewalling by adding the extra 
parameters in the board binman DTSI file. The reason for retaining DM was 
different. For example, for J721E:

diff --git a/arch/arm/dts/k3-j721e-binman.dtsi b/arch/arm/dts/k3-j721e-binman.dtsi
index 5ddb474e3a..647b5dc629 100644
--- a/arch/arm/dts/k3-j721e-binman.dtsi
+++ b/arch/arm/dts/k3-j721e-binman.dtsi
@@ -146,6 +146,27 @@

  		fit {
  			images {
+				atf {
+					ti-secure {
+						auth-in-place = <0xa02>;
+
+						firewall-257-0 {
+						/* cpu_0_cpu_0_msmc Background Firewall */
+							id = <257>;
+							region = <0>;
+							control = <(FWCTRL_EN | FWCTRL_LOCK |
+										FWCTRL_BG | FWCTRL_CACHE)>;
+							permissions = <((FWPRIVID_ALL << FWPRIVID_SHIFT) |
+											FWPERM_SECURE_PRIV_RWCD |
+											FWPERM_SECURE_USER_RWCD |
+											FWPERM_NON_SECURE_PRIV_RWCD |
+											FWPERM_NON_SECURE_USER_RWCD)>;
+							start_address = <0x0 0x0>;
+							end_address = <0xff 0xffffffff>;
+						};
+					};
+				};
+
  				dm {
  					ti-secure {
  						content = <&dm>;


I have only checked whether this builds fine without any errors. If you could 
check whether the intended functionality also works, we should be good.

> With this change,
> 
> Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
> 
> Regards,
> Manorit
>> -					atf: atf-bl31 {
>> -					};
>> -				};
>> -

[...]

-- 
Thanking You
Neha Malcom Francis

  reply	other threads:[~2023-11-22  5:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 10:10 [PATCH 0/2] Cleanup K3 binman FIT images Neha Malcom Francis
2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
2023-11-16 16:03   ` Simon Glass
2023-11-16 16:43     ` Marcel Ziswiler
2023-11-17  5:15       ` Neha Malcom Francis
2023-11-22 20:50   ` Tom Rini
2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
2023-11-15 15:52   ` Andrew Davis
2023-11-16  5:08     ` Neha Malcom Francis
2023-11-16 16:04   ` Simon Glass
2023-11-22  5:20   ` Manorit Chawdhry
2023-11-22  5:52     ` Neha Malcom Francis [this message]
2023-11-22 20:50   ` Tom Rini
2023-11-15 17:33 ` [PATCH 0/2] Cleanup K3 binman FIT images Marcel Ziswiler
2023-11-16  5:08   ` Neha Malcom Francis

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-all 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=d57ffe06-4f4a-4fa7-89ad-4527769a3389@ti.com \
    --to=n-francis@ti.com \
    --cc=afd@ti.com \
    --cc=kamlesh@ti.com \
    --cc=m-chawdhry@ti.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=nm@ti.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=u-kumar1@ti.com \
    --cc=vigneshr@ti.com \
    /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