mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	 Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH 1/2] arm: socfpga: axe5-eagle: fix stack location
Date: Wed, 13 May 2026 14:22:22 +0200	[thread overview]
Message-ID: <20260513-socfpga-agilex5-entry-v1-1-090758694c88@pengutronix.de> (raw)
In-Reply-To: <20260513-socfpga-agilex5-entry-v1-0-090758694c88@pengutronix.de>

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@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




  reply	other threads:[~2026-05-13 12:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 12:22 [PATCH 0/2] arm: socfpga: agilex5: fix stack in entry function Michael Tretter
2026-05-13 12:22 ` Michael Tretter [this message]
2026-05-13 12:22 ` [PATCH 2/2] arm: socfpga: agilex5: add helper for " Michael Tretter
2026-05-13 14:07 ` [PATCH 0/2] arm: socfpga: agilex5: fix stack in " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260513-socfpga-agilex5-entry-v1-1-090758694c88@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s.trumtrar@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox