[PATCH 4/4] ARM: Add missing barebox_arm_boarddata function

Sascha Hauer s.hauer at pengutronix.de
Sun Mar 10 06:19:21 EDT 2013


The comment above barebox_arm_entry promises to preserve the boarddata
variable passed to it which can then later get back with
barebox_arm_boarddata(). This function was missing so far, add it.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/cpu/start.c               | 10 ++++++++++
 arch/arm/include/asm/barebox-arm.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index cd34d9c..943fa46 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -30,6 +30,15 @@
 #include "mmu-early.h"
 
 unsigned long arm_stack_top;
+static unsigned long barebox_boarddata;
+
+/*
+ * return the boarddata variable passed to barebox_arm_entry
+ */
+unsigned long barebox_arm_boarddata(void)
+{
+	return barebox_boarddata;
+}
 
 static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
@@ -39,6 +48,7 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize,
 
 	setup_c();
 
+	barebox_boarddata = boarddata;
 	arm_stack_top = endmem;
 	endmem -= STACK_SIZE; /* Stack */
 
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 9c10e36..f097092 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -41,5 +41,6 @@ uint32_t get_runtime_offset(void);
 
 void setup_c(void);
 void __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
+unsigned long barebox_arm_boarddata(void);
 
 #endif	/* _BAREBOX_ARM_H_ */
-- 
1.8.2.rc2




More information about the barebox mailing list