ARM1136: Introduce CONFIG_PRELOADER macro.

Currently CONFIG_ONENAND_IPL is used in a number of #ifdef's
in start.S. In preparation for adding support for NAND SPL
the macro CONFIG_PRELOADER is introducted and replaces the
CONFIG_ONENAND_IPL in start.S.

Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
This commit is contained in:
Magnus Lilja 2009-06-13 20:50:00 +02:00 committed by Jean-Christophe PLAGNIOL-VILLARD
parent 8096c51fd4
commit df81238b3e
3 changed files with 19 additions and 14 deletions

5
README
View File

@ -2702,6 +2702,11 @@ Low Level (hardware related) configuration options:
some other boot loader or by a debugger which some other boot loader or by a debugger which
performs these initializations itself. performs these initializations itself.
- CONFIG_PRELOADER
Modifies the behaviour of start.S when compiling a loader
that is executed before the actual U-Boot. E.g. when
compiling a NAND SPL.
Building the Software: Building the Software:
====================== ======================

View File

@ -32,7 +32,7 @@
#include <version.h> #include <version.h>
.globl _start .globl _start
_start: b reset _start: b reset
#ifdef CONFIG_ONENAND_IPL #ifdef CONFIG_PRELOADER
ldr pc, _hang ldr pc, _hang
ldr pc, _hang ldr pc, _hang
ldr pc, _hang ldr pc, _hang
@ -67,7 +67,7 @@ _not_used: .word not_used
_irq: .word irq _irq: .word irq
_fiq: .word fiq _fiq: .word fiq
_pad: .word 0x12345678 /* now 16*4=64 */ _pad: .word 0x12345678 /* now 16*4=64 */
#endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_PRELOADER */
.global _end_vect .global _end_vect
_end_vect: _end_vect:
@ -156,9 +156,9 @@ relocate: /* relocate U-Boot to RAM */
adr r0, _start /* r0 <- current position of code */ adr r0, _start /* r0 <- current position of code */
ldr r1, _TEXT_BASE /* test if we run from flash or RAM */ ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
cmp r0, r1 /* don't reloc during debug */ cmp r0, r1 /* don't reloc during debug */
#ifndef CONFIG_ONENAND_IPL #ifndef CONFIG_PRELOADER
beq stack_setup beq stack_setup
#endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_PRELOADER */
ldr r2, _armboot_start ldr r2, _armboot_start
ldr r3, _bss_start ldr r3, _bss_start
@ -175,7 +175,7 @@ copy_loop:
/* Set up the stack */ /* Set up the stack */
stack_setup: stack_setup:
ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */ ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
#ifdef CONFIG_ONENAND_IPL #ifdef CONFIG_PRELOADER
sub sp, r0, #128 /* leave 32 words for abort-stack */ sub sp, r0, #128 /* leave 32 words for abort-stack */
#else #else
sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */ sub r0, r0, #CONFIG_SYS_MALLOC_LEN /* malloc area */
@ -184,14 +184,14 @@ stack_setup:
sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ) sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
#endif #endif
sub sp, r0, #12 /* leave 3 words for abort-stack */ sub sp, r0, #12 /* leave 3 words for abort-stack */
#endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_PRELOADER */
clear_bss: clear_bss:
ldr r0, _bss_start /* find start of bss segment */ ldr r0, _bss_start /* find start of bss segment */
ldr r1, _bss_end /* stop here */ ldr r1, _bss_end /* stop here */
mov r2, #0x00000000 /* clear */ mov r2, #0x00000000 /* clear */
#ifndef CONFIG_ONENAND_IPL #ifndef CONFIG_PRELOADER
clbss_l:str r2, [r0] /* clear loop... */ clbss_l:str r2, [r0] /* clear loop... */
add r0, r0, #4 add r0, r0, #4
cmp r0, r1 cmp r0, r1
@ -244,7 +244,7 @@ cpu_init_crit:
mov lr, ip /* restore link */ mov lr, ip /* restore link */
mov pc, lr /* back to my caller */ mov pc, lr /* back to my caller */
#ifndef CONFIG_ONENAND_IPL #ifndef CONFIG_PRELOADER
/* /*
************************************************************************* *************************************************************************
* *
@ -357,17 +357,17 @@ cpu_init_crit:
.macro get_fiq_stack @ setup FIQ stack .macro get_fiq_stack @ setup FIQ stack
ldr sp, FIQ_STACK_START ldr sp, FIQ_STACK_START
.endm .endm
#endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_PRELOADER */
/* /*
* exception handlers * exception handlers
*/ */
#ifdef CONFIG_ONENAND_IPL #ifdef CONFIG_PRELOADER
.align 5 .align 5
do_hang: do_hang:
ldr sp, _TEXT_BASE /* use 32 words about stack */ ldr sp, _TEXT_BASE /* use 32 words about stack */
bl hang /* hang and never return */ bl hang /* hang and never return */
#else /* !CONFIG_ONENAND IPL */ #else /* !CONFIG_PRELOADER */
.align 5 .align 5
undefined_instruction: undefined_instruction:
get_bad_stack get_bad_stack
@ -435,4 +435,4 @@ fiq:
arm1136_cache_flush: arm1136_cache_flush:
mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
mov pc, lr @ back to caller mov pc, lr @ back to caller
#endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_PRELOADER */

View File

@ -4,8 +4,8 @@ include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_ONENAND_IPL AFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
CFLAGS += -DCONFIG_ONENAND_IPL CFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
OBJCFLAGS += --gap-fill=0x00 OBJCFLAGS += --gap-fill=0x00
SOBJS := low_levelinit.o SOBJS := low_levelinit.o