diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2014-03-04 11:07:07 +0100 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2014-03-04 11:07:07 +0100 |
commit | c64b59fc5eea973ae82430f98046d4cd2af15160 (patch) | |
tree | 583f9a19d7b5220d35f698090315f6d0b090e0bf /utils/atj2137/adfuload/test_binary | |
parent | 2f21f77ade790a9fbd4a92f103f57f6d4bbb5af2 (diff) | |
download | rockbox-c64b59fc5eea973ae82430f98046d4cd2af15160.tar.gz rockbox-c64b59fc5eea973ae82430f98046d4cd2af15160.zip |
atj213x: various fixes in sample code snippets
Change-Id: I78781e1a56cb6705d011ee2296f1789b497a566a
Diffstat (limited to 'utils/atj2137/adfuload/test_binary')
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: | |||
26 | reloc_loop: | 26 | reloc_loop: |
27 | lw t2, 0(v0) # src | 27 | lw t2, 0(v0) # src |
28 | addiu v0, 4 # inc src addr | 28 | addiu v0, 4 # inc src addr |
29 | sw t2, 0(t0) # dst | ||
30 | bne t0, t1, reloc_loop | ||
31 | addiu t0, 4 # inc dst addr | 29 | addiu t0, 4 # inc dst addr |
30 | bne t0, t1, reloc_loop | ||
31 | sw t2, -4(t0) # dst | ||
32 | 32 | ||
33 | entry_point_jump: | 33 | entry_point_jump: |
34 | la t0, entry_point | 34 | la t0, entry_point |
@@ -49,17 +49,18 @@ entry_point: | |||
49 | cache_init_loop: | 49 | cache_init_loop: |
50 | cache 8, 0(t0) # index store icache tag | 50 | cache 8, 0(t0) # index store icache tag |
51 | cache 9, 0(t0) # index store dcache tag | 51 | cache 9, 0(t0) # index store dcache tag |
52 | bne t0, t1, cache_init_loop | ||
53 | addiu t0, t0, 0x10 | 52 | addiu t0, t0, 0x10 |
53 | bne t0, t1, cache_init_loop | ||
54 | nop | ||
54 | 55 | ||
55 | # clear bss | 56 | # clear bss |
56 | la t0, bssbegin | 57 | la t0, bssbegin |
57 | la t1, bssend | 58 | la t1, bssend |
58 | 59 | ||
59 | clear_bss_loop: | 60 | clear_bss_loop: |
60 | sw zero, 0(t0) | ||
61 | bne t0, t1, clear_bss_loop | ||
62 | addiu t0, 4 | 61 | addiu t0, 4 |
62 | bne t0, t1, clear_bss_loop | ||
63 | sw zero, -4(t0) | ||
63 | 64 | ||
64 | # setup stack | 65 | # setup stack |
65 | la sp, stackend | 66 | la sp, stackend |
@@ -67,9 +68,9 @@ clear_bss_loop: | |||
67 | li t1, 0xdeadbeef | 68 | li t1, 0xdeadbeef |
68 | 69 | ||
69 | stack_munge_loop: | 70 | stack_munge_loop: |
70 | sw t1, 0(t0) | ||
71 | bne t0, sp, stack_munge_loop | ||
72 | addiu t0, 4 | 71 | addiu t0, 4 |
72 | bne t0, sp, stack_munge_loop | ||
73 | sw t1, -4(t0) | ||
73 | 74 | ||
74 | # jump to C code | 75 | # jump to C code |
75 | j main | 76 | 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: | |||
29 | reloc_loop: | 29 | reloc_loop: |
30 | lw t2, 0(v0) # src | 30 | lw t2, 0(v0) # src |
31 | addiu v0, 4 # inc src addr | 31 | addiu v0, 4 # inc src addr |
32 | sw t2, 0(t0) # dst | ||
33 | bne t0, t1, reloc_loop | ||
34 | addiu t0, 4 # inc dst addr | 32 | addiu t0, 4 # inc dst addr |
33 | bne t0, t1, reloc_loop | ||
34 | sw t2, -4(t0) # dst | ||
35 | 35 | ||
36 | cache_init: | 36 | cache_init: |
37 | # setup caches | 37 | # setup caches |
@@ -47,8 +47,9 @@ cache_init: | |||
47 | cache_init_loop: | 47 | cache_init_loop: |
48 | cache 8, 0(t0) # index store icache tag | 48 | cache 8, 0(t0) # index store icache tag |
49 | cache 9, 0(t0) # index store dcache tag | 49 | cache 9, 0(t0) # index store dcache tag |
50 | bne t0, t1, cache_init_loop | ||
51 | addiu t0, t0, 0x10 | 50 | addiu t0, t0, 0x10 |
51 | bne t0, t1, cache_init_loop | ||
52 | nop | ||
52 | 53 | ||
53 | intc_setup: | 54 | intc_setup: |
54 | li t0, 0xb0020000 # INTC base | 55 | li t0, 0xb0020000 # INTC base |
@@ -73,9 +74,9 @@ core_irq_setup: | |||
73 | la t1, bssend | 74 | la t1, bssend |
74 | 75 | ||
75 | clear_bss_loop: | 76 | clear_bss_loop: |
76 | sw zero, 0(t0) | ||
77 | bne t0, t1, clear_bss_loop | ||
78 | addiu t0, 4 | 77 | addiu t0, 4 |
78 | bne t0, t1, clear_bss_loop | ||
79 | sw zero, -4(t0) | ||
79 | 80 | ||
80 | # setup stack | 81 | # setup stack |
81 | la k0, irqstackend | 82 | la k0, irqstackend |
@@ -84,9 +85,9 @@ clear_bss_loop: | |||
84 | li t1, 0xdeadbeef | 85 | li t1, 0xdeadbeef |
85 | 86 | ||
86 | stack_munge_loop: | 87 | stack_munge_loop: |
87 | sw t1, 0(t0) | ||
88 | bne t0, sp, stack_munge_loop | ||
89 | addiu t0, 4 | 88 | addiu t0, 4 |
89 | bne t0, sp, stack_munge_loop | ||
90 | sw t1, -4(t0) | ||
90 | 91 | ||
91 | # jump to C code with enabled interrupts | 92 | # jump to C code with enabled interrupts |
92 | la t0, main | 93 | 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: | |||
83 | lw fp, 68(sp) | 83 | lw fp, 68(sp) |
84 | lw ra, 72(sp) | 84 | lw ra, 72(sp) |
85 | 85 | ||
86 | addiu sp, sp, 88 | 86 | addiu sp, sp, 84 |
87 | move sp, k1 | 87 | move sp, k1 |
88 | eret | 88 | eret |
89 | 89 | ||
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: | |||
26 | reloc_loop: | 26 | reloc_loop: |
27 | lw t2, 0(v0) # src | 27 | lw t2, 0(v0) # src |
28 | addiu v0, 4 # inc src addr | 28 | addiu v0, 4 # inc src addr |
29 | sw t2, 0(t0) # dst | ||
30 | bne t0, t1, reloc_loop | ||
31 | addiu t0, 4 # inc dst addr | 29 | addiu t0, 4 # inc dst addr |
30 | bne t0, t1, reloc_loop | ||
31 | sw t2, -4(t0) # dst | ||
32 | 32 | ||
33 | entry_point_jump: | 33 | entry_point_jump: |
34 | la t0, entry_point | 34 | la t0, entry_point |
@@ -49,17 +49,18 @@ entry_point: | |||
49 | cache_init_loop: | 49 | cache_init_loop: |
50 | cache 8, 0(t0) # index store icache tag | 50 | cache 8, 0(t0) # index store icache tag |
51 | cache 9, 0(t0) # index store dcache tag | 51 | cache 9, 0(t0) # index store dcache tag |
52 | bne t0, t1, cache_init_loop | ||
53 | addiu t0, t0, 0x10 | 52 | addiu t0, t0, 0x10 |
53 | bne t0, t1, cache_init_loop | ||
54 | nop | ||
54 | 55 | ||
55 | # clear bss | 56 | # clear bss |
56 | la t0, bssbegin | 57 | la t0, bssbegin |
57 | la t1, bssend | 58 | la t1, bssend |
58 | 59 | ||
59 | clear_bss_loop: | 60 | clear_bss_loop: |
60 | sw zero, 0(t0) | ||
61 | bne t0, t1, clear_bss_loop | ||
62 | addiu t0, 4 | 61 | addiu t0, 4 |
62 | bne t0, t1, clear_bss_loop | ||
63 | sw zero, -4(t0) | ||
63 | 64 | ||
64 | # setup stack | 65 | # setup stack |
65 | la sp, stackend | 66 | la sp, stackend |
@@ -67,9 +68,9 @@ clear_bss_loop: | |||
67 | li t1, 0xdeadbeef | 68 | li t1, 0xdeadbeef |
68 | 69 | ||
69 | stack_munge_loop: | 70 | stack_munge_loop: |
70 | sw t1, 0(t0) | ||
71 | bne t0, sp, stack_munge_loop | ||
72 | addiu t0, 4 | 71 | addiu t0, 4 |
72 | bne t0, sp, stack_munge_loop | ||
73 | sw t1, -4(t0) | ||
73 | 74 | ||
74 | # jump to C code | 75 | # jump to C code |
75 | j main | 76 | j main |