projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.denx.de/u-boot-arm
[oweals/u-boot.git]
/
cpu
/
mips
/
start.S
diff --git
a/cpu/mips/start.S
b/cpu/mips/start.S
index 947128dd813e7d8c0da58385bae20e1e5779ac73..57db589b94f266e7057ca966a72b6487918cd186 100644
(file)
--- a/
cpu/mips/start.S
+++ b/
cpu/mips/start.S
@@
-23,7
+23,6
@@
*/
#include <config.h>
*/
#include <config.h>
-#include <version.h>
#include <asm/regdef.h>
#include <asm/mipsregs.h>
#include <asm/regdef.h>
#include <asm/mipsregs.h>
@@
-244,9
+243,11
@@
reset:
mtc0 zero, CP0_COUNT
mtc0 zero, CP0_COMPARE
mtc0 zero, CP0_COUNT
mtc0 zero, CP0_COMPARE
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
/* CONFIG0 register */
li t0, CONF_CM_UNCACHED
mtc0 t0, CP0_CONFIG
/* CONFIG0 register */
li t0, CONF_CM_UNCACHED
mtc0 t0, CP0_CONFIG
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
/* Initialize $gp.
*/
/* Initialize $gp.
*/
@@
-256,6
+257,7
@@
reset:
1:
lw gp, 0(ra)
1:
lw gp, 0(ra)
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
/* Initialize any external memory.
*/
la t9, lowlevel_init
/* Initialize any external memory.
*/
la t9, lowlevel_init
@@
-272,17
+274,18
@@
reset:
*/
li t0, CONF_CM_CACHABLE_NONCOHERENT
mtc0 t0, CP0_CONFIG
*/
li t0, CONF_CM_CACHABLE_NONCOHERENT
mtc0 t0, CP0_CONFIG
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
/* Set up temporary stack.
*/
/* Set up temporary stack.
*/
-#ifdef C
FG
_INIT_RAM_LOCK_MIPS
- li a0, C
FG
_INIT_SP_OFFSET
+#ifdef C
ONFIG_SYS
_INIT_RAM_LOCK_MIPS
+ li a0, C
ONFIG_SYS
_INIT_SP_OFFSET
la t9, mips_cache_lock
jalr t9
nop
#endif
la t9, mips_cache_lock
jalr t9
nop
#endif
- li t0, C
FG_SDRAM_BASE + CFG
_INIT_SP_OFFSET
+ li t0, C
ONFIG_SYS_SDRAM_BASE + CONFIG_SYS
_INIT_SP_OFFSET
la sp, 0(t0)
la t9, board_init_f
la sp, 0(t0)
la t9, board_init_f
@@
-304,26
+307,35
@@
reset:
relocate_code:
move sp, a0 /* Set new stack pointer */
relocate_code:
move sp, a0 /* Set new stack pointer */
- li t0, C
FG
_MONITOR_BASE
+ li t0, C
ONFIG_SYS
_MONITOR_BASE
la t3, in_ram
lw t2, -12(t3) /* t2 <-- uboot_end_data */
move t1, a2
la t3, in_ram
lw t2, -12(t3) /* t2 <-- uboot_end_data */
move t1, a2
+ move s2, a2 /* s2 <-- destination address */
/*
* Fix $gp:
*
/*
* Fix $gp:
*
- * New $gp = (Old $gp - C
FG
_MONITOR_BASE) + Destination Address
+ * New $gp = (Old $gp - C
ONFIG_SYS
_MONITOR_BASE) + Destination Address
*/
move t6, gp
*/
move t6, gp
- sub gp, C
FG
_MONITOR_BASE
+ sub gp, C
ONFIG_SYS
_MONITOR_BASE
add gp, a2 /* gp now adjusted */
add gp, a2 /* gp now adjusted */
- sub
t6, gp, t6 /* t6
<-- relocation offset */
+ sub
s1, gp, t6 /* s1
<-- relocation offset */
/*
* t0 = source address
* t1 = target address
* t2 = source end address
*/
/*
* t0 = source address
* t1 = target address
* t2 = source end address
*/
+
+ /*
+ * Save destination address and size for later usage in flush_cache()
+ */
+ move s0, a1 /* save gd in s0 */
+ move a0, t1 /* a0 <-- destination addr */
+ sub a1, t2, t0 /* a1 <-- size */
+
/* On the purple board we copy the code earlier in a special way
* in order to solve flash problems
*/
/* On the purple board we copy the code earlier in a special way
* in order to solve flash problems
*/
@@
-339,13
+351,18
@@
relocate_code:
/* If caches were enabled, we would have to flush them here.
*/
/* If caches were enabled, we would have to flush them here.
*/
+ /* a0 & a1 are already set up for flush_cache(start, size) */
+ la t9, flush_cache
+ jalr t9
+ nop
+
/* Jump to where we've relocated ourselves.
*/
/* Jump to where we've relocated ourselves.
*/
- addi t0,
a
2, in_ram - _start
+ addi t0,
s
2, in_ram - _start
jr t0
nop
jr t0
nop
- .word _gp
+ .word _gp
.word _GLOBAL_OFFSET_TABLE_
.word uboot_end_data
.word uboot_end
.word _GLOBAL_OFFSET_TABLE_
.word uboot_end_data
.word uboot_end
@@
-368,7
+385,7
@@
in_ram:
1:
lw t1, 0(t4)
beqz t1, 2f
1:
lw t1, 0(t4)
beqz t1, 2f
- add t1,
t6
+ add t1,
s1
sw t1, 0(t4)
2:
addi t2, 1
sw t1, 0(t4)
2:
addi t2, 1
@@
-379,8
+396,8
@@
in_ram:
*/
lw t1, -12(t0) /* t1 <-- uboot_end_data */
lw t2, -8(t0) /* t2 <-- uboot_end */
*/
lw t1, -12(t0) /* t1 <-- uboot_end_data */
lw t2, -8(t0) /* t2 <-- uboot_end */
- add t1,
t6
/* adjust pointers */
- add t2,
t6
+ add t1,
s1
/* adjust pointers */
+ add t2,
s1
sub t1, 4
1:
sub t1, 4
1:
@@
-388,10
+405,10
@@
in_ram:
bltl t1, t2, 1b
sw zero, 0(t1) /* delay slot */
bltl t1, t2, 1b
sw zero, 0(t1) /* delay slot */
- move a0,
a1
+ move a0,
s0 /* a0 <-- gd */
la t9, board_init_r
jr t9
la t9, board_init_r
jr t9
- move a1,
a
2 /* delay slot */
+ move a1,
s
2 /* delay slot */
.end relocate_code
.end relocate_code