summaryrefslogtreecommitdiff
path: root/cpu/mpc824x/start.S
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/mpc824x/start.S')
-rw-r--r--cpu/mpc824x/start.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpu/mpc824x/start.S b/cpu/mpc824x/start.S
index 7f40648..f3f595a 100644
--- a/cpu/mpc824x/start.S
+++ b/cpu/mpc824x/start.S
@@ -63,7 +63,7 @@
/*
* Set up GOT: Global Offset Table
*
- * Use r14 to access the GOT
+ * Use r12 to access the GOT
*/
START_GOT
GOT_ENTRY(_GOT2_TABLE_)
@@ -462,6 +462,7 @@ relocate_code:
mr r9, r4 /* Save copy of Global Data pointer */
mr r10, r5 /* Save copy of Destination Address */
+ GET_GOT
mr r3, r5 /* Destination Address */
#ifdef CONFIG_SYS_RAMBOOT
lis r4, CONFIG_SYS_SDRAM_BASE@h /* Source Address */
@@ -484,7 +485,7 @@ relocate_code:
sub r15, r10, r4
/* First our own GOT */
- add r14, r14, r15
+ add r12, r12, r15
/* the the one used by the C code */
add r30, r30, r15
@@ -564,7 +565,7 @@ relocate_code:
in_ram:
/*
- * Relocation Function, r14 point to got2+0x8000
+ * Relocation Function, r12 point to got2+0x8000
*
* Adjust got2 pointers, no need to check for 0, this code
* already puts a few entries in the table.
@@ -629,6 +630,8 @@ clear_bss:
*/
.globl trap_init
trap_init:
+ mflr r4 /* save link register */
+ GET_GOT
lwz r7, GOT(_start)
lwz r8, GOT(_end_of_vectors)
@@ -636,8 +639,6 @@ trap_init:
cmplw 0, r7, r8
bgelr /* return if r7>=r8 - just in case */
-
- mflr r4 /* save link register */
1:
lwz r0, 0(r7)
stw r0, 0(r9)