summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2014-03-04 11:07:07 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2014-03-04 11:07:07 +0100
commitc64b59fc5eea973ae82430f98046d4cd2af15160 (patch)
tree583f9a19d7b5220d35f698090315f6d0b090e0bf
parent2f21f77ade790a9fbd4a92f103f57f6d4bbb5af2 (diff)
downloadrockbox-c64b59f.tar.gz
rockbox-c64b59f.tar.bz2
rockbox-c64b59f.zip
atj213x: various fixes in sample code snippets
Change-Id: I78781e1a56cb6705d011ee2296f1789b497a566a
-rw-r--r--utils/atj2137/adfuload/test_binary/backlight_c/crt0.S15
-rw-r--r--utils/atj2137/adfuload/test_binary/timer_irq/crt0.S15
-rw-r--r--utils/atj2137/adfuload/test_binary/timer_irq/irq_handler.S2
-rw-r--r--utils/atj2137/adfuload/test_binary/timer_no_irq/crt0.S15
4 files changed, 25 insertions, 22 deletions
diff --git a/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S b/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
index e03b8b5439..485a4fc26c 100644
--- a/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
+++ b/utils/atj2137/adfuload/test_binary/backlight_c/crt0.S
@@ -26,9 +26,9 @@ load_addr:
reloc_loop:
lw t2, 0(v0) # src
addiu v0, 4 # inc src addr
- sw t2, 0(t0) # dst
- bne t0, t1, reloc_loop
addiu t0, 4 # inc dst addr
+ bne t0, t1, reloc_loop
+ sw t2, -4(t0) # dst
entry_point_jump:
la t0, entry_point
@@ -49,17 +49,18 @@ entry_point:
cache_init_loop:
cache 8, 0(t0) # index store icache tag
cache 9, 0(t0) # index store dcache tag
- bne t0, t1, cache_init_loop
addiu t0, t0, 0x10
+ bne t0, t1, cache_init_loop
+ nop
# clear bss
la t0, bssbegin
la t1, bssend
clear_bss_loop:
- sw zero, 0(t0)
- bne t0, t1, clear_bss_loop
addiu t0, 4
+ bne t0, t1, clear_bss_loop
+ sw zero, -4(t0)
# setup stack
la sp, stackend
@@ -67,9 +68,9 @@ clear_bss_loop:
li t1, 0xdeadbeef
stack_munge_loop:
- sw t1, 0(t0)
- bne t0, sp, stack_munge_loop
addiu t0, 4
+ bne t0, sp, stack_munge_loop
+ sw t1, -4(t0)
# jump to C code
j main
diff --git a/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S b/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
index eb78ba4fee..29fef6404f 100644
--- a/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
+++ b/utils/atj2137/adfuload/test_binary/timer_irq/crt0.S
@@ -29,9 +29,9 @@ load_addr:
reloc_loop:
lw t2, 0(v0) # src
addiu v0, 4 # inc src addr
- sw t2, 0(t0) # dst
- bne t0, t1, reloc_loop
addiu t0, 4 # inc dst addr
+ bne t0, t1, reloc_loop
+ sw t2, -4(t0) # dst
cache_init:
# setup caches
@@ -47,8 +47,9 @@ cache_init:
cache_init_loop:
cache 8, 0(t0) # index store icache tag
cache 9, 0(t0) # index store dcache tag
- bne t0, t1, cache_init_loop
addiu t0, t0, 0x10
+ bne t0, t1, cache_init_loop
+ nop
intc_setup:
li t0, 0xb0020000 # INTC base
@@ -73,9 +74,9 @@ core_irq_setup:
la t1, bssend
clear_bss_loop:
- sw zero, 0(t0)
- bne t0, t1, clear_bss_loop
addiu t0, 4
+ bne t0, t1, clear_bss_loop
+ sw zero, -4(t0)
# setup stack
la k0, irqstackend
@@ -84,9 +85,9 @@ clear_bss_loop:
li t1, 0xdeadbeef
stack_munge_loop:
- sw t1, 0(t0)
- bne t0, sp, stack_munge_loop
addiu t0, 4
+ bne t0, sp, stack_munge_loop
+ sw t1, -4(t0)
# jump to C code with enabled interrupts
la t0, main
diff --git a/utils/atj2137/adfuload/test_binary/timer_irq/irq_handler.S b/utils/atj2137/adfuload/test_binary/timer_irq/irq_handler.S
index 1d58c60f70..a9ae340810 100644
--- a/utils/atj2137/adfuload/test_binary/timer_irq/irq_handler.S
+++ b/utils/atj2137/adfuload/test_binary/timer_irq/irq_handler.S
@@ -83,7 +83,7 @@ irq_handler:
lw fp, 68(sp)
lw ra, 72(sp)
- addiu sp, sp, 88
+ addiu sp, sp, 84
move sp, k1
eret
diff --git a/utils/atj2137/adfuload/test_binary/timer_no_irq/crt0.S b/utils/atj2137/adfuload/test_binary/timer_no_irq/crt0.S
index e03b8b5439..485a4fc26c 100644
--- a/utils/atj2137/adfuload/test_binary/timer_no_irq/crt0.S
+++ b/utils/atj2137/adfuload/test_binary/timer_no_irq/crt0.S
@@ -26,9 +26,9 @@ load_addr:
reloc_loop:
lw t2, 0(v0) # src
addiu v0, 4 # inc src addr
- sw t2, 0(t0) # dst
- bne t0, t1, reloc_loop
addiu t0, 4 # inc dst addr
+ bne t0, t1, reloc_loop
+ sw t2, -4(t0) # dst
entry_point_jump:
la t0, entry_point
@@ -49,17 +49,18 @@ entry_point:
cache_init_loop:
cache 8, 0(t0) # index store icache tag
cache 9, 0(t0) # index store dcache tag
- bne t0, t1, cache_init_loop
addiu t0, t0, 0x10
+ bne t0, t1, cache_init_loop
+ nop
# clear bss
la t0, bssbegin
la t1, bssend
clear_bss_loop:
- sw zero, 0(t0)
- bne t0, t1, clear_bss_loop
addiu t0, 4
+ bne t0, t1, clear_bss_loop
+ sw zero, -4(t0)
# setup stack
la sp, stackend
@@ -67,9 +68,9 @@ clear_bss_loop:
li t1, 0xdeadbeef
stack_munge_loop:
- sw t1, 0(t0)
- bne t0, sp, stack_munge_loop
addiu t0, 4
+ bne t0, sp, stack_munge_loop
+ sw t1, -4(t0)
# jump to C code
j main