[PATCH v5 3/9] board_f: Correct stack reservation

Simon Glass sjg at chromium.org
Sun Dec 1 16:28:05 CET 2024


The reserve_stack_aligned() function already ensures that the resulting
address is aligned to a 16-byte boundary. The comment seems to suggest
that 16 is passed reserve_stack_aligned() to make it aligned.

Change the value to 0, since the stack can start at the current address,
if it is suitably aligned already.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 common/board_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 98dc2591e1d..677e37d93c0 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -601,7 +601,7 @@ __weak int arch_reserve_stacks(void)
 static int reserve_stacks(void)
 {
 	/* make stack pointer 16-byte aligned */
-	gd->start_addr_sp = reserve_stack_aligned(16);
+	gd->start_addr_sp = reserve_stack_aligned(0);
 
 	/*
 	 * let the architecture-specific code tailor gd->start_addr_sp and
-- 
2.43.0



More information about the U-Boot mailing list