summaryrefslogtreecommitdiff
path: root/cpu/arm1136/start.S
diff options
context:
space:
mode:
authorFred Fan <r01011@freescale.com>2009-02-23 13:54:46 +0800
committerFred Fan <r01011@freescale.com>2009-09-09 17:27:24 +0800
commit4a9ee8a22327ddbd4f2c296a834fcc90fc2d1d14 (patch)
tree6a84531a662b591ec0b443ff8d3f4e7c6c0899a7 /cpu/arm1136/start.S
parent4bdaaba26f5d015474dbd5a524355b5e64655ebe (diff)
downloadu-boot-imx-4a9ee8a22327ddbd4f2c296a834fcc90fc2d1d14.zip
u-boot-imx-4a9ee8a22327ddbd4f2c296a834fcc90fc2d1d14.tar.gz
u-boot-imx-4a9ee8a22327ddbd4f2c296a834fcc90fc2d1d14.tar.bz2
ENGR00102776 Support boot from NAND on i.mx35 3stack TO1
1. Support boot from NAND Changes link script to separate initial code to multiple sections. 2. One binary support boot from NOR and NAND Changes common file start.S to support multiple sections. Signed-off-by: Fred Fan <r01011@freescale.com>
Diffstat (limited to 'cpu/arm1136/start.S')
-rw-r--r--cpu/arm1136/start.S36
1 files changed, 17 insertions, 19 deletions
diff --git a/cpu/arm1136/start.S b/cpu/arm1136/start.S
index a957ccc..57f13ef 100644
--- a/cpu/arm1136/start.S
+++ b/cpu/arm1136/start.S
@@ -30,9 +30,15 @@
#include <config.h>
#include <version.h>
+
+.section ".text.head", "ax"
.globl _start
-_start: b reset
+_start:
+.section ".text.vect", "ax"
+.global _start_vect
+_start_vect:
#ifdef CONFIG_PRELOADER
+ b reset
ldr pc, _hang
ldr pc, _hang
ldr pc, _hang
@@ -89,10 +95,7 @@ _end_vect:
* the actual reset code
*/
-#ifdef CONFIG_NAND_BOOT
-.section ".text.head", "x"
-#endif
-
+.section ".text.head", "ax"
.globl reset
reset:
/*
@@ -106,7 +109,7 @@ reset:
#ifdef CONFIG_OMAP2420H4
/* Copy vectors to mask ROM indirect addr */
adr r0, _start /* r0 <- current position of code */
- add r0, r0, #4 /* skip reset vector */
+ add r0, r0, #4 /* skip reset vector */
mov r2, #64 /* r2 <- size to copy */
add r2, r0, r2 /* r2 <- source end address */
mov r1, #SRAM_OFFSET0 /* build vect addr */
@@ -165,21 +168,15 @@ cpu_init_crit:
mov pc, lr /* back to my caller */
-#ifdef CONFIG_NAND_BOOT
-.section ".text.setup"
-#endif
+.section ".text.setup", "ax"
-.globl _TEST_BASE
+.globl _TEXT_BASE
_TEXT_BASE:
.word TEXT_BASE
.globl _armboot_start
_armboot_start:
-#ifndef CONFIG_NAND_BOOT
.word _start
-#else
- .word reset
-#endif
/*
* These are defined in the board-specific linker script.
@@ -208,13 +205,14 @@ setup_env:
#ifndef CONFIG_SKIP_RELOCATE_UBOOT
relocate: /* relocate U-Boot to RAM */
- adr r0, _start /* r0 <- current position of code */
- ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
+ adr r0, _armboot_start
+ ldr r1, =_armboot_start
cmp r0, r1 /* don't reloc during debug */
-#ifndef CONFIG_PRELOADER
beq stack_setup
-#endif /* CONFIG_PRELOADER */
-
+ ldr r2, _TEXT_BASE
+ sub r0, r1, r0
+ sub r0, r2, r0
+ ldr r1, _TEXT_BASE
ldr r2, _armboot_start
ldr r3, _bss_start
sub r2, r3, r2 /* r2 <- size of armboot */