mpc85xx: refresh kernel config
[openwrt/staging/stintel.git] / target / linux / mpc85xx / patches-6.1 / 150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch
1 From 5f856ccc34df25060d36a5a81b7b45b574d86e35 Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Sun, 3 Dec 2023 20:09:24 +0100
4 Subject: [PATCH] arch: powerpc: simpleboot: prevent overwrite of CPU1
5 spin-table
6
7 Don't overwrite the spin-table of additional CPU cores with loader-heap.
8
9 U-Boot places the spin-table for CPU1 on P1020 SoCs in the top 1MB of
10 system-memory. Instead of parsing reserved-memory (which would be
11 considerable more work), reduce the available system-memory for the
12 loader by 1MB.
13
14 This prevents the loader from overwriting the spin-table of
15 additional CPU cores on these platforms.
16
17 Linux itself needs to be made aware by this using reserved-memory
18 definitions.
19
20 This patch is required for using CPU1 on the Extreme Networks
21 WS-AP3825i.
22
23 Signed-off-by: David Bauer <mail@david-bauer.net>
24 ---
25 arch/powerpc/boot/simpleboot.c | 5 +++++
26 1 file changed, 5 insertions(+)
27
28 --- a/arch/powerpc/boot/simpleboot.c
29 +++ b/arch/powerpc/boot/simpleboot.c
30 @@ -65,6 +65,11 @@ void platform_init(unsigned long r3, uns
31 if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL)
32 memsize64 = 0xffffffff;
33
34 + /* Reserve upper 1 MB of memory for CPU1 spin-table */
35 + if (memsize64 > 0x100000) {
36 + memsize64 = memsize64 - 0x100000;
37 + }
38 +
39 /* finally, setup the timebase */
40 node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
41 "cpu", sizeof("cpu"));