Skip to contentSkip to conversation

arm64: dts: meson: add ATF BL32 reserved-memory regions

PATCH Applied Christian Hewitt 4 participants 12 messages Jan 26, 2022 – Feb 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: meson: add ATF BL32 reserved-memory regions

This series supersedes [0] which fixed a long-running kernel panic issue seen with Beelink G12B devices booted from Amlogic vendor firmware. The same issue exists with a wider set of devices from GXBB to SM1, although it is not often seen due to my kernel fork including 'catch-all' patches for some time (the meson-gx patch was suggested by Matheusz in 2019) and many distros actively supporting Amlogic hardware consuming some or all of my regular patchset.

I've also included a cleanup to the SEI510/SEI610 board files. If that's not desirable feel free to ignore that patch. I also dropped the fixes tagging as I'm not sure what original commits could be targetted. If you think fixes are good please provide some guidance and I'll be happy to send a revised series.

[0] https://patchwork.kernel.org/project/linux-amlogic/list/?series=607446

Christian Hewitt (3):
arm64: dts: meson-gx: add ATF BL32 reserved-memory region
arm64: dts: meson-g12: add ATF BL32 reserved-memory region
arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610

 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 8 --------
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi         | 6 ++++++
 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts  | 8 --------
 4 files changed, 12 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 arm64: dts: meson-gx: add ATF BL32 reserved-memory region

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
index 6b457b2c30a4..aa14ea017a61 100644
@@ -49,6 +49,12 @@
 			no-map;
 		};
 
+		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+
 		linux,cma {
 			compatible = "shared-dma-pool";
 			reusable;
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 1/3] arm64: dts: meson-gx: add ATF BL32 reserved-memory region

Hi!

Quoted 14 lines · Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
  arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++
  1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 -0
index 6b457b2c30a4..aa14ea017a61 100644

arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 57

Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
@@ -49,6 +49,12 @@
  			no-map;
  		};
 
+		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+

How do I check if we need a similar patch for axg boards?

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 -0
  		linux,cma {
  			compatible = "shared-dma-pool";
  			reusable;
#3 lore raw

Re: [PATCH 1/3] arm64: dts: meson-gx: add ATF BL32 reserved-memory region

Quoted 19 lines · Vyacheslav

Hi!

Quoted 13 lines · Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 -0
index 6b457b2c30a4..aa14ea017a61 100644
@@ -49,6 +49,12 @@
 			no-map;
Quoted 8 lines

arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 57

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +5 -0
 		};
 +		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+

How do I check if we need a similar patch for axg boards?

Are they booting using Amlogic (vendor) u-boot sources that include bl32.img in the FIP signing recipe?

If booting from upstream u-boot, like JetHome boards, it’s nothing to worry about.

Christian

#4 lore raw

Re: [PATCH 1/3] arm64: dts: meson-gx: add ATF BL32 reserved-memory region

In reply to Vyacheslav

Hi,

Quoted 12 lines · Vyacheslav

Hi!

Quoted 9 lines · Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
  arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++

  1 file changed, 6 insertions(+)
Quoted 21 lines
Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 -0
index 6b457b2c30a4..aa14ea017a61 100644
@@ -49,6 +49,12 @@
               no-map;
           };
Quoted 6 lines

  +        /* 32 MiB reserved for ARM Trusted Firmware (BL32) */ +        secmon_reserved_bl32: secmon@5300000 {
+            reg = <0x0 0x05300000 0x0 0x2000000>;
+            no-map;
+        };
+

How do I check if we need a similar patch for axg boards?

Quoted 4 lines

          linux,cma {
              compatible = "shared-dma-pool";
              reusable;

For AXG board with BL32 booting from vendor u-boot, yes.

Neil

Reviewed-by on v1 1/3
#5 lore raw

Re: [PATCH 1/3] arm64: dts: meson-gx: add ATF BL32 reserved-memory region

In reply to Christian Hewitt
Quoted 17 lines · Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 -0
index 6b457b2c30a4..aa14ea017a61 100644
@@ -49,6 +49,12 @@
 			no-map;
 		};

arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 60

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
 
+		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+
 		linux,cma {
 			compatible = "shared-dma-pool";
 			reusable;
#6 lore raw

PATCH 2/3 arm64: dts: meson-g12: add ATF BL32 reserved-memory region

In reply to Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
index 6d99c23261fb..45947c1031c4 100644
@@ -107,6 +107,12 @@
 			no-map;
 		};
 
