summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-07-02 08:00:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-02 08:20:17 +0200
commitb8b0a7f19956a4ee936c374351b5f081e9d6b405 (patch)
treece9db68a9d4fcd3dd86b20c10d49f3e2b540b9b5
parentfc6cb7aeaf6f96505ba15a99b5d02102377ee79a (diff)
downloadbarebox-b8b0a7f19956a4ee936c374351b5f081e9d6b405.tar.gz
barebox-b8b0a7f19956a4ee936c374351b5f081e9d6b405.tar.xz
ARM: start: Fix code reordering problem
This adds a barrier after setup_c(). This is necessary because otherwise some global variable assignments may be reordered by the compiler to be executed before setup_c which cannot work. This was observed when doing other unrelated changes to the start function, it seems in current mainline state the compiler does not actually reorder the code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/cpu/start.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 304ed0cee7..91fd9b987b 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -61,6 +61,8 @@ static noinline __noreturn void __start(unsigned long membase,
setup_c();
+ barrier();
+
pr_debug("memory at 0x%08lx, size 0x%08lx\n", membase, memsize);
barebox_boarddata = boarddata;