linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [For v2021.04] [PATCH 0/2] sunxi: last-minute H616 fixes
@ 2021-03-30 13:01 Andre Przywara
  2021-03-30 13:01 ` [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM Andre Przywara
  2021-03-30 13:01 ` [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node Andre Przywara
  0 siblings, 2 replies; 8+ messages in thread
From: Andre Przywara @ 2021-03-30 13:01 UTC (permalink / raw)
  To: Jernej Skrabec, Samuel Holland, Jagan Teki
  Cc: Simon Glass, Tom Rini, u-boot, linux-sunxi, linux-sunxi

The link address of the BL31 Trusted Firmware code has changed during
the development, so we need to fix the load address in our FIT image
template accordingly. The H616 TF-A patches are about to be merged now:

https://review.trustedfirmware.org/q/topic:%22allwinner_h616%22+(status:open%20OR%20status:merged)

Since H616 support was introduced in this cycle's merge window, we should
merge those fixes before the release, to avoid compatiblity issues.

The second patch defers to TF-A to add the reserved memory node, we
didn't have this code in the TF-A series initially. Having two
conflicting reserved memory locations doesn't fly very well, so this one
drops our hardcoded version.

Thanks!
Andre

Andre Przywara (2):
  sunxi: H616: Change TF-A load address to beginning of DRAM
  sunxi: dts: H616: Drop reserved-memory node

 arch/arm/dts/sun50i-h616.dtsi  | 12 ------------
 arch/arm/dts/sunxi-u-boot.dtsi |  2 +-
 2 files changed, 1 insertion(+), 13 deletions(-)

-- 
2.17.5


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

* [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM
  2021-03-30 13:01 [For v2021.04] [PATCH 0/2] sunxi: last-minute H616 fixes Andre Przywara
@ 2021-03-30 13:01 ` Andre Przywara
  2021-03-30 13:48   ` Samuel Holland
  2021-03-30 13:01 ` [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node Andre Przywara
  1 sibling, 1 reply; 8+ messages in thread
From: Andre Przywara @ 2021-03-30 13:01 UTC (permalink / raw)
  To: Jernej Skrabec, Samuel Holland, Jagan Teki
  Cc: Simon Glass, Tom Rini, u-boot, linux-sunxi, linux-sunxi

Loading Trusted-Firmware's BL31 at 16KB into DRAM was originally a hack
to allow sharing more code with the other SoCs (which use this offset
in SRAM). However there is no longer a reason for that, as the
problematic macros have been properly separated there.

The latest (and hopefully final) TF-A code drop now changes the load
address to the beginning of DRAM, which is also more easily protected
by the Trustzone memory controller (code to be done).

Adjust the load address of BL31 now, to avoid any issues with
incompatible versions later on (the TF-A patches are about to be merged).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/dts/sunxi-u-boot.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
index abe629c55e5..cd096bf2a06 100644
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -4,7 +4,7 @@
 #define BL31_ADDR 0x104000
 #define  SCP_ADDR 0x114000
 #elif defined(CONFIG_MACH_SUN50I_H616)
-#define BL31_ADDR 0x40004000
+#define BL31_ADDR 0x40000000
 #else
 #define BL31_ADDR  0x44000
 #define  SCP_ADDR  0x50000
-- 
2.17.5


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

* [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node
  2021-03-30 13:01 [For v2021.04] [PATCH 0/2] sunxi: last-minute H616 fixes Andre Przywara
  2021-03-30 13:01 ` [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM Andre Przywara
@ 2021-03-30 13:01 ` Andre Przywara
  2021-03-30 13:28   ` Jagan Teki
  1 sibling, 1 reply; 8+ messages in thread
From: Andre Przywara @ 2021-03-30 13:01 UTC (permalink / raw)
  To: Jernej Skrabec, Samuel Holland, Jagan Teki
  Cc: Simon Glass, Tom Rini, u-boot, linux-sunxi, linux-sunxi

Trusted Firmware now adds the /reserved-memory subnode to the DT at
runtime[1], putting in the right values.

Drop our hard-coded version, as this might clash with the actual values
(which have also changed), and rely on TF-A to add the node.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7770

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/dts/sun50i-h616.dtsi | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
index 953e8fac20f..dd4d2f31111 100644
--- a/arch/arm/dts/sun50i-h616.dtsi
+++ b/arch/arm/dts/sun50i-h616.dtsi
@@ -51,18 +51,6 @@
 		};
 	};
 
-	reserved-memory {
-		#address-cells = <2>;
-		#size-cells = <2>;
-		ranges;
-
-		/* 512KiB reserved for ARM Trusted Firmware (BL31) */
-		secmon_reserved: secmon@40000000 {
-			reg = <0x0 0x40000000 0x0 0x80000>;
-			no-map;
-		};
-	};
-
 	osc24M: osc24M_clk {
 		#clock-cells = <0>;
 		compatible = "fixed-clock";
-- 
2.17.5


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

* Re: [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node
  2021-03-30 13:01 ` [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node Andre Przywara
@ 2021-03-30 13:28   ` Jagan Teki
  2021-03-30 13:51     ` Samuel Holland
  2021-03-30 14:13     ` Andre Przywara
  0 siblings, 2 replies; 8+ messages in thread
From: Jagan Teki @ 2021-03-30 13:28 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Jernej Skrabec, Samuel Holland, Simon Glass, Tom Rini,
	U-Boot-Denx, linux-sunxi, linux-sunxi

On Tue, Mar 30, 2021 at 6:31 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> Trusted Firmware now adds the /reserved-memory subnode to the DT at
> runtime[1], putting in the right values.
>
> Drop our hard-coded version, as this might clash with the actual values
> (which have also changed), and rely on TF-A to add the node.
>
> [1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7770
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm/dts/sun50i-h616.dtsi | 12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
> index 953e8fac20f..dd4d2f31111 100644
> --- a/arch/arm/dts/sun50i-h616.dtsi
> +++ b/arch/arm/dts/sun50i-h616.dtsi
> @@ -51,18 +51,6 @@
>                 };
>         };
>
> -       reserved-memory {
> -               #address-cells = <2>;
> -               #size-cells = <2>;
> -               ranges;
> -
> -               /* 512KiB reserved for ARM Trusted Firmware (BL31) */
> -               secmon_reserved: secmon@40000000 {
> -                       reg = <0x0 0x40000000 0x0 0x80000>;
> -                       no-map;
> -               };
> -       };
> -

As said always. it's better to not touch Linux dts files. If the same
fix same available in Linux add SHA1 on the commit message otherwise
keep /delete-node on -u-boot.dtsi. This how we are maintaining sofar
at least on sunxi.

Jagan.

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

* Re: [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM
  2021-03-30 13:01 ` [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM Andre Przywara
@ 2021-03-30 13:48   ` Samuel Holland
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Holland @ 2021-03-30 13:48 UTC (permalink / raw)
  To: Andre Przywara, Jernej Skrabec, Jagan Teki
  Cc: Simon Glass, Tom Rini, u-boot, linux-sunxi, linux-sunxi

On 3/30/21 8:01 AM, Andre Przywara wrote:
> Loading Trusted-Firmware's BL31 at 16KB into DRAM was originally a hack
> to allow sharing more code with the other SoCs (which use this offset
> in SRAM). However there is no longer a reason for that, as the
> problematic macros have been properly separated there.
> 
> The latest (and hopefully final) TF-A code drop now changes the load
> address to the beginning of DRAM, which is also more easily protected
> by the Trustzone memory controller (code to be done).
> 
> Adjust the load address of BL31 now, to avoid any issues with
> incompatible versions later on (the TF-A patches are about to be merged).
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Samuel Holland <samuel@sholland.org>

> ---
>  arch/arm/dts/sunxi-u-boot.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
> index abe629c55e5..cd096bf2a06 100644
> --- a/arch/arm/dts/sunxi-u-boot.dtsi
> +++ b/arch/arm/dts/sunxi-u-boot.dtsi
> @@ -4,7 +4,7 @@
>  #define BL31_ADDR 0x104000
>  #define  SCP_ADDR 0x114000
>  #elif defined(CONFIG_MACH_SUN50I_H616)
> -#define BL31_ADDR 0x40004000
> +#define BL31_ADDR 0x40000000
>  #else
>  #define BL31_ADDR  0x44000
>  #define  SCP_ADDR  0x50000
> 


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

* Re: [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node
  2021-03-30 13:28   ` Jagan Teki
@ 2021-03-30 13:51     ` Samuel Holland
  2021-03-30 14:05       ` Jagan Teki
  2021-03-30 14:13     ` Andre Przywara
  1 sibling, 1 reply; 8+ messages in thread
From: Samuel Holland @ 2021-03-30 13:51 UTC (permalink / raw)
  To: Jagan Teki, Andre Przywara
  Cc: Jernej Skrabec, Simon Glass, Tom Rini, U-Boot-Denx, linux-sunxi,
	linux-sunxi

On 3/30/21 8:28 AM, Jagan Teki wrote:
> On Tue, Mar 30, 2021 at 6:31 PM Andre Przywara <andre.przywara@arm.com> wrote:
>>
>> Trusted Firmware now adds the /reserved-memory subnode to the DT at
>> runtime[1], putting in the right values.
>>
>> Drop our hard-coded version, as this might clash with the actual values
>> (which have also changed), and rely on TF-A to add the node.
>>
>> [1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7770
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Samuel Holland <samuel@sholland.org>

>> ---
>>  arch/arm/dts/sun50i-h616.dtsi | 12 ------------
>>  1 file changed, 12 deletions(-)
>>
>> diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
>> index 953e8fac20f..dd4d2f31111 100644
>> --- a/arch/arm/dts/sun50i-h616.dtsi
>> +++ b/arch/arm/dts/sun50i-h616.dtsi
>> @@ -51,18 +51,6 @@
>>                 };
>>         };
>>
>> -       reserved-memory {
>> -               #address-cells = <2>;
>> -               #size-cells = <2>;
>> -               ranges;
>> -
>> -               /* 512KiB reserved for ARM Trusted Firmware (BL31) */
>> -               secmon_reserved: secmon@40000000 {
>> -                       reg = <0x0 0x40000000 0x0 0x80000>;
>> -                       no-map;
>> -               };
>> -       };
>> -
> 
> As said always. it's better to not touch Linux dts files. If the same
> fix same available in Linux add SHA1 on the commit message otherwise
> keep /delete-node on -u-boot.dtsi. This how we are maintaining sofar
> at least on sunxi.

This file has not yet been added to the Linux tree, so that rule does not apply
in this case.

Cheers,
Samuel

> Jagan.
> 


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

* Re: [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node
  2021-03-30 13:51     ` Samuel Holland
@ 2021-03-30 14:05       ` Jagan Teki
  0 siblings, 0 replies; 8+ messages in thread
From: Jagan Teki @ 2021-03-30 14:05 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Andre Przywara, Jernej Skrabec, Simon Glass, Tom Rini,
	U-Boot-Denx, linux-sunxi, linux-sunxi

On Tue, Mar 30, 2021 at 7:21 PM Samuel Holland <samuel@sholland.org> wrote:
>
> On 3/30/21 8:28 AM, Jagan Teki wrote:
> > On Tue, Mar 30, 2021 at 6:31 PM Andre Przywara <andre.przywara@arm.com> wrote:
> >>
> >> Trusted Firmware now adds the /reserved-memory subnode to the DT at
> >> runtime[1], putting in the right values.
> >>
> >> Drop our hard-coded version, as this might clash with the actual values
> >> (which have also changed), and rely on TF-A to add the node.
> >>
> >> [1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7770
> >>
> >> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>
> Reviewed-by: Samuel Holland <samuel@sholland.org>
>
> >> ---
> >>  arch/arm/dts/sun50i-h616.dtsi | 12 ------------
> >>  1 file changed, 12 deletions(-)
> >>
> >> diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
> >> index 953e8fac20f..dd4d2f31111 100644
> >> --- a/arch/arm/dts/sun50i-h616.dtsi
> >> +++ b/arch/arm/dts/sun50i-h616.dtsi
> >> @@ -51,18 +51,6 @@
> >>                 };
> >>         };
> >>
> >> -       reserved-memory {
> >> -               #address-cells = <2>;
> >> -               #size-cells = <2>;
> >> -               ranges;
> >> -
> >> -               /* 512KiB reserved for ARM Trusted Firmware (BL31) */
> >> -               secmon_reserved: secmon@40000000 {
> >> -                       reg = <0x0 0x40000000 0x0 0x80000>;
> >> -                       no-map;
> >> -               };
> >> -       };
> >> -
> >
> > As said always. it's better to not touch Linux dts files. If the same
> > fix same available in Linux add SHA1 on the commit message otherwise
> > keep /delete-node on -u-boot.dtsi. This how we are maintaining sofar
> > at least on sunxi.
>
> This file has not yet been added to the Linux tree, so that rule does not apply
> in this case.

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

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

* Re: [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node
  2021-03-30 13:28   ` Jagan Teki
  2021-03-30 13:51     ` Samuel Holland
@ 2021-03-30 14:13     ` Andre Przywara
  1 sibling, 0 replies; 8+ messages in thread
From: Andre Przywara @ 2021-03-30 14:13 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Jernej Skrabec, Samuel Holland, Simon Glass, Tom Rini,
	U-Boot-Denx, linux-sunxi, linux-sunxi

On Tue, 30 Mar 2021 18:58:23 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

Hi Jagan,

> On Tue, Mar 30, 2021 at 6:31 PM Andre Przywara <andre.przywara@arm.com> wrote:
> >
> > Trusted Firmware now adds the /reserved-memory subnode to the DT at
> > runtime[1], putting in the right values.
> >
> > Drop our hard-coded version, as this might clash with the actual values
> > (which have also changed), and rely on TF-A to add the node.
> >
> > [1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7770
> >
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> >  arch/arm/dts/sun50i-h616.dtsi | 12 ------------
> >  1 file changed, 12 deletions(-)
> >
> > diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
> > index 953e8fac20f..dd4d2f31111 100644
> > --- a/arch/arm/dts/sun50i-h616.dtsi
> > +++ b/arch/arm/dts/sun50i-h616.dtsi
> > @@ -51,18 +51,6 @@
> >                 };
> >         };
> >
> > -       reserved-memory {
> > -               #address-cells = <2>;
> > -               #size-cells = <2>;
> > -               ranges;
> > -
> > -               /* 512KiB reserved for ARM Trusted Firmware (BL31) */
> > -               secmon_reserved: secmon@40000000 {
> > -                       reg = <0x0 0x40000000 0x0 0x80000>;
> > -                       no-map;
> > -               };
> > -       };
> > -  
> 
> As said always. it's better to not touch Linux dts files. If the same
> fix same available in Linux add SHA1 on the commit message otherwise
> keep /delete-node on -u-boot.dtsi. This how we are maintaining sofar
> at least on sunxi.

this DT is not in Linux yet.
As this is a new SoC, we have to start at some point, and getting TF-A,
Linux and U-Boot patches merged at the same time is virtually
impossible. Ideally we have some bootloader support first, so that
people can test the kernel patches, for instance.

So this DT is a tentative one, just here to make U-Boot happy. It is
expected to change, and will be synced once it's merged into Linux.

As mentioned, the TF-A patches were changed after the U-Boot patches
were merged, so this node was needed back then, but is obsolete now.

Cheers,
Andre

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

end of thread, other threads:[~2021-03-30 14:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 13:01 [For v2021.04] [PATCH 0/2] sunxi: last-minute H616 fixes Andre Przywara
2021-03-30 13:01 ` [PATCH 1/2] sunxi: H616: Change TF-A load address to beginning of DRAM Andre Przywara
2021-03-30 13:48   ` Samuel Holland
2021-03-30 13:01 ` [PATCH 2/2] sunxi: dts: H616: Drop reserved-memory node Andre Przywara
2021-03-30 13:28   ` Jagan Teki
2021-03-30 13:51     ` Samuel Holland
2021-03-30 14:05       ` Jagan Teki
2021-03-30 14:13     ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).