From: Simon Glass Date: Wed, 14 Mar 2012 19:16:13 -0700 Subject: [U-Boot] [PATCH v4 16/27] Add spl load feature In-Reply-To: <1331777784-8528-1-git-send-email-sjg@chromium.org> References: <1331777784-8528-1-git-send-email-sjg@chromium.org> Message-ID: <1331777784-8528-17-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 9477721..a08f0a1 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