iMX31: Reducing start.S size to let boot from NAND
PATCH 1/3 iMX31: Reducing start.S size to let boot from NAND
iMX31 NAND Flash Controller has a 2KB RAM buffer, but the current start.S file is too much big to let NAND copy routine to fit in. This patch will reduce the start.S when booting from NAND Flash.
--- cpu/arm1136/start.S | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-)
cpu/arm1136/start.S +11 -0
@@ -32,6 +32,15 @@ #include <version.h> .globl _start _start: b reset +#ifdef CONFIG_BOOT_FROM_NAND + b . /* Undefined Instruction */ + b . /* Software Interrupt */ + b . /* Prefetch Abort */ + b . /* Data Abort */ + b . /* Reserved */ + b . /* IRQ */ + b . /* FIQ */ +#else #ifdef CONFIG_ONENAND_IPL ldr pc, _hang ldr pc, _hang
@@ -68,6 +77,7 @@ _irq: .word irq _fiq: .word fiq _pad: .word 0x12345678 /* now 16*4=64 */ #endif /* CONFIG_ONENAND_IPL */ +#endif /* CONFIG_BOOT_FROM_NAND */ .global _end_vect _end_vect:
@@ -151,6 +161,7 @@ next: bl cpu_init_crit #endif +_cstartup: #ifndef CONFIG_SKIP_RELOCATE_UBOOT relocate: /* relocate U-Boot to RAM */ adr r0, _start /* r0 <- current position of code */
@@ -239,12 +250,18 @@ cpu_init_crit: * Jump to board specific initialization... The Mask ROM will have
already initialized
* basic memory. Go here to bump up clock rate and handle wake up conditions. */
+#ifdef CONFIG_BOOT_FROM_NAND
+ ldr sp, =CFG_INTERNAL_SRAM_STACK /* Initial stack point in the SRAM */
+ ldr r0, =_cstartup /* load the return address */
+ mov lr, r0 /* set the return address after remap */
+ b lowlevel_init /* relative branch enables remap */
+#endif
mov ip, lr /* persevere link reg across call */
bl lowlevel_init /* go setup pll,mux,memory */
mov lr, ip /* restore link */
mov pc, lr /* back to my caller */
-#ifndef CONFIG_ONENAND_IPL
+#if !defined(CONFIG_ONENAND_IPL) && !defined(CONFIG_BOOT_FROM_NAND)
/*
*************************************************************************
*
@@ -357,11 +374,12 @@ cpu_init_crit:
.macro get_fiq_stack @ setup FIQ stack
ldr sp, FIQ_STACK_START
.endm
-#endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_ONENAND_IPL/CONFIG_BOOT_FROM_NAND */
/*
* exception handlers
*/
+#ifndef CONFIG_BOOT_FROM_NAND
#ifdef CONFIG_ONENAND_IPL
.align 5
do_hang:
@@ -436,3 +454,5 @@ arm1136_cache_flush:
mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache
mov pc, lr @ back to caller
#endif /* CONFIG_ONENAND_IPL */
+#endif /* CONFIG_BOOT_FROM_NAND */
+
Signature · 1 line
1.5.4.3
PATCH 1/3 iMX31: Reducing start.S size to let boot from NAND
Dear "Alan Carvalho de Assis",
Quoted 9 lines · In message <[email protected]> you…
iMX31 NAND Flash Controller has a 2KB RAM buffer, but the current
start.Sfile is too much big to let NAND copy routine to fit in. This patch will reduce thestart.Swhen booting from NAND Flash.Signed-off-by Alan Carvalho de Assis <[email protected]>--- cpu/arm1136/start.S | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-)
Why are you adding this to cpu/arm1136/start.S ?
I think NAND boot code should be added to nand_spl/ ?
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You Earth people glorified organized violence for forty centuries. But you imprison those who employ it privately. -- Spock, "Dagger of the Mind", stardate 2715.1
PATCH 1/3 iMX31: Reducing start.S size to let boot from NAND
Dear "Wolfgang Denk"
Quoted 7 lines · Wolfgang Denk
Dear "Alan Carvalho de Assis",
Why are you adding this to
cpu/arm1136/start.S?I think NAND boot code should be added to nand_spl/ ?
I am doing it now, I didn't know about nand_spl stuffs.
Quoted 2 lines
Best regards,
Best Regards,
Quoted 2 lines
Wolfgang Denk
Alan