]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/mips/cpu/xburst/start.S
MIPS: xburst/start.S: save relocation address in s2 register
[karo-tx-uboot.git] / arch / mips / cpu / xburst / start.S
index be14b3d7ebb2fb818f8c5f932466c9e9e9a7771d..052e25ebad973ab88fd0041d63da566f5f3a59da 100644 (file)
@@ -47,8 +47,10 @@ _start:
 relocate_code:
        move    sp, a0                  # set new stack pointer
 
 relocate_code:
        move    sp, a0                  # set new stack pointer
 
+       move    s2, a2                  # save destination address in s2
+
        li      t0, CONFIG_SYS_MONITOR_BASE
        li      t0, CONFIG_SYS_MONITOR_BASE
-       sub     t6, a2, t0              # t6 <-- relocation offset
+       sub     t6, s2, t0              # t6 <-- relocation offset
 
        la      t3, in_ram
        lw      t2, -12(t3)             # t2 <-- __image_copy_end
 
        la      t3, in_ram
        lw      t2, -12(t3)             # t2 <-- __image_copy_end
@@ -96,7 +98,7 @@ relocate_code:
        nop
 
        /* Jump to where we've relocated ourselves */
        nop
 
        /* Jump to where we've relocated ourselves */
-       addi    t0, a2, in_ram - _start
+       addi    t0, s2, in_ram - _start
        jr      t0
         nop
 
        jr      t0
         nop
 
@@ -171,6 +173,6 @@ in_ram:
        move    a0, a1                  # a0 <-- gd
        la      t9, board_init_r
        jr      t9
        move    a0, a1                  # a0 <-- gd
        la      t9, board_init_r
        jr      t9
-        move   a1, a2
+        move   a1, s2
 
        .end    relocate_code
 
        .end    relocate_code