From: Simon Glass Date: Thu, 16 Feb 2012 06:49:04 -0800 Subject: [U-Boot] [PATCH v3 17/28] Add spl load feature In-Reply-To: <1329403755-6396-1-git-send-email-sjg@chromium.org> References: <1329403755-6396-1-git-send-email-sjg@chromium.org> Message-ID: <1329403755-6396-18-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 This adds secondary program loader support to the generic board. Signed-off-by: Simon Glass --- common/board_f.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 054eda5..ebc0868 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -305,6 +305,7 @@ static int reserve_uboot(void) return 0; } +#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -324,6 +325,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif static int setup_machine(void) { @@ -342,6 +344,7 @@ static int reserve_global_data(void) return 0; } +#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -359,6 +362,17 @@ static int reserve_stacks(void) 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 static int display_new_sp(void) { @@ -458,11 +472,17 @@ 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 setup_baud_rate, display_new_sp, jump_to_copy, -- 1.7.7.3