summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-10 21:33:54 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-10 21:33:54 +0000
commitd3e107cd2a23c4a92b8739559df29337e3f68b8b (patch)
tree005911c4e243f24b5c8b411d1105e65fb5b7092f
parent39fb8f0705c60f3aedfe10a44a25b02ac1f4906d (diff)
downloadrockbox-d3e107cd2a23c4a92b8739559df29337e3f68b8b.tar.gz
rockbox-d3e107cd2a23c4a92b8739559df29337e3f68b8b.zip
Jean-Philippe Bernardy: gmini support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5551 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/crt0.S103
1 files changed, 102 insertions, 1 deletions
diff --git a/firmware/crt0.S b/firmware/crt0.S
index 8d014f0a4c..0abc3bdbc6 100644
--- a/firmware/crt0.S
+++ b/firmware/crt0.S
@@ -21,10 +21,108 @@
21 21
22//#define BOOTLOADER 22//#define BOOTLOADER
23 23
24#if defined(ARCHOS_GMINI120)
25 .section .text
26 .global _start
27_start:
28 ;; disable all interrupts
29 clrsr fe
30 clrsr ie
31 clrsr te
32
33 ;; copy data section from flash to ram.
34
35 ld a11, #(_datacopy) ; where the data section is in the flash
36 ld a8, #(_datastart) ; destination
37
38 ld a9, #_datasize
39 ld r6, e9
40 cmp eq, r6, #0
41 brf .data_copy_loop
42 cmp eq, r9, #0
43 brt .data_copy_end
44.data_copy_loop:
45 ldc r2, @a11
46 ldw @[a8 + 0], r2
47 add a11, #0x2
48 add a8, #0x2
49 sub r9, #0x2
50 sbc r6, #0
51 cmp ugt, r6, #0
52 brt .data_copy_loop
53 cmp ugt, r9, #0
54 brt .data_copy_loop
55.data_copy_end:
56
57 ld r2, #0
58 ld a8, #(_bssstart) ; destination
59 ld a9, #_bsssize
60
61 ld r6, e9
62 cmp eq, r6, #0
63 brf .bss_init_loop
64 cmp eq, r9, #0
65 brt .bss_init_end
66.bss_init_loop:
67 ldw @[a8 + 0], r2
68 add a8, #0x2
69 sub r9, #0x2
70 sbc r6, #0
71 cmp ugt, r6, #0
72 brt .bss_init_loop
73 cmp ugt, r9, #0
74 brt .bss_init_loop
75.bss_init_end:
76
77 ld a15, _stackend
78
79 ;; rest of the setup in C
80 jsr _cpu_setup
81
82 ;; enable IRQs (keep traps and fast interrupts low)
83 setsr ie
84
85 ;; go!
86 jsr _main
87
88 ;; soft reset
89 ld a10, #0
90 ldc r10, @a10
91 jmp a10
92
93
94 .section .vectors, "ax"
95irq_handler:
96
97 push r0, r1
98 push r2, r3
99 push r4, r5
100 push r6, r7
101 push a8, a9
102 push a10, a11
103 push a12, a13
104 push a14
105 ld a13, #0x3f0000
106 ldb r0, @[a13 + 0x26]
107 add r0, r0
108 ld a10, #_interrupt_vector
109 ldw a13, @[a10 + r0]
110 jsr a13
111 pop a14
112 pop a13, a12
113 pop a11, a10
114 pop a9, a8
115 pop r7, r6
116 pop r5, r4
117 pop r3, r2
118 pop r1, r0
119 ret_irq
120
121#elif defined(IRIVER_H100)
24 .section .init.text 122 .section .init.text
25 .global start 123 .global start
26start: 124start:
27#ifdef IRIVER_H100 125
28 /* Platform: iRiver H1xx */ 126 /* Platform: iRiver H1xx */
29 move.w #0x2700,%sr 127 move.w #0x2700,%sr
30 128
@@ -166,6 +264,9 @@ vectors:
166 .long _stackend 264 .long _stackend
167 .long start 265 .long start
168#else 266#else
267 .section .init.text
268 .global start
269start:
169 /* Platform: Archos Jukebox 270 /* Platform: Archos Jukebox
170 * We begin with some tricks. If we have built our code to be loaded 271 * We begin with some tricks. If we have built our code to be loaded
171 * via the standalone GDB stub, we will have out VBR at some other 272 * via the standalone GDB stub, we will have out VBR at some other