+		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+
 		linux,cma {
 			compatible = "shared-dma-pool";
 			reusable;
Signature · 1 line
2.17.1
Reviewed-by on v1 2/3
#7 lore raw

Re: [PATCH 2/3] arm64: dts: meson-g12: add ATF BL32 reserved-memory region

Quoted 16 lines · Christian Hewitt

Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.

---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +0 -0
index 6d99c23261fb..45947c1031c4 100644
@@ -107,6 +107,12 @@
 			no-map;
 		};

arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi line 118

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
 
+		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
+		secmon_reserved_bl32: secmon@5300000 {
+			reg = <0x0 0x05300000 0x0 0x2000000>;
+			no-map;
+		};
+
 		linux,cma {
 			compatible = "shared-dma-pool";
 			reusable;
#8 lore raw

PATCH 3/3 arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610

In reply to Christian Hewitt

The BL32/TEE reserved-memory region is now inherited from the common family dtsi (meson-g12-common) so we can drop it from board files.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 8 --------
 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts  | 8 --------
 2 files changed, 16 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +0 -8
index d8838dde0f0f..4fb31c2ba31c 100644
@@ -157,14 +157,6 @@
 		regulator-always-on;
 	};
 
-	reserved-memory {
-		/* TEE Reserved Memory */
-		bl32_reserved: bl32@5000000 {
-			reg = <0x0 0x05300000 0x0 0x2000000>;
-			no-map;
-		};
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +0 -8
index 427475846fc7..a5d79f2f7c19 100644
@@ -203,14 +203,6 @@
 		regulator-always-on;
 	};
 
-	reserved-memory {
-		/* TEE Reserved Memory */
-		bl32_reserved: bl32@5000000 {
-			reg = <0x0 0x05300000 0x0 0x2000000>;
-			no-map;
-		};
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.17.1
Reviewed-by on v1 3/3
#9 lore raw

Re: [PATCH 3/3] arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610

Quoted 38 lines · Christian Hewitt

The BL32/TEE reserved-memory region is now inherited from the common family dtsi (meson-g12-common) so we can drop it from board files.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 8 --------
 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts  | 8 --------
 2 files changed, 16 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +0 -8
index d8838dde0f0f..4fb31c2ba31c 100644
@@ -157,14 +157,6 @@
 		regulator-always-on;
 	};
 
-	reserved-memory {
-		/* TEE Reserved Memory */
-		bl32_reserved: bl32@5000000 {
-			reg = <0x0 0x05300000 0x0 0x2000000>;
-			no-map;
-		};
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +0 -1
index 427475846fc7..a5d79f2f7c19 100644
@@ -203,14 +203,6 @@
 		regulator-always-on;
 	};
 
-	reserved-memory {

arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts line 208

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +0 -7
-		/* TEE Reserved Memory */
-		bl32_reserved: bl32@5000000 {
-			reg = <0x0 0x05300000 0x0 0x2000000>;
-			no-map;
-		};
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
maintainer Reviewed-by on the v1 series
#10 lore raw
In reply to Christian Hewitt
Quoted 8 lines · Christian Hewitt

This series supersedes [0] which fixed a long-running kernel panic issue seen with Beelink G12B devices booted from Amlogic vendor firmware. The same issue exists with a wider set of devices from GXBB to SM1, although it is not often seen due to my kernel fork including 'catch-all' patches for some time (the meson-gx patch was suggested by Matheusz in 2019) and many distros actively supporting Amlogic hardware consuming some or all of my regular patchset.

Quoted 5 lines

I've also included a cleanup to the SEI510/SEI610 board files. If that's not desirable feel free to ignore that patch. I also dropped the fixes tagging as I'm not sure what original commits could be targetted. If you think fixes are good please provide some guidance and I'll be happy to send a revised series.

#11 lore raw
In reply to Christian Hewitt

Hi,

Quoted 9 lines · Christian Hewitt

This series supersedes [0] which fixed a long-running kernel panic issue seen with Beelink G12B devices booted from Amlogic vendor firmware. The same issue exists with a wider set of devices from GXBB to SM1, although it is not often seen due to my kernel fork including 'catch-all' patches for some time (the meson-gx patch was suggested by Matheusz in 2019) and many distros actively supporting Amlogic hardware consuming some or all of my regular patchset.

[...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v5.17/fixes)

[1/3] arm64: dts: meson-gx: add ATF BL32 reserved-memory region

      https://git.kernel.org/amlogic/c/76577c9137456febb05b0e17d244113196a98968
[2/3] arm64: dts: meson-g12: add ATF BL32 reserved-memory region
      https://git.kernel.org/amlogic/c/08982a1b3aa2611c9c711d24825c9002d28536f4
[3/3] arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610
      https://git.kernel.org/amlogic/c/f26573e2bc9dfd551a0d5c6971f18cc546543312
Signature · 1 line
Neil