2021-06-15 17:45:08

by Aswath Govindraju

[permalink] [raw]
Subject: [PATCH v4 0/3] AM64: Update the locations of various elements in SRAM

The following series of patches,
- Increase the maximum size of TF-A
- Update the location of TF-A due to a limitation for DFU boot
- Indicate reserved locations for DMSC code and secure proxy

changes since v3:
- fixed the title of patches 1 and 2

changes since v2:
- split the patches into three
- added regions for indicating memory regions reserved for
dmsc and secure proxy
- moved the TFA location to 0x701c4000

Aswath Govindraju (3):
arm64: dts: ti: k3-am64-main: Update TF-A's maximum size and node name
arm64: dts: ti: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure
proxy communication
arm64: dts: ti: k3-am64-main: Update the location of TF-A

arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

--
2.17.1


2021-06-15 17:46:13

by Aswath Govindraju

[permalink] [raw]
Subject: [PATCH v4 3/3] arm64: dts: ti: k3-am64-main: Update the location of TF-A

Due to a limitation for USB DFU boot mode, SPL load address has to be less
than or equal to 0x70001000. So, load address of SPL and TF-A have been
moved to 0x70000000 and 0x701c4000 respectively.

Therefore, update TF-A's location in the device tree node.

Signed-off-by: Aswath Govindraju <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
index 6a883f4349cb..7ab3652dfdfb 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
@@ -24,8 +24,8 @@
#size-cells = <1>;
ranges = <0x0 0x00 0x70000000 0x200000>;

- tfa-sram@0 {
- reg = <0x0 0x1c000>;
+ tfa-sram@1c4000 {
+ reg = <0x1c4000 0x1c000>;
};

dmsc-sram@1e0000 {
--
2.17.1

2021-06-15 17:47:28

by Aswath Govindraju

[permalink] [raw]
Subject: [PATCH v4 1/3] arm64: dts: ti: k3-am64-main: Update TF-A's maximum size and node name

The maximum size of TF-A 2.5 has been increased to 0x1c000 [1]. Therefore,
update this accordingly in the device tree node.

Also, update the node name to "tfa-sram".

[1] - https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=2fb5312f61a7de8b7a70e1639199c4f14a10b6f9

Signed-off-by: Aswath Govindraju <[email protected]>
Reviewed-by: Suman Anna <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
index dec54243f454..693fe24e7f7a 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
@@ -24,8 +24,8 @@
#size-cells = <1>;
ranges = <0x0 0x00 0x70000000 0x200000>;

- atf-sram@0 {
- reg = <0x0 0x1a000>;
+ tfa-sram@0 {
+ reg = <0x0 0x1c000>;
};
};

--
2.17.1

2021-06-15 17:47:49

by Aswath Govindraju

[permalink] [raw]
Subject: [PATCH v4 2/3] arm64: dts: ti: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure proxy communication

The final 128KB in SRAM is reserved by default for DMSC-lite code and
secure proxy communication buffer. The memory region used for DMSC-lite
code can be optionally freed up by secure firmware API[1]. However, the
buffer for secure proxy communication is not configurable. This default
hardware configuration is unique for AM64.

Therefore, indicate the area reserved for DMSC-lite code and secure proxy
communication buffer in the oc_sram device tree node.

[1] - http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/security_handover.html#triggering-security-handover

Signed-off-by: Aswath Govindraju <[email protected]>
---
arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
index 693fe24e7f7a..6a883f4349cb 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
@@ -27,6 +27,14 @@
tfa-sram@0 {
reg = <0x0 0x1c000>;
};
+
+ dmsc-sram@1e0000 {
+ reg = <0x1e0000 0x1c000>;
+ };
+
+ sproxy-sram@1fc000 {
+ reg = <0x1fc000 0x4000>;
+ };
};

main_conf: syscon@43000000 {
--
2.17.1

2021-06-15 18:49:40

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH v4 2/3] arm64: dts: ti: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure proxy communication

On 6/15/21 12:43 PM, Aswath Govindraju wrote:
> The final 128KB in SRAM is reserved by default for DMSC-lite code and
> secure proxy communication buffer. The memory region used for DMSC-lite
> code can be optionally freed up by secure firmware API[1]. However, the
> buffer for secure proxy communication is not configurable. This default
> hardware configuration is unique for AM64.
>
> Therefore, indicate the area reserved for DMSC-lite code and secure proxy
> communication buffer in the oc_sram device tree node.
>
> [1] - http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/security_handover.html#triggering-security-handover
>
> Signed-off-by: Aswath Govindraju <[email protected]>

Reviewed-by: Suman Anna <[email protected]>

> ---
> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> index 693fe24e7f7a..6a883f4349cb 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> @@ -27,6 +27,14 @@
> tfa-sram@0 {
> reg = <0x0 0x1c000>;
> };
> +
> + dmsc-sram@1e0000 {
> + reg = <0x1e0000 0x1c000>;
> + };
> +
> + sproxy-sram@1fc000 {
> + reg = <0x1fc000 0x4000>;
> + };
> };
>
> main_conf: syscon@43000000 {
>

2021-06-15 18:50:11

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH v4 3/3] arm64: dts: ti: k3-am64-main: Update the location of TF-A

On 6/15/21 12:43 PM, Aswath Govindraju wrote:
> Due to a limitation for USB DFU boot mode, SPL load address has to be less
> than or equal to 0x70001000. So, load address of SPL and TF-A have been
> moved to 0x70000000 and 0x701c4000 respectively.
>
> Therefore, update TF-A's location in the device tree node.
>
> Signed-off-by: Aswath Govindraju <[email protected]>

Reviewed-by: Suman Anna <[email protected]>

