|
@@ -64,19 +64,13 @@ relocate_code:
|
|
|
move sp, a0 # set new stack pointer
|
|
|
|
|
|
li t0, CONFIG_SYS_MONITOR_BASE
|
|
|
+ sub t6, a2, t0 # t6 <-- relocation offset
|
|
|
+
|
|
|
la t3, in_ram
|
|
|
lw t2, -12(t3) # t2 <-- uboot_end_data
|
|
|
move t1, a2
|
|
|
|
|
|
- /*
|
|
|
- * Fix $gp:
|
|
|
- *
|
|
|
- * New $gp = (Old $gp - CONFIG_SYS_MONITOR_BASE) + Destination Address
|
|
|
- */
|
|
|
- move t6, gp
|
|
|
- sub gp, CONFIG_SYS_MONITOR_BASE
|
|
|
- add gp, a2 # gp now adjusted
|
|
|
- sub t6, gp, t6 # t6 <-- relocation offset
|
|
|
+ add gp, t6 # adjust gp
|
|
|
|
|
|
/*
|
|
|
* t0 = source address
|