[U-Boot] [RFC PATCH 07/19] Add spl load feature

Simon Glass sjg at chromium.org
Wed Dec 28 07:35:48 CET 2011


Signed-off-by: Simon Glass <sjg at chromium.org>
---
 common/board_f.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index f9eb4ca..06317ed 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -277,6 +277,7 @@ static int reserve_uboot(void)
 	return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 /* reserve memory for malloc() area */
 static int reserve_malloc(void)
 {
@@ -295,6 +296,7 @@ static int reserve_board(void)
 			sizeof(bd_t), gd->dest_addr_sp);
 	return 0;
 }
+#endif
 
 static int setup_machine(void)
 {
@@ -313,6 +315,7 @@ static int reserve_global_data(void)
 	return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 static int reserve_stacks(void)
 {
 	/* setup stackpointer for exeptions */
@@ -329,6 +332,17 @@ static int reserve_stacks(void)
 	gd->dest_addr_sp &= ~0x07;
 	return 0;
 }
+#endif
+
+#ifdef CONFIG_SPL_BUILD
+static int reserve_stacks_spl(void)
+{
+	/* Why not -= ? */
+	gd->dest_addr_sp += 128;	/* leave 32 words for abort-stack   */
+	gd->irq_sp = gd->dest_addr_sp;
+	return 0;
+}
+#endif
 
 #ifdef CONFIG_POST
 static int init_post(void)
@@ -392,18 +406,26 @@ static init_fnc_t init_sequence_f[] = {
 	reserve_lcd,
 #endif
 	reserve_uboot,
+#ifndef CONFIG_SPL_BUILD
 	reserve_malloc,
 	reserve_board,
+#endif
 	setup_machine,
 	reserve_global_data,
+#ifdef CONFIG_SPL_BUILD
+	reserve_stacks_spl,
+#else
 	reserve_stacks,
+#endif
 #ifdef CONFIG_POST
 	init_post,
 #endif
 	report_dram_config,
 	reloc_calculate_dest,
 	reloc_make_copy,
+#ifndef CONFIG_SPL_BUILD
 	reloc_elf,
+#endif
 	reloc_clear_bss,
 	reloc_jump_to_copy,
 	NULL,
-- 
1.7.3.1



More information about the U-Boot mailing list