FreeCalypso > hg > freecalypso-reveng
comparison compal/j100-fw-disasm @ 286:dd8a9ebcd8b1
compal/j100-fw-disasm: GPIO init analysis
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 14 Mar 2019 22:40:18 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
285:e5b0164f6060 | 286:dd8a9ebcd8b1 |
---|---|
1 ; This analysis corresponds to SE J100 fw version R1C004, published in | |
2 ; R1C004-se.bin inside the j100-flashimg-r1.zip FTP release. | |
3 | |
4 0: ea000225 b 0x89c | |
5 4: ea000825 b 0x20a0 | |
6 8: ea000825 b 0x20a4 | |
7 c: ea000825 b 0x20a8 | |
8 10: ea000825 b 0x20ac | |
9 14: ea000825 b 0x20b0 | |
10 18: ea000825 b 0x20b4 | |
11 1c: ea000825 b 0x20b8 | |
12 | |
13 _INT_Bootloader_Start: | |
14 ; same as the Mot C139 version | |
15 89c: e51f1020 ldr r1, =0xfffffd00 ; via 0x884 | |
16 8a0: e1d120b2 ldrh r2, [r1, #2] | |
17 8a4: e51f002c ldr r0, =0x40 ; via 0x880 | |
18 8a8: e1800002 orr r0, r0, r2 | |
19 8ac: e1c100b2 strh r0, [r1, #2] | |
20 8b0: e51f1030 ldr r1, =0xffff9800 ; via 0x888 | |
21 8b4: e15f22b6 ldrh r2, =0x2006 ; via 0x896 | |
22 8b8: e1c120b0 strh r2, [r1] | |
23 8bc: e5912000 ldr r2, [r1] | |
24 8c0: e2022001 and r2, r2, #1 | |
25 8c4: e3520001 cmp r2, #1 | |
26 8c8: 0afffffb beq 0x8bc | |
27 8cc: e51f1050 ldr r1, =0xfffffd00 ; via 0x884 | |
28 8d0: e15f24b4 ldrh r2, =0x1081 ; via 0x894 | |
29 8d4: e1c120b0 strh r2, [r1] | |
30 8d8: e51f1054 ldr r1, =0xfffffb10 ; via 0x88c | |
31 8dc: e15f24bc ldrh r2, =0x800 ; via 0x898 | |
32 8e0: e1d100b0 ldrh r0, [r1] | |
33 8e4: e1800002 orr r0, r0, r2 | |
34 8e8: e1c100b0 strh r0, [r1] | |
35 8ec: e51f1064 ldr r1, =0xffffff08 ; via 0x890 | |
36 8f0: e15f25be ldrh r2, =0x0 ; via 0x89a | |
37 8f4: e1c120b0 strh r2, [r1] | |
38 8f8: e51f1094 ldr r1, =0xfffffb00 ; via 0x86c | |
39 8fc: e15f29b4 ldrh r2, =0x2a1 ; via 0x870 | |
40 900: e1c120b0 strh r2, [r1] | |
41 904: e15f29ba ldrh r2, =0x2a1 ; via 0x872 | |
42 908: e1c120b2 strh r2, [r1, #2] | |
43 90c: e15f2ab0 ldrh r2, =0x2a1 ; via 0x874 | |
44 910: e1c120b4 strh r2, [r1, #4] | |
45 914: e15f2ab6 ldrh r2, =0x283 ; via 0x876 | |
46 918: e1c120b6 strh r2, [r1, #6] | |
47 91c: e15f2abc ldrh r2, =0x281 ; via 0x878 | |
48 920: e1c120ba strh r2, [r1, #10] ; 0xa | |
49 924: e15f2bb2 ldrh r2, =0xc0 ; via 0x87a | |
50 928: e1c120bc strh r2, [r1, #12] ; 0xc | |
51 92c: e15f2bb8 ldrh r2, =0x40 ; via 0x87c | |
52 930: e1c120b8 strh r2, [r1, #8] | |
53 934: e15f2bbe ldrh r2, =0x2a ; via 0x87e | |
54 938: e1c120be strh r2, [r1, #14] ; 0xe | |
55 93c: e59f0020 ldr r0, =0x83aca4 ; via 0x964 | |
56 940: e3a01b01 mov r1, #1024 ; 0x400 | |
57 944: e2411004 sub r1, r1, #4 | |
58 948: e0802001 add r2, r0, r1 | |
59 94c: e3c22003 bic r2, r2, #3 | |
60 950: e1a0d002 mov sp, r2 | |
61 954: e92d100f stmdb sp!, {r0, r1, r2, r3, r12} | |
62 958: eb000534 bl 0x1e30 ; _sta_select_application | |
63 95c: e8bd100f ldmia sp!, {r0, r1, r2, r3, r12} | |
64 960: ea0005e4 b 0x20f8 ; _sta_select_application | |
65 | |
66 _INT_Initialize: | |
67 ; exactly the same as the Mot C139 version | |
68 20f8: e51f1024 ldr r1, =0xffff9800 ; via 0x20dc | |
69 20fc: e15f21ba ldrh r2, =0x2002 ; via 0x20ea | |
70 2100: e1c120b0 strh r2, [r1] | |
71 2104: e5912000 ldr r2, [r1] | |
72 2108: e2022001 and r2, r2, #1 | |
73 210c: e3520001 cmp r2, #1 | |
74 2110: 0afffffb beq 0x2104 | |
75 2114: e51f1044 ldr r1, =0xfffffd00 ; via 0x20d8 | |
76 2118: e15f23b8 ldrh r2, =0x1081 ; via 0x20e8 | |
77 211c: e1c120b0 strh r2, [r1] | |
78 2120: e51f1048 ldr r1, =0xfffffb10 ; via 0x20e0 | |
79 2124: e15f23be ldrh r2, =0xf7ff ; via 0x20ee | |
80 2128: e1d100b0 ldrh r0, [r1] | |
81 212c: e0000002 and r0, r0, r2 | |
82 2130: e1c100b0 strh r0, [r1] | |
83 2134: e51f1058 ldr r1, =0xffffff08 ; via 0x20e4 | |
84 2138: e15f25b0 ldrh r2, =0x0 ; via 0x20f0 | |
85 213c: e1c120b0 strh r2, [r1] | |
86 2140: e51f107c ldr r1, =0xfffffb00 ; via 0x20cc | |
87 2144: e15f29b0 ldrh r2, =0x2a1 ; via 0x20bc | |
88 2148: e1c120b0 strh r2, [r1] | |
89 214c: e15f29b6 ldrh r2, =0x2a1 ; via 0x20be | |
90 2150: e1c120b2 strh r2, [r1, #2] | |
91 2154: e15f29bc ldrh r2, =0x2a1 ; via 0x20c0 | |
92 2158: e1c120b4 strh r2, [r1, #4] | |
93 215c: e15f2ab2 ldrh r2, =0x283 ; via 0x20c2 | |
94 2160: e1c120b6 strh r2, [r1, #6] | |
95 2164: e15f2ab8 ldrh r2, =0xe85 ; via 0x20c4 | |
96 2168: e1c120ba strh r2, [r1, #10] ; 0xa | |
97 216c: e15f2abe ldrh r2, =0x2c0 ; via 0x20c6 | |
98 2170: e1c120bc strh r2, [r1, #12] ; 0xc | |
99 2174: e15f2bb4 ldrh r2, =0x40 ; via 0x20c8 | |
100 2178: e1c120b8 strh r2, [r1, #8] | |
101 217c: e15f2bba ldrh r2, =0x2a ; via 0x20ca | |
102 2180: e1c120be strh r2, [r1, #14] ; 0xe | |
103 2184: e51f10bc ldr r1, =0xfffef006 ; via 0x20d0 | |
104 2188: e1d120b0 ldrh r2, [r1] | |
105 218c: e51f00c0 ldr r0, =0x8 ; via 0x20d4 | |
106 2190: e1800002 orr r0, r0, r2 | |
107 2194: e1c100b0 strh r0, [r1] | |
108 2198: e10f0000 mrs r0, CPSR | |
109 219c: e3c0001f bic r0, r0, #31 ; 0x1f | |
110 21a0: e3800013 orr r0, r0, #19 ; 0x13 | |
111 21a4: e38000c0 orr r0, r0, #192 ; 0xc0 | |
112 21a8: e129f000 msr CPSR_fc, r0 | |
113 21ac: e3a00502 mov r0, #8388608 ; 0x800000 | |
114 21b0: e3a02000 mov r2, #0 | |
115 21b4: e3a01721 mov r1, #8650752 ; 0x840000 | |
116 21b8: e2411080 sub r1, r1, #128 ; 0x80 | |
117 21bc: e4802004 str r2, [r0], #4 | |
118 21c0: e1500001 cmp r0, r1 | |
119 21c4: 1afffffc bne 0x21bc | |
120 21c8: e3a00401 mov r0, #16777216 ; 0x1000000 | |
121 21cc: e3a02000 mov r2, #0 | |
122 21d0: e3a01742 mov r1, #17301504 ; 0x1080000 | |
123 21d4: e2411080 sub r1, r1, #128 ; 0x80 | |
124 21d8: e4802004 str r2, [r0], #4 | |
125 21dc: e1500001 cmp r0, r1 | |
126 21e0: 1afffffc bne 0x21d8 | |
127 21e4: e3a00001 mov r0, #1 | |
128 21e8: e59f12c8 ldr r1, =0x83ac7c ; via 0x24b8 | |
129 21ec: e5810000 str r0, [r1] | |
130 21f0: e59f02bc ldr r0, =0x83ad90 ; via 0x24b4 | |
131 21f4: e3a01b01 mov r1, #1024 ; 0x400 | |
132 21f8: e2411004 sub r1, r1, #4 | |
133 21fc: e0802001 add r2, r0, r1 | |
134 2200: e1a0a000 mov r10, r0 | |
135 2204: e59f32b0 ldr r3, =0x80a9f4 ; via 0x24bc | |
136 2208: e583a000 str r10, [r3] | |
137 220c: e1a0d002 mov sp, r2 | |
138 2210: e59f32a8 ldr r3, =0x80a55c ; via 0x24c0 | |
139 2214: e583d000 str sp, [r3] | |
140 2218: e3a01080 mov r1, #128 ; 0x80 | |
141 221c: e0822001 add r2, r2, r1 | |
142 2220: e10f0000 mrs r0, CPSR | |
143 2224: e3c0001f bic r0, r0, #31 ; 0x1f | |
144 2228: e3800012 orr r0, r0, #18 ; 0x12 | |
145 222c: e129f000 msr CPSR_fc, r0 | |
146 2230: e1a0d002 mov sp, r2 | |
147 2234: e3a01c02 mov r1, #512 ; 0x200 | |
148 2238: e0822001 add r2, r2, r1 | |
149 223c: e10f0000 mrs r0, CPSR | |
150 2240: e3c0001f bic r0, r0, #31 ; 0x1f | |
151 2244: e3800011 orr r0, r0, #17 ; 0x11 | |
152 2248: e129f000 msr CPSR_fc, r0 | |
153 224c: e1a0d002 mov sp, r2 | |
154 2250: e10f0000 mrs r0, CPSR | |
155 2254: e3c0001f bic r0, r0, #31 ; 0x1f | |
156 2258: e3800017 orr r0, r0, #23 ; 0x17 | |
157 225c: e129f000 msr CPSR_fc, r0 | |
158 2260: e59fd268 ldr sp, =0x83acf8 ; via 0x24d0 | |
159 2264: e10f0000 mrs r0, CPSR | |
160 2268: e3c0001f bic r0, r0, #31 ; 0x1f | |
161 226c: e380001b orr r0, r0, #27 ; 0x1b | |
162 2270: e129f000 msr CPSR_fc, r0 | |
163 2274: e59fd254 ldr sp, =0x83acf8 ; via 0x24d0 | |
164 2278: e10f0000 mrs r0, CPSR | |
165 227c: e3c0001f bic r0, r0, #31 ; 0x1f | |
166 2280: e3800013 orr r0, r0, #19 ; 0x13 | |
167 2284: e129f000 msr CPSR_fc, r0 | |
168 2288: e59f3234 ldr r3, =0x80aa08 ; via 0x24c4 | |
169 228c: e2822004 add r2, r2, #4 | |
170 2290: e5832000 str r2, [r3] | |
171 2294: e3a01b01 mov r1, #1024 ; 0x400 | |
172 2298: e3c11003 bic r1, r1, #3 | |
173 229c: e0822001 add r2, r2, r1 | |
174 22a0: e59f3220 ldr r3, =0x80aa8c ; via 0x24c8 | |
175 22a4: e5831000 str r1, [r3] | |
176 22a8: e3a01002 mov r1, #2 | |
177 22ac: e59f3218 ldr r3, =0x80aa9c ; via 0x24cc | |
178 22b0: e5831000 str r1, [r3] | |
179 22b4: e1a04002 mov r4, r2 | |
180 22b8: eb084361 bl 0x213044 ; _f_load_int_mem | |
181 22bc: e1a02004 mov r2, r4 | |
182 22c0: e59f11f4 ldr r1, =0x80a9f4 ; via 0x24bc | |
183 22c4: e5910000 ldr r0, [r1] | |
184 22c8: e3a030fe mov r3, #254 ; 0xfe | |
185 22cc: e5c03000 strb r3, [r0] | |
186 22d0: e5c03001 strb r3, [r0, #1] | |
187 22d4: e5c03002 strb r3, [r0, #2] | |
188 22d8: e5c03003 strb r3, [r0, #3] | |
189 22dc: e4903004 ldr r3, [r0], #4 | |
190 22e0: e4803004 str r3, [r0], #4 | |
191 22e4: e1500002 cmp r0, r2 | |
192 22e8: bafffffc blt 0x22e0 | |
193 22ec: e51f0200 ldr r0, =0x2810 ; via 0x20f4 | |
194 22f0: e3700001 cmn r0, #1 | |
195 22f4: 1b000077 blne 0x24d8 ; _auto_init | |
196 22f8: e1a00002 mov r0, r2 | |
197 22fc: ea084362 b 0x21308c ; _INC_Initialize | |
198 | |
199 $Init_Target: | |
200 200890: b530 push {r4, r5, lr} | |
201 200892: b081 sub sp, #4 | |
202 200894: 497c ldr r1, =0xfffef008 ; via 0x200a88 | |
203 200896: 2003 mov r0, #3 | |
204 200898: 0340 lsl r0, r0, #13 | |
205 20089a: 8008 strh r0, [r1, #0] | |
206 20089c: f009 fee0 bl 0x20a660 ; $TM_DisableWatchdog | |
207 2008a0: 487a ldr r0, =0xfffffd02 ; via 0x200a8c | |
208 2008a2: 2105 mov r1, #5 | |
209 2008a4: 8001 strh r1, [r0, #0] | |
210 2008a6: 2180 mov r1, #128 ; 0x80 | |
211 2008a8: 8802 ldrh r2, [r0, #0] | |
212 2008aa: 4311 orr r1, r2 | |
213 2008ac: 8001 strh r1, [r0, #0] | |
214 2008ae: 4978 ldr r1, =0xffdf ; via 0x200a90 | |
215 2008b0: 8802 ldrh r2, [r0, #0] | |
216 2008b2: 4011 and r1, r2 | |
217 2008b4: 8001 strh r1, [r0, #0] | |
218 2008b6: 4d77 ldr r5, =0xfffff900 ; via 0x200a94 | |
219 2008b8: 20ff mov r0, #255 ; 0xff | |
220 2008ba: 0200 lsl r0, r0, #8 | |
221 2008bc: 8028 strh r0, [r5, #0] | |
222 2008be: 4c76 ldr r4, =0xffff9800 ; via 0x200a98 | |
223 2008c0: 4876 ldr r0, =0xfff3 ; via 0x200a9c | |
224 2008c2: 8821 ldrh r1, [r4, #0] | |
225 2008c4: 4008 and r0, r1 | |
226 2008c6: 8020 strh r0, [r4, #0] | |
227 2008c8: 8820 ldrh r0, [r4, #0] | |
228 2008ca: 8020 strh r0, [r4, #0] | |
229 2008cc: 4874 ldr r0, =0xf01f ; via 0x200aa0 | |
230 2008ce: 8821 ldrh r1, [r4, #0] | |
231 2008d0: 4008 and r0, r1 | |
232 2008d2: 8020 strh r0, [r4, #0] | |
233 2008d4: 2001 mov r0, #1 | |
234 2008d6: 0280 lsl r0, r0, #10 | |
235 2008d8: 8821 ldrh r1, [r4, #0] | |
236 2008da: 4308 orr r0, r1 | |
237 2008dc: 8020 strh r0, [r4, #0] | |
238 2008de: 2000 mov r0, #0 | |
239 2008e0: 2102 mov r1, #2 | |
240 2008e2: 2200 mov r2, #0 | |
241 2008e4: f00a fd04 bl 0x20b2f0 ; $CLKM_InitARMClock | |
242 2008e8: 486e ldr r0, =0xfffffb00 ; via 0x200aa4 | |
243 2008ea: 21a3 mov r1, #163 ; 0xa3 | |
244 2008ec: 8001 strh r1, [r0, #0] | |
245 2008ee: 8041 strh r1, [r0, #2] | |
246 ; nCS2 setup is different: 0xA6 instead of TI/C11x/C139 0xA5 | |
247 2008f0: 22a6 mov r2, #166 ; 0xa6 | |
248 2008f2: 8082 strh r2, [r0, #4] | |
249 2008f4: 80c1 strh r1, [r0, #6] | |
250 2008f6: 2180 mov r1, #128 ; 0x80 | |
251 2008f8: 8141 strh r1, [r0, #10] ; 0xa | |
252 2008fa: 21c0 mov r1, #192 ; 0xc0 | |
253 2008fc: 8181 strh r1, [r0, #12] ; 0xc | |
254 2008fe: 2140 mov r1, #64 ; 0x40 | |
255 200900: 8101 strh r1, [r0, #8] | |
256 200902: 2020 mov r0, #32 ; 0x20 | |
257 200904: 8068 strh r0, [r5, #2] | |
258 200906: 2000 mov r0, #0 | |
259 200908: 80a8 strh r0, [r5, #4] | |
260 20090a: 2010 mov r0, #16 ; 0x10 | |
261 20090c: 8821 ldrh r1, [r4, #0] | |
262 20090e: 4308 orr r0, r1 | |
263 200910: 8020 strh r0, [r4, #0] | |
264 200912: 4865 ldr r0, =0xfffffa08 ; via 0x200aa8 | |
265 200914: 4965 ldr r1, =0xffff ; via 0x200aac | |
266 200916: 8001 strh r1, [r0, #0] | |
267 200918: 8041 strh r1, [r0, #2] | |
268 20091a: 2103 mov r1, #3 | |
269 20091c: 8181 strh r1, [r0, #12] ; 0xc | |
270 20091e: f008 fe39 bl 0x209594 ; $IQ_SetupInterrupts | |
271 200922: 4863 ldr r0, =0xfffffc00 ; via 0x200ab0 | |
272 200924: 2124 mov r1, #36 ; 0x24 | |
273 200926: 8001 strh r1, [r0, #0] | |
274 200928: 210d mov r1, #13 ; 0xd | |
275 20092a: 8041 strh r1, [r0, #2] | |
276 20092c: 2500 mov r5, #0 | |
277 20092e: 4861 ldr r0, =0xfffe2016 ; via 0x200ab4 | |
278 200930: 8005 strh r5, [r0, #0] | |
279 200932: 4961 ldr r1, =0xfffe2014 ; via 0x200ab8 | |
280 200934: 2002 mov r0, #2 | |
281 200936: 8008 strh r0, [r1, #0] | |
282 200938: 4960 ldr r1, =0xfffe2002 ; via 0x200abc | |
283 20093a: 2084 mov r0, #132 ; 0x84 | |
284 20093c: 8008 strh r0, [r1, #0] | |
285 20093e: 4860 ldr r0, =0xfffe2000 ; via 0x200ac0 | |
286 200940: 4960 ldr r1, =0x3de0 ; via 0x200ac4 | |
287 200942: 8001 strh r1, [r0, #0] | |
288 200944: 4960 ldr r1, =0xfffe2022 ; via 0x200ac8 | |
289 200946: 220a mov r2, #10 ; 0xa | |
290 200948: 800a strh r2, [r1, #0] | |
291 20094a: 4960 ldr r1, =0xfffe2020 ; via 0x200acc | |
292 20094c: 4a60 ldr r2, =0x45a ; via 0x200ad0 | |
293 20094e: 800a strh r2, [r1, #0] | |
294 200950: 4a60 ldr r2, =0xfffe201e ; via 0x200ad4 | |
295 200952: 21ff mov r1, #255 ; 0xff | |
296 200954: 314b add r1, #75 ; 0x4b | |
297 200956: 8011 strh r1, [r2, #0] | |
298 200958: 495f ldr r1, =0xfffe201c ; via 0x200ad8 | |
299 20095a: 221f mov r2, #31 ; 0x1f | |
300 20095c: 800a strh r2, [r1, #0] | |
301 20095e: 495f ldr r1, =0xfffe2024 ; via 0x200adc | |
302 200960: 800d strh r5, [r1, #0] | |
303 200962: 495f ldr r1, =0xfffe2010 ; via 0x200ae0 | |
304 200964: 2202 mov r2, #2 | |
305 200966: 880b ldrh r3, [r1, #0] | |
306 200968: 431a orr r2, r3 | |
307 20096a: 800a strh r2, [r1, #0] | |
308 20096c: 4b5c ldr r3, =0xfffe2010 ; via 0x200ae0 | |
309 20096e: 2104 mov r1, #4 | |
310 200970: 881a ldrh r2, [r3, #0] | |
311 200972: 4311 orr r1, r2 | |
312 200974: 8019 strh r1, [r3, #0] | |
313 200976: 4c5b ldr r4, =0xfffef006 ; via 0x200ae4 | |
314 200978: 2127 mov r1, #39 ; 0x27 | |
315 20097a: 80e1 strh r1, [r4, #6] | |
316 20097c: 8a01 ldrh r1, [r0, #16] ; 0x10 | |
317 20097e: 0849 lsr r1, r1, #1 | |
318 200980: d30f bcc 0x2009a2 | |
319 200982: 8a01 ldrh r1, [r0, #16] ; 0x10 | |
320 200984: 0409 lsl r1, r1, #16 | |
321 200986: 0c49 lsr r1, r1, #17 | |
322 200988: 0049 lsl r1, r1, #1 | |
323 20098a: 8201 strh r1, [r0, #16] ; 0x10 | |
324 20098c: 2101 mov r1, #1 | |
325 20098e: e001 b 0x200994 | |
326 200990: 9900 ldr r1, [sp, #0] | |
327 200992: 3101 add r1, #1 | |
328 200994: 9100 str r1, [sp, #0] | |
329 200996: 9900 ldr r1, [sp, #0] | |
330 200998: 2932 cmp r1, #50 ; 0x32 | |
331 20099a: d3f9 bcc 0x200990 | |
332 20099c: 8a41 ldrh r1, [r0, #18] ; 0x12 | |
333 20099e: 2900 cmp r1, #0 | |
334 2009a0: d0fc beq 0x20099c | |
335 2009a2: f007 fb46 bl 0x208032 ; $AI_ClockEnable | |
336 2009a6: f007 fb4a bl 0x20803e ; $AI_InitIOConfig | |
337 2009aa: 2027 mov r0, #39 ; 0x27 | |
338 2009ac: 0500 lsl r0, r0, #20 | |
339 2009ae: 8005 strh r5, [r0, #0] | |
340 ; extra code not in TI's version, beginning like C11x and C139 | |
341 2009b0: 484d ldr r0, =0xffbf ; via 0x200ae8 | |
342 2009b2: 8821 ldrh r1, [r4, #0] | |
343 2009b4: 4008 and r0, r1 | |
344 2009b6: 8020 strh r0, [r4, #0] | |
345 ; beginning of diff from C11x and C139 | |
346 ; GPIO 2 is set low instead of high here | |
347 2009b8: 2002 mov r0, #2 | |
348 2009ba: f007 fb10 bl 0x207fde ; $AI_ResetBit | |
349 ; setting bits 5 and 9 in FFFE:F00A just like C11x and C139 versions | |
350 2009be: 2001 mov r0, #1 | |
351 2009c0: 0240 lsl r0, r0, #9 | |
352 2009c2: 88a1 ldrh r1, [r4, #4] | |
353 2009c4: 4308 orr r0, r1 | |
354 2009c6: 80a0 strh r0, [r4, #4] | |
355 2009c8: 2020 mov r0, #32 ; 0x20 | |
356 2009ca: 88a1 ldrh r1, [r4, #4] | |
357 2009cc: 4308 orr r0, r1 | |
358 2009ce: 80a0 strh r0, [r4, #4] | |
359 ; also setting bits 8, 7 and 0 (IO_CONF_REG |= 0x181) | |
360 2009d0: 20ff mov r0, #255 ; 0xff | |
361 2009d2: 3082 add r0, #130 ; 0x82 | |
362 2009d4: 88a1 ldrh r1, [r4, #4] | |
363 2009d6: 4308 orr r0, r1 | |
364 2009d8: 80a0 strh r0, [r4, #4] | |
365 ; GPIO directions | |
366 2009da: 2004 mov r0, #4 | |
367 2009dc: f007 fb0d bl 0x207ffa ; $AI_ConfigBitAsInput | |
368 2009e0: 2006 mov r0, #6 | |
369 2009e2: f007 fb0a bl 0x207ffa ; $AI_ConfigBitAsInput | |
370 2009e6: 2008 mov r0, #8 | |
371 2009e8: f007 fb00 bl 0x207fec ; $AI_ConfigBitAsOutput | |
372 2009ec: 200a mov r0, #10 ; 0xa | |
373 2009ee: f007 fafd bl 0x207fec ; $AI_ConfigBitAsOutput | |
374 2009f2: 200b mov r0, #11 ; 0xb | |
375 2009f4: f007 fb01 bl 0x207ffa ; $AI_ConfigBitAsInput | |
376 2009f8: 200c mov r0, #12 ; 0xc | |
377 2009fa: f007 faf7 bl 0x207fec ; $AI_ConfigBitAsOutput | |
378 2009fe: 2008 mov r0, #8 | |
379 200a00: f007 faed bl 0x207fde ; $AI_ResetBit | |
380 200a04: 200a mov r0, #10 ; 0xa | |
381 200a06: f007 faea bl 0x207fde ; $AI_ResetBit | |
382 200a0a: 200c mov r0, #12 ; 0xc | |
383 200a0c: f007 fae7 bl 0x207fde ; $AI_ResetBit | |
384 ; tail end of TI's original code | |
385 200a10: 2001 mov r0, #1 | |
386 200a12: f009 fe2d bl 0x20a670 | |
387 200a16: 2002 mov r0, #2 | |
388 200a18: f009 fe2a bl 0x20a670 | |
389 200a1c: b001 add sp, #4 | |
390 200a1e: bd30 pop {r4, r5, pc} | |
391 | |
392 $Init_Drivers: | |
393 200a20: b500 push {lr} | |
394 200a22: f7c5 fdfd bl 0x1c6620 | |
395 200a26: f7c6 fd8d bl 0x1c7544 | |
396 200a2a: f780 fe7e bl 0x18172a | |
397 200a2e: f797 ffef bl 0x198a10 | |
398 200a32: f7eb f8d9 bl 0x1ebbe8 | |
399 200a36: f00c fbb5 bl 0x20d1a4 | |
400 200a3a: f7a5 fc81 bl 0x1a6340 | |
401 200a3e: f754 f8a1 bl 0x154b84 | |
402 200a42: f7d3 f89e bl 0x1d3b82 | |
403 200a46: bd00 pop {pc} | |
404 | |
405 $Init_Serial_Flows: | |
406 200a48: b500 push {lr} | |
407 200a4a: 4828 ldr r0, =0x83a728 ; via 0x200aec | |
408 200a4c: f7c4 fe7e bl 0x1c574c | |
409 200a50: 2000 mov r0, #0 | |
410 200a52: 2102 mov r1, #2 | |
411 200a54: 2200 mov r2, #0 | |
412 200a56: f7c4 fef2 bl 0x1c583e | |
413 200a5a: f7c4 ff4c bl 0x1c58f6 | |
414 200a5e: bd00 pop {pc} | |
415 | |
416 $Init_Unmask_IT: | |
417 200a60: b500 push {lr} | |
418 200a62: 2004 mov r0, #4 | |
419 200a64: f008 fdf7 bl 0x209656 | |
420 200a68: 2012 mov r0, #18 ; 0x12 | |
421 200a6a: f008 fdf4 bl 0x209656 | |
422 200a6e: 2007 mov r0, #7 | |
423 200a70: f008 fdf1 bl 0x209656 | |
424 200a74: 2008 mov r0, #8 | |
425 200a76: f008 fdee bl 0x209656 | |
426 200a7a: bd00 pop {pc} | |
427 | |
428 $GpUnmaskRTCAlarmInterrupts: | |
429 200a7c: b500 push {lr} | |
430 200a7e: 200a mov r0, #10 ; 0xa | |
431 200a80: f008 fde9 bl 0x209656 | |
432 200a84: bd00 pop {pc} | |
433 200a86: 46c0 nop (mov r8, r8) | |
434 | |
435 $AI_EnableBit: | |
436 207fb4: 4a5a ldr r2, =0xfffef00a ; via 0x208120 | |
437 207fb6: 2101 mov r1, #1 | |
438 207fb8: 4081 lsl r1, r0 | |
439 207fba: 8810 ldrh r0, [r2, #0] | |
440 207fbc: 4301 orr r1, r0 | |
441 207fbe: 8011 strh r1, [r2, #0] | |
442 207fc0: 4770 bx lr | |
443 | |
444 $AI_DisableBit: | |
445 207fc2: 4a57 ldr r2, =0xfffef00a ; via 0x208120 | |
446 207fc4: 2101 mov r1, #1 | |
447 207fc6: 4081 lsl r1, r0 | |
448 207fc8: 8810 ldrh r0, [r2, #0] | |
449 207fca: 4388 bic r0, r1 | |
450 207fcc: 8010 strh r0, [r2, #0] | |
451 207fce: 4770 bx lr | |
452 | |
453 $AI_SetBit: | |
454 207fd0: 4a54 ldr r2, =0xfffe4802 ; via 0x208124 | |
455 207fd2: 2101 mov r1, #1 | |
456 207fd4: 4081 lsl r1, r0 | |
457 207fd6: 8810 ldrh r0, [r2, #0] | |
458 207fd8: 4301 orr r1, r0 | |
459 207fda: 8011 strh r1, [r2, #0] | |
460 207fdc: 4770 bx lr | |
461 | |
462 $AI_ResetBit: | |
463 207fde: 4a51 ldr r2, =0xfffe4802 ; via 0x208124 | |
464 207fe0: 2101 mov r1, #1 | |
465 207fe2: 4081 lsl r1, r0 | |
466 207fe4: 8810 ldrh r0, [r2, #0] | |
467 207fe6: 4388 bic r0, r1 | |
468 207fe8: 8010 strh r0, [r2, #0] | |
469 207fea: 4770 bx lr | |
470 | |
471 $AI_ConfigBitAsOutput: | |
472 207fec: 4a4e ldr r2, =0xfffe4804 ; via 0x208128 | |
473 207fee: 2101 mov r1, #1 | |
474 207ff0: 4081 lsl r1, r0 | |
475 207ff2: 8810 ldrh r0, [r2, #0] | |
476 207ff4: 4388 bic r0, r1 | |
477 207ff6: 8010 strh r0, [r2, #0] | |
478 207ff8: 4770 bx lr | |
479 | |
480 $AI_ConfigBitAsInput: | |
481 207ffa: 4a4b ldr r2, =0xfffe4804 ; via 0x208128 | |
482 207ffc: 2101 mov r1, #1 | |
483 207ffe: 4081 lsl r1, r0 | |
484 208000: 8810 ldrh r0, [r2, #0] | |
485 208002: 4301 orr r1, r0 | |
486 208004: 8011 strh r1, [r2, #0] | |
487 208006: 4770 bx lr | |
488 | |
489 $AI_ReadBit: | |
490 208008: 4948 ldr r1, =0xfffe4800 ; via 0x20812c | |
491 20800a: 8809 ldrh r1, [r1, #0] | |
492 20800c: 4101 asr r1, r0 | |
493 20800e: 07c8 lsl r0, r1, #31 | |
494 208010: 0fc0 lsr r0, r0, #31 | |
495 208012: 0600 lsl r0, r0, #24 | |
496 208014: 0e00 lsr r0, r0, #24 | |
497 208016: 4770 bx lr | |
498 | |
499 $AI_Power: | |
500 208018: b500 push {lr} | |
501 20801a: 2800 cmp r0, #0 | |
502 20801c: d101 bne 0x208022 | |
503 20801e: f7be fe3d bl 0x1c6c9c | |
504 208022: bd00 pop {pc} | |
505 | |
506 $AI_ResetIoConfig: | |
507 208024: 4940 ldr r1, =0xfffe4804 ; via 0x208128 | |
508 208026: 4842 ldr r0, =0xffff ; via 0x208130 | |
509 208028: 8008 strh r0, [r1, #0] | |
510 20802a: 483d ldr r0, =0xfffef00a ; via 0x208120 | |
511 20802c: 2100 mov r1, #0 | |
512 20802e: 8001 strh r1, [r0, #0] | |
513 208030: 4770 bx lr | |
514 | |
515 $AI_ClockEnable: | |
516 208032: 4940 ldr r1, =0xfffe4806 ; via 0x208134 | |
517 208034: 2020 mov r0, #32 ; 0x20 | |
518 208036: 880a ldrh r2, [r1, #0] | |
519 208038: 4310 orr r0, r2 | |
520 20803a: 8008 strh r0, [r1, #0] | |
521 20803c: 4770 bx lr | |
522 | |
523 $AI_InitIOConfig: | |
524 20803e: b500 push {lr} | |
525 208040: f7ff fff0 bl 0x208024 ; $AI_ResetIoConfig | |
526 ; insert new to this J100 version (not from TI, not in C11x, not in C139) | |
527 ; clears bit 10 in FFFE:F008 to ensure that I/O 3 is a GPIO | |
528 208044: 493c ldr r1, =0xfffef008 ; via 0x208138 | |
529 208046: 483d ldr r0, =0xfbff ; via 0x20813c | |
530 208048: 880a ldrh r2, [r1, #0] | |
531 20804a: 4010 and r0, r2 | |
532 20804c: 8008 strh r0, [r1, #0] | |
533 20804e: 2000 mov r0, #0 | |
534 208050: f7ff ffb0 bl 0x207fb4 ; $AI_EnableBit | |
535 208054: 2002 mov r0, #2 | |
536 208056: f7ff ffad bl 0x207fb4 ; $AI_EnableBit | |
537 20805a: 2003 mov r0, #3 | |
538 20805c: f7ff ffaa bl 0x207fb4 ; $AI_EnableBit | |
539 208060: 2004 mov r0, #4 | |
540 208062: f7ff ffa7 bl 0x207fb4 ; $AI_EnableBit | |
541 208066: 2005 mov r0, #5 | |
542 208068: f7ff ffa4 bl 0x207fb4 ; $AI_EnableBit | |
543 20806c: 2006 mov r0, #6 | |
544 20806e: f7ff ffa1 bl 0x207fb4 ; $AI_EnableBit | |
545 208072: 2007 mov r0, #7 | |
546 208074: f7ff ff9e bl 0x207fb4 ; $AI_EnableBit | |
547 208078: 2008 mov r0, #8 | |
548 20807a: f7ff ff9b bl 0x207fb4 ; $AI_EnableBit | |
549 20807e: 2009 mov r0, #9 | |
550 208080: f7ff ff98 bl 0x207fb4 ; $AI_EnableBit | |
551 208084: 4927 ldr r1, =0xfffe4802 ; via 0x208124 | |
552 208086: 203f mov r0, #63 ; 0x3f | |
553 208088: 0200 lsl r0, r0, #8 | |
554 20808a: 8008 strh r0, [r1, #0] | |
555 20808c: 2001 mov r0, #1 | |
556 20808e: f7ff ffad bl 0x207fec ; $AI_ConfigBitAsOutput | |
557 208092: 2002 mov r0, #2 | |
558 208094: f7ff ffaa bl 0x207fec ; $AI_ConfigBitAsOutput | |
559 208098: 2005 mov r0, #5 | |
560 20809a: f7ff ffa7 bl 0x207fec ; $AI_ConfigBitAsOutput | |
561 20809e: 2003 mov r0, #3 | |
562 2080a0: f7ff ffab bl 0x207ffa ; $AI_ConfigBitAsInput | |
563 2080a4: 2004 mov r0, #4 | |
564 2080a6: f7ff ffa8 bl 0x207ffa ; $AI_ConfigBitAsInput | |
565 2080aa: 2007 mov r0, #7 | |
566 2080ac: f7ff ff9e bl 0x207fec ; $AI_ConfigBitAsOutput | |
567 2080b0: 2008 mov r0, #8 | |
568 2080b2: f7ff ff9b bl 0x207fec ; $AI_ConfigBitAsOutput | |
569 2080b6: 200c mov r0, #12 ; 0xc | |
570 2080b8: f7ff ff98 bl 0x207fec ; $AI_ConfigBitAsOutput | |
571 2080bc: 2008 mov r0, #8 | |
572 2080be: f7ff ff8e bl 0x207fde ; $AI_ResetBit | |
573 2080c2: 200c mov r0, #12 ; 0xc | |
574 2080c4: f7ff ff8b bl 0x207fde ; $AI_ResetBit | |
575 2080c8: 2009 mov r0, #9 | |
576 2080ca: f7ff ff96 bl 0x207ffa ; $AI_ConfigBitAsInput | |
577 2080ce: 200b mov r0, #11 ; 0xb | |
578 2080d0: f7ff ff93 bl 0x207ffa ; $AI_ConfigBitAsInput | |
579 2080d4: 200d mov r0, #13 ; 0xd | |
580 2080d6: f7ff ff90 bl 0x207ffa ; $AI_ConfigBitAsInput | |
581 2080da: 200e mov r0, #14 ; 0xe | |
582 2080dc: f7ff ff86 bl 0x207fec ; $AI_ConfigBitAsOutput | |
583 2080e0: 200f mov r0, #15 ; 0xf | |
584 2080e2: f7ff ff83 bl 0x207fec ; $AI_ConfigBitAsOutput | |
585 2080e6: bd00 pop {pc} | |
586 | |
587 $AI_SelectIOForIT: | |
588 2080e8: 0109 lsl r1, r1, #4 | |
589 2080ea: 1840 add r0, r0, r1 | |
590 2080ec: 0040 lsl r0, r0, #1 | |
591 2080ee: 3001 add r0, #1 | |
592 2080f0: 4913 ldr r1, =0xfffe4814 ; via 0x208140 | |
593 2080f2: 8008 strh r0, [r1, #0] | |
594 2080f4: 4770 bx lr | |
595 | |
596 ; new function added in this J100 version | |
597 2080f6: 4913 ldr r1, =0xfffe481a ; via 0x208144 | |
598 2080f8: 8008 strh r0, [r1, #0] | |
599 2080fa: 4770 bx lr | |
600 | |
601 $AI_CheckITSource: | |
602 2080fc: 2100 mov r1, #0 | |
603 2080fe: 4a12 ldr r2, =0xfffe4816 ; via 0x208148 | |
604 208100: 8812 ldrh r2, [r2, #0] | |
605 208102: 4210 tst r0, r2 | |
606 208104: d000 beq 0x208108 | |
607 208106: 2101 mov r1, #1 | |
608 208108: 1c08 add r0, r1, #0 | |
609 20810a: 4770 bx lr | |
610 | |
611 $AI_UnmaskIT: | |
612 20810c: 4a0f ldr r2, =0xfffe4818 ; via 0x20814c | |
613 20810e: 8811 ldrh r1, [r2, #0] | |
614 208110: 4381 bic r1, r0 | |
615 208112: 8011 strh r1, [r2, #0] | |
616 208114: 4770 bx lr | |
617 | |
618 $AI_MaskIT: | |
619 208116: 4a0d ldr r2, =0xfffe4818 ; via 0x20814c | |
620 208118: 8811 ldrh r1, [r2, #0] | |
621 20811a: 4301 orr r1, r0 | |
622 20811c: 8011 strh r1, [r2, #0] | |
623 20811e: 4770 bx lr | |
624 | |
625 $INC_Initialize: | |
626 212190: b510 push {r4, lr} | |
627 212192: 1c04 add r4, r0, #0 | |
628 212194: 4813 ldr r0, =0x83ac94 ; via 0x2121e4 | |
629 212196: 2101 mov r1, #1 | |
630 212198: 6001 str r1, [r0, #0] | |
631 21219a: f001 f877 bl 0x21328c | |
632 21219e: f001 f879 bl 0x213294 | |
633 2121a2: f001 f839 bl 0x213218 | |
634 2121a6: f000 fba7 bl 0x2128f8 | |
635 2121aa: f7fb f8a9 bl 0x20d300 | |
636 2121ae: f000 fd77 bl 0x212ca0 | |
637 2121b2: f000 fdd5 bl 0x212d60 | |
638 2121b6: f000 fdc3 bl 0x212d40 | |
639 2121ba: f000 fdf1 bl 0x212da0 | |
640 2121be: f000 fdaf bl 0x212d20 | |
641 2121c2: f000 fdfd bl 0x212dc0 | |
642 2121c6: f000 fd8b bl 0x212ce0 | |
643 2121ca: f7fd ff93 bl 0x2100f4 | |
644 2121ce: f000 fdd7 bl 0x212d80 | |
645 2121d2: 1c20 add r0, r4, #0 | |
646 2121d4: f000 fc6c bl 0x212ab0 ; $Application_Initialize | |
647 2121d8: 4902 ldr r1, =0x83ac94 ; via 0x2121e4 | |
648 2121da: 2002 mov r0, #2 | |
649 2121dc: 6008 str r0, [r1, #0] | |
650 2121de: f79e fc77 bl 0x1b0ad0 | |
651 2121e2: bd10 pop {r4, pc} | |
652 | |
653 $Application_Initialize: | |
654 212ab0: b500 push {lr} | |
655 212ab2: f7ed feed bl 0x200890 ; $Init_Target | |
656 212ab6: f7ed ffb3 bl 0x200a20 ; $Init_Drivers | |
657 212aba: f7bb fd7c bl 0x1ce5b6 | |
658 212abe: f72d f931 bl 0x13fd24 | |
659 212ac2: f7bb fd78 bl 0x1ce5b6 | |
660 212ac6: f7ed ffbf bl 0x200a48 ; $Init_Serial_Flows | |
661 212aca: f7a3 fbb2 bl 0x1b6232 | |
662 212ace: f7ed ffc7 bl 0x200a60 ; $Init_Unmask_IT | |
663 212ad2: bd00 pop {pc} | |
664 | |
665 _INC_Initialize: ; call veneer | |
666 21308c: e92d4000 stmdb sp!, {lr} | |
667 213090: e28fe001 add lr, pc, #1 | |
668 213094: e12fff1e bx lr | |
669 213098: f7ff f87a bl 0x212190 ; $INC_Initialize | |
670 21309c: 4778 bx pc | |
671 21309e: 46c0 nop (mov r8, r8) | |
672 2130a0: e8bd8000 ldmia sp!, {pc} |