Patchwork [U-Boot,RFC,2/8] armv7: add nand_spl support

login
register
mail settings
Submitter John Rigby
Date Dec. 28, 2010, 12:47 a.m.
Message ID <1293497228-15911-3-git-send-email-john.rigby@linaro.org>
Download mbox | patch
Permalink /patch/76805/
State Changes Requested
Delegated to: Sandeep Paulraj
Headers show

Comments

John Rigby - Dec. 28, 2010, 12:47 a.m.
Signed-off-by: John Rigby <john.rigby@linaro.org>
---
 arch/arm/cpu/armv7/start.S |   45 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

Patch

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 684f2d2..17b86e1 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -35,6 +35,27 @@ 
 
 .globl _start
 _start: b	reset
+#ifdef CONFIG_PRELOADER
+/* No exception handlers in preloader */
+	ldr	pc, _hang
+	ldr	pc, _hang
+	ldr	pc, _hang
+	ldr	pc, _hang
+	ldr	pc, _hang
+	ldr	pc, _hang
+	ldr	pc, _hang
+
+_hang:
+	.word	do_hang
+/* pad to 64 byte boundary */
+	.word	0x12345678
+	.word	0x12345678
+	.word	0x12345678
+	.word	0x12345678
+	.word	0x12345678
+	.word	0x12345678
+	.word	0x12345678
+#else
 	ldr	pc, _undefined_instruction
 	ldr	pc, _software_interrupt
 	ldr	pc, _prefetch_abort
@@ -54,6 +75,7 @@  _pad:			.word 0x12345678 /* now 16*4=64 */
 .global _end_vect
 _end_vect:
 
+#endif
 	.balignl 16,0xdeadbeef
 /*************************************************************************
  *
@@ -127,7 +149,7 @@  next:
 	stmia	r1!, {r3 - r10}		@ copy to   target address [r1]
 	cmp	r0, r2			@ until source end address [r2]
 	bne	next			@ loop until equal */
-#if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_ONENAND_BOOT)
+#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_ONENAND_U_BOOT)
 	/* No need to copy/exec the clock code - DPLL adjust already done
 	 * in NAND/oneNAND Boot.
 	 */
@@ -240,6 +262,13 @@  clbss_l:str	r2, [r0]		/* clear loop...		    */
  * We are done. Do not return, instead branch to second part of board
  * initialization, now running from RAM.
  */
+#ifdef CONFIG_NAND_SPL
+	ldr     r0, _nand_boot_ofs
+	mov	pc, r0
+
+_nand_boot_ofs:
+	.word nand_boot
+#else
 jump_2_ram:
 	ldr	r0, _board_init_r_ofs
 	adr	r1, _start
@@ -253,6 +282,7 @@  jump_2_ram:
 
 _board_init_r_ofs:
 	.word board_init_r - _start
+#endif
 
 _rel_dyn_start_ofs:
 	.word __rel_dyn_start - _start
@@ -269,6 +299,7 @@  _dynsym_start_ofs:
  * setup memory timing
  *
  *************************************************************************/
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 cpu_init_crit:
 	/*
 	 * Invalidate L1 I/D
@@ -297,6 +328,9 @@  cpu_init_crit:
 	bl	lowlevel_init		@ go setup pll,mux,memory
 	mov	lr, ip			@ restore link
 	mov	pc, lr			@ back to my caller
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+
+#ifndef CONFIG_PRELOADER
 /*
  *************************************************************************
  *
@@ -419,10 +453,18 @@  cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
+#endif /* CONFIG_PRELOADER */
 
 /*
  * exception handlers
  */
+#ifdef CONFIG_PRELOADER
+	.align	5
+do_hang:
+	ldr	sp, _TEXT_BASE			/* switch to abort stack */
+1:
+	bl	1b				/* hang and never return */
+#else	/* !CONFIG_PRELOADER */
 	.align	5
 undefined_instruction:
 	get_bad_stack
@@ -485,3 +527,4 @@  fiq:
 	bl	do_fiq
 
 #endif
+#endif	/* CONFIG_PRELOADER */