> ---
> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> index 6a883f4349cb..7ab3652dfdfb 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> @@ -24,8 +24,8 @@
> #size-cells = <1>;
> ranges = <0x0 0x00 0x70000000 0x200000>;
>
> - tfa-sram@0 {
> - reg = <0x0 0x1c000>;
> + tfa-sram@1c4000 {
> + reg = <0x1c4000 0x1c000>;
> };
>
> dmsc-sram@1e0000 {
>

2021-06-15 18:51:46

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH v4 0/3] AM64: Update the locations of various elements in SRAM

Hi Aswath,

On 6/15/21 12:43 PM, Aswath Govindraju wrote:
> The following series of patches,
> - Increase the maximum size of TF-A
> - Update the location of TF-A due to a limitation for DFU boot
> - Indicate reserved locations for DMSC code and secure proxy
>
> changes since v3:
> - fixed the title of patches 1 and 2

Thanks for fixing these. I have been able to verify these on my AM64x EVM using
the corresponding U-Boot changes as well.

regards
Suman

>
> changes since v2:
> - split the patches into three
> - added regions for indicating memory regions reserved for
> dmsc and secure proxy
> - moved the TFA location to 0x701c4000
>
> Aswath Govindraju (3):
> arm64: dts: ti: k3-am64-main: Update TF-A's maximum size and node name
> arm64: dts: ti: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure
> proxy communication
> arm64: dts: ti: k3-am64-main: Update the location of TF-A
>
> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>

2021-06-16 00:20:27

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v4 1/3] arm64: dts: ti: k3-am64-main: Update TF-A's maximum size and node name

On 23:13-20210615, Aswath Govindraju wrote:
> The maximum size of TF-A 2.5 has been increased to 0x1c000 [1]. Therefore,
> update this accordingly in the device tree node.
>
> Also, update the node name to "tfa-sram".

> [1] - https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=2fb5312f61a7de8b7a70e1639199c4f14a10b6f9
>
> Signed-off-by: Aswath Govindraju <[email protected]>
> Reviewed-by: Suman Anna <[email protected]>
> ---
> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> index dec54243f454..693fe24e7f7a 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> @@ -24,8 +24,8 @@
> #size-cells = <1>;
> ranges = <0x0 0x00 0x70000000 0x200000>;
>
> - atf-sram@0 {
> - reg = <0x0 0x1a000>;
> + tfa-sram@0 {
> + reg = <0x0 0x1c000>;

Thanks for catching this, but, I think tying things down tightly to
exact current size of TF-A is going to be tricky thing for us to
sustain. I suggest we make this 128K to account for future expansions
that are already known to be necessary for TF-A rather than another
piecemeal breaking change in the future.

> };
> };
>
> --
> 2.17.1
>

--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

2021-06-16 00:23:15

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v4 3/3] arm64: dts: ti: k3-am64-main: Update the location of TF-A

On 23:13-20210615, Aswath Govindraju wrote:
> Due to a limitation for USB DFU boot mode, SPL load address has to be less
> than or equal to 0x70001000. So, load address of SPL and TF-A have been
> moved to 0x70000000 and 0x701c4000 respectively.
>
> Therefore, update TF-A's location in the device tree node.

One additional topic to add is the dependency on bootloader update for
this as well. I know things are chicken or egg kind of problem, but
will be good to mention requires newer version than 2021.xx version of
u-boot as this is an "breaking" change. And, if we block both regions
off for bootloader compatibility, that is not feasible given the
limited SRAM available as well.

>
> Signed-off-by: Aswath Govindraju <[email protected]>
> ---
> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> index 6a883f4349cb..7ab3652dfdfb 100644
> --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
> @@ -24,8 +24,8 @@
> #size-cells = <1>;
> ranges = <0x0 0x00 0x70000000 0x200000>;
>
> - tfa-sram@0 {
> - reg = <0x0 0x1c000>;
> + tfa-sram@1c4000 {
> + reg = <0x1c4000 0x1c000>;
> };
>
> dmsc-sram@1e0000 {
> --
> 2.17.1
>

--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

2021-06-16 08:46:52

by Aswath Govindraju

[permalink] [raw]
Subject: Re: [PATCH v4 3/3] arm64: dts: ti: k3-am64-main: Update the location of TF-A

Hi Nishanth,

On 16/06/21 5:50 am, Nishanth Menon wrote:
> On 23:13-20210615, Aswath Govindraju wrote:
>> Due to a limitation for USB DFU boot mode, SPL load address has to be less
>> than or equal to 0x70001000. So, load address of SPL and TF-A have been
>> moved to 0x70000000 and 0x701c4000 respectively.
>>
>> Therefore, update TF-A's location in the device tree node.
>
> One additional topic to add is the dependency on bootloader update for
> this as well. I know things are chicken or egg kind of problem, but
> will be good to mention requires newer version than 2021.xx version of
> u-boot as this is an "breaking" change. And, if we block both regions
> off for bootloader compatibility, that is not feasible given the
> limited SRAM available as well.
>

Will include this in the repsin by indicating the version in which the
ATF has been moved.

Thanks,
Aswath

>>
>> Signed-off-by: Aswath Govindraju <[email protected]>
>> ---
>> arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
>> index 6a883f4349cb..7ab3652dfdfb 100644
>> --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
>> +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi
>> @@ -24,8 +24,8 @@
>> #size-cells = <1>;
>> ranges = <0x0 0x00 0x70000000 0x200000>;
>>
>> - tfa-sram@0 {
>> - reg = <0x0 0x1c000>;
>> + tfa-sram@1c4000 {
>> + reg = <0x1c4000 0x1c000>;
>> };
>>
>> dmsc-sram@1e0000 {
>> --
>> 2.17.1
>>
>