From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 27 Dec 2011 22:35:48 -0800 Subject: [U-Boot] [RFC PATCH 07/19] Add spl load feature In-Reply-To: <1325054160-24894-1-git-send-email-sjg@chromium.org> References: <1325054160-24894-1-git-send-email-sjg@chromium.org> Message-ID: <1325054160-24894-8-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Simon Glass --- 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