ARM64: dts: meson-gx: Add reserved memory zone and usable memory range
Subsystems (2)
PATCH v2 1/1 ARM64: dts: meson-gx: Add reserved memory zone and usable memory range
The Amlogic Meson GXBB/GXL/GXM secure monitor uses part of the memory space, this patch adds this reserved zone and redefines the usable memory range.
---
Changes since v1 at [1] :
- Renamed reg into linux,usable-memory to ovveride u-boot memory
- only kept secmon memory zone
[1] http://lkml.kernel.org/r/20161212101801.28491-1-narmstrong at baylibre.com
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 12 ++++++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 2 +- 11 files changed, 22 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +1 -1
@@ -56,7 +56,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio_boot {
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +12 -0
@@ -55,6 +55,18 @@ #address-cells = <2>; #size-cells = <2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* global autoconfigured region for contiguous allocations */ + secmon: secmon { + reg = <0x0 0x10000000 0x0 0x200000>; + no-map; + }; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>;
arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +1 -1
@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; leds {
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +1 -1
@@ -61,7 +61,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; usb_otg_pwr: regulator-usb-pwrs {
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +1 -1
@@ -55,7 +55,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; usb_pwr: regulator-usb-pwrs {
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts +1 -1
@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts +1 -1
@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; };
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts +1 -1
@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };
arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts +1 -1
@@ -60,7 +60,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_card: gpio-regulator {
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts +1 -1
@@ -59,7 +59,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };
arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +1 -1
@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio-boot {
Signature · 1 line
1.9.1
Quoted 42 lines · Neil Armstrong
The Amlogic Meson GXBB/GXL/GXM secure monitor uses part of the memory space, this patch adds this reserved zone and redefines the usable memory range.
Signed-off-by Neil Armstrong <[email protected]>---
Changes since v1 at [1] :
- Renamed reg into linux,usable-memory to ovveride u-boot memory
- only kept secmon memory zone[1] http://lkml.kernel.org/r/20161212101801.28491-1-narmstrong at baylibre.com
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 12 ++++++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 2 +- 11 files changed, 22 insertions(+), 10 deletions(-)arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +1
-1@@ -56,7 +56,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio_boot {arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0
-0
arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 63
Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6
-0@@ -55,6 +55,18 @@ #address-cells = <2>; #size-cells = <2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* global autoconfigured region for contiguous allocations */
This comment does not make sense here. It is what you would write over a compatible to "shared-dma-pool" region. Cf. hi6220-hikey.dts
I suggest you use
/* Amlogic Meson GXBB/GXL/GXM secure monitor reserved memory */ instead.
Doesn't firmware/meson/meson_sm.c already reserve a communication area to secmon with quite a different address range?
So where is this new region secmon set up? And where is it used?
Best regards
Heinrich
Quoted 124 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6
-0+ secmon: secmon { + reg = <0x0 0x10000000 0x0 0x200000>; + no-map; + }; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>;arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +1
-1@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; leds {arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +1
-1@@ -61,7 +61,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; usb_otg_pwr: regulator-usb-pwrs {arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +1
-1@@ -55,7 +55,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; usb_pwr: regulator-usb-pwrs {arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts +1
-1@@ -60,7 +60,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_card: gpio-regulator {arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts +1
-1@@ -59,7 +59,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +1
-1@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio-boot {
Quoted 56 lines · Heinrich Schuchardt
Quoted 42 lines · Neil Armstrong
The Amlogic Meson GXBB/GXL/GXM secure monitor uses part of the memory space, this patch adds this reserved zone and redefines the usable memory range.
Signed-off-by Neil Armstrong <[email protected]>---
Changes since v1 at [1] :
- Renamed reg into linux,usable-memory to ovveride u-boot memory
- only kept secmon memory zone[1] http://lkml.kernel.org/r/20161212101801.28491-1-narmstrong at baylibre.com
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 12 ++++++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 2 +- 11 files changed, 22 insertions(+), 10 deletions(-)arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +1
-1@@ -56,7 +56,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio_boot {arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0
-0arch/arm64/boot/dts/amlogic/meson-gx.dtsi line 63
Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6
-0@@ -55,6 +55,18 @@ #address-cells = <2>; #size-cells = <2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* global autoconfigured region for contiguous allocations */This comment does not make sense here. It is what you would write over a compatible to "shared-dma-pool" region. Cf.
hi6220-hikey.dts
Quoted 3 lines
I suggest you use
/* Amlogic Meson GXBB/GXL/GXM secure monitor reserved memory */ instead.
Yes, will fix this in a similar manner.
Quoted 4 lines
Doesn't
firmware/meson/meson_sm.calready reserve a communication area to secmon with quite a different address range?
So where is this new region secmon set up? And where is it used?
Yes, it gets the memory zone from the secure monitor and reserves it, only if enabled and very late.
Neil
Quoted 130 lines
Best regards
Heinrich
Quoted 124 lines
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6
-0+ secmon: secmon { + reg = <0x0 0x10000000 0x0 0x200000>; + no-map; + }; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>;arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +1
-1@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; leds {arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +1
-1@@ -61,7 +61,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; usb_otg_pwr: regulator-usb-pwrs {arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +1
-1@@ -55,7 +55,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; usb_pwr: regulator-usb-pwrs {arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts +1
-1@@ -50,6 +50,6 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts +1
-1@@ -60,7 +60,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_card: gpio-regulator {arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts +1
-1@@ -59,7 +59,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; };arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +1
-1@@ -62,7 +62,7 @@ memory at 0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio-boot {