Merge branch 'master' of git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / arch / arm / cpu / armv7 / start.S
index c71ef6c..2929fc7 100644 (file)
@@ -70,6 +70,18 @@ _end_vect:
 _TEXT_BASE:
        .word   CONFIG_SYS_TEXT_BASE
 
+#ifdef CONFIG_TEGRA2
+/*
+ * Tegra2 uses 2 separate CPUs - the AVP (ARM7TDMI) and the CPU (dual A9s).
+ * U-Boot runs on the AVP first, setting things up for the CPU (PLLs,
+ * muxes, clocks, clamps, etc.). Then the AVP halts, and expects the CPU
+ * to pick up its reset vector, which points here.
+ */
+.globl _armboot_start
+_armboot_start:
+        .word _start
+#endif
+
 /*
  * These are defined in the board-specific linker script.
  */
@@ -79,6 +91,10 @@ _bss_start_ofs:
 
 .globl _bss_end_ofs
 _bss_end_ofs:
+       .word __bss_end__ - _start
+
+.globl _end_ofs
+_end_ofs:
        .word _end - _start
 
 #ifdef CONFIG_USE_IRQ
@@ -111,7 +127,7 @@ reset:
        orr     r0, r0, #0xd3
        msr     cpsr,r0
 
-#if (CONFIG_OMAP34XX)
+#if defined(CONFIG_OMAP34XX)
        /* Copy vectors to mask ROM indirect addr */
        adr     r0, _start              @ r0 <- current position of code
        add     r0, r0, #4              @ skip reset vector
@@ -171,7 +187,6 @@ stack_setup:
        beq     clear_bss               /* skip relocation */
 #endif
        mov     r1, r6                  /* r1 <- scratch for copy_loop */
-       ldr     r2, _TEXT_BASE
        ldr     r3, _bss_start_ofs
        add     r2, r0, r3              /* r2 <- source end address         */
 
@@ -209,7 +224,7 @@ fixabs:
        mov     r1, r1, LSR #4          /* r1 <- symbol index in .dynsym */
        add     r1, r10, r1             /* r1 <- address of symbol in table */
        ldr     r1, [r1, #4]            /* r1 <- symbol value */
-       add     r1, r9                  /* r1 <- relocated sym addr */
+       add     r1, r1, r9              /* r1 <- relocated sym addr */
        b       fixnext
 fixrel:
        /* relative fix: increase location by offset */
@@ -224,7 +239,6 @@ fixnext:
 clear_bss:
        ldr     r0, _bss_start_ofs
        ldr     r1, _bss_end_ofs
-       ldr     r3, _TEXT_BASE          /* Text base */
        mov     r4, r6                  /* reloc addr */
        add     r0, r0, r4
        add     r1, r1, r4