[PATCH] ARM: tegra: set up stack before calling maincluster entry

Lucas Stach dev at lynxeye.de
Tue Apr 12 13:15:20 PDT 2016


Allows this code to work correct regardless of the used compiler
optimizations.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 arch/arm/mach-tegra/include/mach/lowlevel.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/lowlevel.h b/arch/arm/mach-tegra/include/mach/lowlevel.h
index f70688e..e9ba5ee 100644
--- a/arch/arm/mach-tegra/include/mach/lowlevel.h
+++ b/arch/arm/mach-tegra/include/mach/lowlevel.h
@@ -255,9 +255,6 @@ void tegra_cpu_lowlevel_setup(char *fdt)
 {
 	uint32_t r;
 
-	if (tegra_cpu_is_maincomplex())
-		tegra_maincomplex_entry(fdt - get_runtime_offset());
-
 	/* set the cpu to SVC32 mode */
 	__asm__ __volatile__("mrs %0, cpsr":"=r"(r));
 	r &= ~0x1f;
@@ -265,6 +262,10 @@ void tegra_cpu_lowlevel_setup(char *fdt)
 	__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
 
 	arm_setup_stack(TEGRA_IRAM_BASE + SZ_256K - 8);
+
+	if (tegra_cpu_is_maincomplex())
+		tegra_maincomplex_entry(fdt - get_runtime_offset());
+
 	tegra_ll_delay_setup();
 }
 
-- 
2.5.5




More information about the barebox mailing list