summaryrefslogtreecommitdiff
path: root/utils/atj2137
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2014-02-14 08:37:01 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2014-02-14 08:37:01 +0100
commit101d10ff6c6ee6992504700452901fd779cbb26e (patch)
tree5b0872263deab63f96ad146f108c93888f90a38f /utils/atj2137
parent44afbd3ac248ec01304e54e53316667bf601ae6d (diff)
downloadrockbox-101d10ff6c6ee6992504700452901fd779cbb26e.tar.gz
rockbox-101d10ff6c6ee6992504700452901fd779cbb26e.zip
atj213x: rework crt0.S in test code
Rework init code so relocation is safe for binaries linked into cached unmapped KSEG0 region. Change-Id: I705ee3f0334f8998237f249a2c3059d6dbe78a43
Diffstat (limited to 'utils/atj2137')
-rw-r--r--utils/atj2137/adfuload/test_binary/timer_irq/crt0.S17
1 files changed, 8 insertions, 9 deletions
diff --git a/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S b/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
index 7b46164ab4..eb78ba4fee 100644
--- a/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
+++ b/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
@@ -18,9 +18,12 @@ load_addr:
18 addiu v0, ra, -12 # calc real load address 18 addiu v0, ra, -12 # calc real load address
19 # account for branch delay slot 19 # account for branch delay slot
20 # and very first 'di' instruction 20 # and very first 'di' instruction
21 la t0, relocstart 21 lui t3, 0xa000 # use KSEG1 uncached unmapped
22 la t0, relocstart # addresses as we don't know
23 or t0, t0, t3 # the state of caches
22 la t1, relocend 24 la t1, relocend
23 beq t0, v0, entry_point # no relocation needed 25 or t1, t1, t3
26 beq t0, v0, cache_init # no relocation needed
24 nop 27 nop
25 28
26reloc_loop: 29reloc_loop:
@@ -30,12 +33,7 @@ reloc_loop:
30 bne t0, t1, reloc_loop 33 bne t0, t1, reloc_loop
31 addiu t0, 4 # inc dst addr 34 addiu t0, 4 # inc dst addr
32 35
33entry_point_jump: 36cache_init:
34 la t0, entry_point
35 jr t0
36 nop
37
38entry_point:
39 # setup caches 37 # setup caches
40 # 4-way, 256 sets, 16 bytes cacheline I/D 38 # 4-way, 256 sets, 16 bytes cacheline I/D
41 li t0, 3 # enable cache for kseg0 accesses 39 li t0, 3 # enable cache for kseg0 accesses
@@ -91,7 +89,8 @@ stack_munge_loop:
91 addiu t0, 4 89 addiu t0, 4
92 90
93 # jump to C code with enabled interrupts 91 # jump to C code with enabled interrupts
94 j main 92 la t0, main
93 jr t0
95 ei 94 ei
96 95
97 .set at 96 .set at