Skip to contentSkip to conversation

arm64: dts: renesas: r8a77951: Add reserved memory region

PATCH In review Detlev Casanova 3 participants 4 messages Nov 14, 2022

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

PATCH 1/1 arm64: dts: renesas: r8a77951: Add reserved memory region

The 0x3000000 bytes memory region starting at 0x54000000 is reserved for the lossy_decompression hardware that will try to decompress any data written in the region.

Mark the region as no-map to prevent linux from using it as RAM.

---
 arch/arm64/boot/dts/renesas/r8a77951.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/renesas/r8a77951.dtsi +12 -0
index 07c8763c1e77..171833d91313 100644
@@ -290,6 +290,18 @@ CPU_SLEEP_1: cpu-sleep-1 {
 		};
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* device specific region for Lossy Decompression */
+		lossy_decompress: memory-region@54000000 {
+			no-map;
+			reg = <0x00000000 0x54000000 0x0 0x03000000>;
+		};
+	};
+
 	extal_clk: extal {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
Signature · 1 line
2.38.1
#1 lore raw
Quoted 37 lines

-----Original Message-----
From: Detlev Casanova <[email protected]>
Sent: 14 November 2022 19:49
To: [email protected]
Cc: Geert Uytterhoeven <[email protected]>; Magnus Damm <[email protected]>; Rob Herring <[email protected]>; Krzysztof Kozlowski <[email protected]>; open list:ARM/RENESAS ARCHITECTURE <[email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS <[email protected]>; Detlev Casanova <[email protected]>
Subject: [PATCH] arm64: dts: renesas: r8a77951: Add reserved memory region

The 0x3000000 bytes memory region starting at 0x54000000 is reserved for the lossy_decompression hardware that will try to decompress any data written in the region.

Mark the region as no-map to prevent linux from using it as RAM.

---
 arch/arm64/boot/dts/renesas/r8a77951.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/renesas/r8a77951.dtsi +1 -0
index 07c8763c1e77..171833d91313 100644
@@ -290,6 +290,18 @@ CPU_SLEEP_1: cpu-sleep-1 {
 		};
 	};
 
+	reserved-memory {

arch/arm64/boot/dts/renesas/r8a77951.dtsi CPU_SLEEP_1: cpu-sleep-1 { · line 303

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +10 -0
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* device specific region for Lossy Decompression */
+		lossy_decompress: memory-region@54000000 {
+			no-map;
+			reg = <0x00000000 0x54000000 0x0 0x03000000>;
+		};
+	};

Is not part of TFA[1]?

[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/plat/renesas/rcar/bl2_plat_setup.c#n174

Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +1 -1
+
 	extal_clk: extal {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
--

2.38.1

#2 lore raw
In reply to Detlev Casanova

Hi Detlev,

Quoted 7 lines · Detlev Casanova

The 0x3000000 bytes memory region starting at 0x54000000 is reserved for the lossy_decompression hardware that will try to decompress any data written in the region.

Mark the region as no-map to prevent linux from using it as RAM.

Thanks for your patch!

Quoted 7 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +1 -0
@@ -290,6 +290,18 @@ CPU_SLEEP_1: cpu-sleep-1 {
                };
        };
 
+       reserved-memory {

arch/arm64/boot/dts/renesas/r8a77951.dtsi CPU_SLEEP_1: cpu-sleep-1 { · line 303

Quoted 10 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +10 -0
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               /* device specific region for Lossy Decompression */
+               lossy_decompress: memory-region@54000000 {
+                       no-map;
+                       reg = <0x00000000 0x54000000 0x0 0x03000000>;
+               };
+       };

This depends on the firmware/boot loader stack. If it configures a Lossy Decompression region, it should make sure to pass this info through the various boot loader components to Linux, just like is already done with the memory regions, RPC-IF state, and OpTee configuration.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
Quoted 32 lines · On Monday, November 14, 2022 2:57:21 P.M. EST Geert Uytterhoeven wrote:

Hi Detlev,

On Mon, Nov 14, 2022 at 8:48 PM Detlev Casanova

Quoted 7 lines · <[email protected]> wrote:

The 0x3000000 bytes memory region starting at 0x54000000 is reserved for the lossy_decompression hardware that will try to decompress any data written in the region.

Mark the region as no-map to prevent linux from using it as RAM.

Thanks for your patch!

Quoted 17 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +9 -0
@@ -290,6 +290,18 @@ CPU_SLEEP_1: cpu-sleep-1 {
 
                };
 
        };
 
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               /* device specific region for Lossy Decompression */
+               lossy_decompress: memory-region@54000000 {
+                       no-map;
+                       reg = <0x00000000 0x54000000 0x0 0x03000000>;
Quoted 8 lines

arch/arm64/boot/dts/renesas/r8a77951.dtsi CPU_SLEEP_1: cpu-sleep-1 { · line 303

Quoted 2 lines
arch/arm64/boot/dts/renesas/r8a77951.dtsi +2 -0
+               };
+       };

This depends on the firmware/boot loader stack. If it configures a Lossy Decompression region, it should make sure to pass this info through the various boot loader components to Linux, just like is already done with the memory regions, RPC-IF state, and OpTee configuration.

Thanks for your fast answer ! I didn't realise ATF was doing that, I probably have a configuration issue in ATF then, I'll rebuild and start from there.

Thanks !

Quoted 3 lines

Gr{oetje,eeting}s,

Geert