[PATCH 1/2] arm: socfpga: axe5-eagle: fix stack location
Michael Tretter
m.tretter at pengutronix.de
Wed May 13 05:22:22 PDT 2026
512K is the end of the OCRAM. THE SDM firmware uses the last page of the
OCRAM for handoff data, which is later read by barebox to retrieve board
configuration. Putting the stack on the same page may be dangerous and
lead to data corruption.
Move the stack below the handoff data.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
arch/arm/boards/arrow-axe5-eagle/lowlevel.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boards/arrow-axe5-eagle/lowlevel.c b/arch/arm/boards/arrow-axe5-eagle/lowlevel.c
index ffa5620413f6..b5a56a1a8c5f 100644
--- a/arch/arm/boards/arrow-axe5-eagle/lowlevel.c
+++ b/arch/arm/boards/arrow-axe5-eagle/lowlevel.c
@@ -8,11 +8,19 @@
#include <mach/socfpga/debug_ll.h>
#include <mach/socfpga/init.h>
#include <mach/socfpga/generic.h>
+#include <mach/socfpga/soc64-handoff.h>
#include <mach/socfpga/soc64-regs.h>
extern char __dtb_z_socfpga_agilex5_axe5_eagle_start[];
-#define AXE5_STACKTOP (SZ_512K)
+/*
+ * The SDM firmware uses the last page in the OCRAM for handoff data. Put the
+ * stack below the handoff data.
+ *
+ * Note: U-Boot puts the stack at 0x71000 (0x80000 - 0xf000) and reserves even
+ * more space.
+ */
+#define AXE5_STACKTOP SOC64_HANDOFF_BASE
static noinline void axe5_eagle_continue(void)
{
--
2.47.3
More information about the barebox
mailing list