[PATCH 01/12] ARM: split barebox_arm_head in two separate functions

Sascha Hauer s.hauer at pengutronix.de
Tue Jun 25 05:20:41 EDT 2013


This adds a new function __barebox_arm_head() which defines an
the regular barebox ARM header, but which jumps to the end of
the function so that this can be embedded into another function.
barebox_arm_head() now just uses it and jumps to barebox_arm_reset_vector
just like it did before.

This makes it possible to define board specific entry points.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/include/asm/barebox-arm-head.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
index 9a8cc87..af7164a 100644
--- a/arch/arm/include/asm/barebox-arm-head.h
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -43,7 +43,7 @@ static inline void arm_cpu_lowlevel_init(void)
 #ifdef CONFIG_HAVE_MACH_ARM_HEAD
 #include <mach/barebox-arm-head.h>
 #else
-static inline void barebox_arm_head(void)
+static inline void __barebox_arm_head(void)
 {
 	__asm__ __volatile__ (
 #ifdef CONFIG_THUMB2_BAREBOX
@@ -52,12 +52,12 @@ static inline void barebox_arm_head(void)
 		"bx r9\n"
 		".thumb\n"
 		"1:\n"
-		"bl barebox_arm_reset_vector\n"
+		"bl 2f\n"
 		".rept 10\n"
 		"1: b 1b\n"
 		".endr\n"
 #else
-		"b barebox_arm_reset_vector\n"
+		"b 2f\n"
 		"1: b 1b\n"
 		"1: b 1b\n"
 		"1: b 1b\n"
@@ -74,6 +74,14 @@ static inline void barebox_arm_head(void)
 		".rept 8\n"
 		".word 0x55555555\n"
 		".endr\n"
+		"2:\n"
+	);
+}
+static inline void barebox_arm_head(void)
+{
+	__barebox_arm_head();
+	__asm__ __volatile__ (
+		"b barebox_arm_reset_vector\n"
 	);
 }
 #endif
-- 
1.8.3.1




More information about the barebox mailing list