[PATCH 20/28] ARM: at91: sama5d2: reuse stack set-up by first stage

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jul 1 01:23:32 EDT 2020


Stack is always set up to end of SRAM before PBL, either by ROM code or
by first stage bootloader, be it at91bootstrap or barebox in a later
commit, so no need to change the stack pointer again.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/boards/sama5d27-giantboard/lowlevel.c | 13 +++----------
 arch/arm/boards/sama5d27-som1/lowlevel.c       | 13 +++----------
 2 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/arch/arm/boards/sama5d27-giantboard/lowlevel.c b/arch/arm/boards/sama5d27-giantboard/lowlevel.c
index e08217105bcc..4419e946f1a8 100644
--- a/arch/arm/boards/sama5d27-giantboard/lowlevel.c
+++ b/arch/arm/boards/sama5d27-giantboard/lowlevel.c
@@ -34,10 +34,12 @@ static void dbgu_init(void)
 
 extern char __dtb_z_at91_sama5d27_giantboard_start[];
 
-static noinline void giantboard_entry(void)
+ENTRY_FUNCTION(start_sama5d27_giantboard, r0, r1, r2)
 {
 	void *fdt;
 
+	arm_cpu_lowlevel_init();
+
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		dbgu_init();
 
@@ -45,12 +47,3 @@ static noinline void giantboard_entry(void)
 
 	barebox_arm_entry(SAMA5_DDRCS, SZ_128M, fdt);
 }
-
-ENTRY_FUNCTION(start_sama5d27_giantboard, r0, r1, r2)
-{
-	arm_cpu_lowlevel_init();
-
-	arm_setup_stack(SAMA5D2_SRAM_BASE + SAMA5D2_SRAM_SIZE);
-
-	giantboard_entry();
-}
diff --git a/arch/arm/boards/sama5d27-som1/lowlevel.c b/arch/arm/boards/sama5d27-som1/lowlevel.c
index 2b39e5abc396..b7780ec8ae43 100644
--- a/arch/arm/boards/sama5d27-som1/lowlevel.c
+++ b/arch/arm/boards/sama5d27-som1/lowlevel.c
@@ -58,10 +58,12 @@ static void ek_dbgu_init(void)
 
 extern char __dtb_z_at91_sama5d27_som1_ek_start[];
 
-static noinline void som1_entry(void)
+ENTRY_FUNCTION(start_sama5d27_som1_ek, r0, r1, r2)
 {
 	void *fdt;
 
+	arm_cpu_lowlevel_init();
+
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		ek_dbgu_init();
 
@@ -70,12 +72,3 @@ static noinline void som1_entry(void)
 	ek_turn_led(RGB_LED_GREEN);
 	barebox_arm_entry(SAMA5_DDRCS, SZ_128M, fdt);
 }
-
-ENTRY_FUNCTION(start_sama5d27_som1_ek, r0, r1, r2)
-{
-	arm_cpu_lowlevel_init();
-
-	arm_setup_stack(SAMA5D2_SRAM_BASE + SAMA5D2_SRAM_SIZE);
-
-	som1_entry();
-}
-- 
2.27.0




More information about the barebox mailing list