[PATCH 23/28] ARM start: Add barebox_arm_boarddata function

Sascha Hauer s.hauer at pengutronix.de
Wed Oct 17 17:03:32 EDT 2012


The board specific lowlevel init code may wish to pass data from
the lowlevel code to the running barebox. This allows to pass data
on and to pick it up later.

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

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index ee351bb..901dc6d 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -26,6 +26,18 @@
 #include <asm/cache.h>
 #include <memory.h>
 
+static uint32_t __barebox_arm_boarddata;
+
+/*
+ * the board specific lowlevel init code can pass a pointer or
+ * data value to barebox_arm_entry() and pick it up later with
+ * this function.
+ */
+uint32_t barebox_arm_boarddata(void)
+{
+	return __barebox_arm_boarddata;
+}
+
 static noinline void __start(uint32_t membase, uint32_t memsize,
 		uint32_t boarddata)
 {
@@ -34,6 +46,8 @@ static noinline void __start(uint32_t membase, uint32_t memsize,
 	mem_malloc_init((void *)MALLOC_BASE,
 			(void *)(MALLOC_BASE + MALLOC_SIZE - 1));
 
+	__barebox_arm_boarddata = boarddata;
+
 	start_barebox();
 }
 
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index ce1eb47..e7355bb 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -39,4 +39,6 @@ uint32_t get_runtime_offset(void);
 void setup_c(void);
 void barebox_arm_entry(uint32_t membase, uint32_t memsize, uint32_t boarddata);
 
+uint32_t barebox_arm_boarddata(void);
+
 #endif	/* _BAREBOX_ARM_H_ */
-- 
1.7.10.4




More information about the barebox mailing list