150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch 1.4 KB

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