mpc85xx: increase available RAM on Extreme Networks WS-AP3825i
authorDavid Bauer <mail@david-bauer.net>
Sun, 3 Dec 2023 07:03:57 +0000 (08:03 +0100)
committerDavid Bauer <mail@david-bauer.net>
Mon, 4 Dec 2023 00:10:32 +0000 (01:10 +0100)
The system-mamory size was page-aligned prior to this commit, only
enabling to use 192MB of system memory of the 256 available.

This was due to the system-memory being manually shrinked to reserve the
upper 1MB for the second-core bootpage in the loader as well as the OS.

Fix this properly in the loader and in Linux using reserved-memory
definitions. This enables the device to use 250MB of system memory.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 57d7382cb159dbb15b8e281cad90a65d4c0201f6)

target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts
target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch [new file with mode: 0644]

index a347900e5dfe3ef68b2fa24cf929477674e09863..3cff69c689122c0d7c1b9c2d4645a74e72702190 100644 (file)
@@ -9,6 +9,9 @@
        model = "Extreme Networks WS-AP3825i";
        compatible = "extreme-networks,ws-ap3825i";
 
+       #address-cells = <2>;
+       #size-cells = <2>;
+
        aliases {
                ethernet0 = &enet0;
                ethernet1 = &enet2;
        };
 
        memory {
-               /* Reserve upper MB for second-core-bootpage */
-               reg = <0x0 0x0 0x0 0xff00000>;
+               reg = <0x0 0x0 0x0 0x10000000>;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               cpu1-bootpage@e000000 {
+                       /* Reserve upper 1 MB for second-core-bootpage */
+                       reg = <0x0 0xff00000 0x0 0x100000>;
+                       no-map;
+               };
        };
 
        soc@ffe00000 {
diff --git a/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch b/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch
new file mode 100644 (file)
index 0000000..1ff80a5
--- /dev/null
@@ -0,0 +1,41 @@
+From 5f856ccc34df25060d36a5a81b7b45b574d86e35 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail@david-bauer.net>
+Date: Sun, 3 Dec 2023 20:09:24 +0100
+Subject: [PATCH] arch: powerpc: simpleboot: prevent overwrite of CPU1
+ spin-table
+
+Don't overwrite the spin-table of additional CPU cores with loader-heap.
+
+U-Boot places the spin-table for CPU1 on P1020 SoCs in the top 1MB of
+system-memory. Instead of parsing reserved-memory (which would be
+considerable more work), reduce the available system-memory for the
+loader by 1MB.
+
+This prevents the loader from overwriting the spin-table of
+additional CPU cores on these platforms.
+
+Linux itself needs to be made aware by this using reserved-memory
+definitions.
+
+This patch is required for using CPU1 on the Extreme Networks
+WS-AP3825i.
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+---
+ arch/powerpc/boot/simpleboot.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/powerpc/boot/simpleboot.c
++++ b/arch/powerpc/boot/simpleboot.c
+@@ -65,6 +65,11 @@ void platform_init(unsigned long r3, uns
+       if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL)
+               memsize64 = 0xffffffff;
++      /* Reserve upper 1 MB of memory for CPU1 spin-table */
++      if (memsize64 > 0x100000) {
++              memsize64 = memsize64 - 0x100000;
++      }
++
+       /* finally, setup the timebase */
+       node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
+                                            "cpu", sizeof("cpu"));