comparison pirelli/preboot.disasm @ 67:88cf9811f97c

started disassembly of Pirelli's boot code
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 09 Feb 2014 09:36:42 +0000
parents
children 6a136554378e
comparison
equal deleted inserted replaced
66:39f2ccd06b57 67:88cf9811f97c
1 0: ea00004b b 0x134
2 4: ea00bffe b 0x30004
3 8: ea00bffe b 0x30008
4 c: ea00bffe b 0x3000c
5 10: ea00bffe b 0x30010
6 14: ea00bffe b 0x30014
7 18: ea00bffe b 0x30018
8 1c: ea00bffe b 0x3001c
9
10 <20-FF: all FFs>
11
12 100: fffffb00
13 104: 02a102a1
14 108: 028302a1
15 10c: 00c000aa
16 110: 002a0040
17 114: fffffd00
18 118: ffff9800
19 11c: fffffb10
20 120: ffffff08
21 124: fffff804
22 128: 20061081
23 12c: 00000800
24 130: 00a000f5
25
26 ; RESET vector branches here
27 134: e51f1024 ldr r1, [pc, #-36] ; 0x118 =0xffff9800
28 138: e15f21b6 ldrh r2, [pc, #-22] ; 0x12a =0x2006
29 13c: e1c120b0 strh r2, [r1]
30 140: e5912000 ldr r2, [r1]
31 144: e2022001 and r2, r2, #1 ; 0x1
32 148: e3520001 cmp r2, #1 ; 0x1
33 14c: 0afffffb beq 0x140
34 150: e51f1044 ldr r1, [pc, #-68] ; 0x114 =0xfffffd00
35 154: e15f23b4 ldrh r2, [pc, #-52] ; 0x128 =0x1081
36 158: e1c120b0 strh r2, [r1]
37 15c: e51f1048 ldr r1, [pc, #-72] ; 0x11c =0xfffffb10
38 160: e15f23bc ldrh r2, [pc, #-60] ; 0x12c =0x0800
39 164: e1d100b0 ldrh r0, [r1]
40 168: e1800002 orr r0, r0, r2
41 16c: e1c100b0 strh r0, [r1] ; DU disable
42 170: e51f1058 ldr r1, [pc, #-88] ; 0x120 =0xffffff08
43 174: e15f24be ldrh r2, [pc, #-78] ; 0x12e =0x0000
44 178: e1c120b0 strh r2, [r1] ; MPU disable
45 17c: e51f1084 ldr r1, [pc, #-132] ; 0x100 =0xfffffb00
46 180: e51f1064 ldr r1, [pc, #-100] ; 0x124 =0xfffff804
47 184: e15f25bc ldrh r2, [pc, #-92] ; 0x130 =0x00f5
48 188: e1c120b0 strh r2, [r1] ; WDOG disable cycle 1
49 18c: e51f1070 ldr r1, [pc, #-112] ; 0x124 =0xfffff804
50 190: e15f26b6 ldrh r2, [pc, #-102] ; 0x132 =0x00a0
51 194: e1c120b0 strh r2, [r1] ; WDOG disable cycle 2
52 198: e15f29bc ldrh r2, [pc, #-156] ; 0x104
53 19c: e1c120b0 strh r2, [r1]
54 1a0: e15f2ab2 ldrh r2, [pc, #-162] ; 0x106
55 1a4: e1c120b2 strh r2, [r1, #2]
56 1a8: e15f2ab8 ldrh r2, [pc, #-168] ; 0x108
57 1ac: e1c120b4 strh r2, [r1, #4]
58 1b0: e15f2abe ldrh r2, [pc, #-174] ; 0x10a
59 1b4: e1c120b6 strh r2, [r1, #6]
60 1b8: e15f2bb4 ldrh r2, [pc, #-180] ; 0x10c
61 1bc: e1c120ba strh r2, [r1, #10]
62 1c0: e15f2bba ldrh r2, [pc, #-186] ; 0x10e
63 1c4: e1c120bc strh r2, [r1, #12]
64 1c8: e15f2cb0 ldrh r2, [pc, #-192] ; 0x110
65 1cc: e1c120b8 strh r2, [r1, #8]
66 1d0: e15f2cb6 ldrh r2, [pc, #-198] ; 0x112
67 1d4: e1c120be strh r2, [r1, #14]
68 1d8: e59f0020 ldr r0, [pc, #32] ; 0x200 =0x81047c
69 1dc: e3a01b01 mov r1, #1024 ; 0x400
70 1e0: e2411004 sub r1, r1, #4 ; 0x4
71 1e4: e0802001 add r2, r0, r1
72 1e8: e3c22003 bic r2, r2, #3 ; 0x3
73 1ec: e1a0d002 mov sp, r2
74 1f0: e92d100f stmdb sp!, {r0, r1, r2, r3, ip}
75 1f4: eb00003b bl 0x2e8
76 1f8: e8bd100f ldmia sp!, {r0, r1, r2, r3, ip}
77 1fc: ea000796 b 0x205c
78
79 200: 0081047c
80
81 ; copy(src, len, dest)
82 204: 2900 cmp r1, #0
83 206: d006 beq 0x216
84 208: 6803 ldr r3, [r0, #0]
85 20a: 6013 str r3, [r2, #0]
86 20c: 3204 add r2, #4
87 20e: 3004 add r0, #4
88 210: 3904 sub r1, #4
89 212: 2900 cmp r1, #0
90 214: d1f8 bne 0x208
91 216: 4770 bx lr
92
93 ; checksumming function: XOR of all 16-bit words in region
94 218: 2200 mov r2, #0
95 21a: 2900 cmp r1, #0
96 21c: d007 beq 0x22e
97 21e: 8803 ldrh r3, [r0, #0]
98 220: 4053 eor r3, r2
99 222: 041a lsl r2, r3, #16
100 224: 0c12 lsr r2, r2, #16
101 226: 3002 add r0, #2
102 228: 3902 sub r1, #2
103 22a: 2900 cmp r1, #0
104 22c: d1f7 bne 0x21e
105 22e: 1c10 mov r0, r2 (add r0, r2, #0)
106 230: 4770 bx lr
107
108 ; 0x232 routine is bzero() with 4-byte alignment required
109 232: 2900 cmp r1, #0
110 234: d005 beq 0x242
111 236: 2200 mov r2, #0
112 238: 6002 str r2, [r0, #0]
113 23a: 3004 add r0, #4
114 23c: 3904 sub r1, #4
115 23e: 2900 cmp r1, #0
116 240: d1fa bne 0x238
117 242: 4770 bx lr
118
119 ; 0xAA88 bytes are copied from 0x2508 to 0x810484
120 244: b5f0 push {r4, r5, r6, r7, lr}
121 246: 4e10 ldr r6, [pc, #64] (0x288) =0x800010
122 248: 2000 mov r0, #0
123 24a: 8030 strh r0, [r6, #0]
124 24c: 4f0f ldr r7, [pc, #60] (0x28c) =0x800012
125 24e: 8038 strh r0, [r7, #0]
126 250: 480f ldr r0, [pc, #60] (0x290) =0x810480
127 252: 4910 ldr r1, [pc, #64] (0x294) =0x81AF0C
128 254: 1a09 sub r1, r1, r0
129 256: 3904 sub r1, #4
130 258: 468c mov ip, r1
131 25a: 2104 mov r1, #4
132 25c: 180c add r4, r1, r0
133 25e: 1c20 mov r0, r4 (add r0, r4, #0)
134 260: 4661 mov r1, ip
135 262: ffe6f7ff bl 0x232 ; bzero()
136 266: 4d0c ldr r5, [pc, #48] (0x298) =0x2508
137 268: 1c28 mov r0, r5 (add r0, r5, #0)
138 26a: 4661 mov r1, ip
139 26c: ffd4f7ff bl 0x218
140 270: 8030 strh r0, [r6, #0]
141 272: 1c28 mov r0, r5 (add r0, r5, #0)
142 274: 4661 mov r1, ip
143 276: 1c22 mov r2, r4 (add r2, r4, #0)
144 278: ffc4f7ff bl 0x204
145 27c: 1c20 mov r0, r4 (add r0, r4, #0)
146 27e: 4661 mov r1, ip
147 280: ffcaf7ff bl 0x218
148 284: 8038 strh r0, [r7, #0]
149 286: bdf0 pop {r4, r5, r6, r7, pc}
150
151 288: 00800010
152 28c: 00800012
153 290: 00810480
154 294: 0081af0c
155 298: 00002508
156
157 29c: b500 push {lr}
158 29e: f82bf000 bl 0x2f8
159 2a2: f802f000 bl 0x2aa
160 2a6: bd00 pop {pc}
161
162 2a8: 4770 bx lr
163
164 2aa: b500 push {lr}
165 2ac: 2003 mov r0, #3
166 2ae: 0400 lsl r0, r0, #16
167 2b0: f820f000 bl 0x2f4
168 2b4: bd00 pop {pc}
169 2b6: 0000
170
171 2b8: e92d4000 stmdb sp!, {lr}
172 2bc: e28fe001 add lr, pc, #1 ; 0x1
173 2c0: e12fff1e bx lr
174 2c4: ffeaf7ff bl 0x29c
175 2c8: 4778 bx pc
176 2ca: 46c0 nop (mov r8, r8)
177 2cc: e8bd8000 ldmia sp!, {pc}
178
179 2d0: e92d4000 stmdb sp!, {lr}
180 2d4: e28fe001 add lr, pc, #1 ; 0x1
181 2d8: e12fff1e bx lr
182 2dc: ffb2f7ff bl 0x244
183 2e0: 4778 bx pc
184 2e2: 46c0 nop (mov r8, r8)
185 2e4: e8bd8000 ldmia sp!, {pc}
186
187 2e8: e59fc000 ldr ip, [pc, #0] ; 0x2f0
188 2ec: e12fff1c bx ip
189 2f0: 000002a9
190
191 2f4: 4700 bx r0
192 2f6: 0000
193
194 2f8: b082 sub sp, #8
195 2fa: 9400 str r4, [sp, #0]
196 2fc: 4c01 ldr r4, [pc, #4] (0x304)
197 2fe: 9401 str r4, [sp, #4]
198 300: bd10 pop {r4, pc}
199 302: 0000
200 304: 00818f2c
201
202 <308-1FFF: all FFs>
203
204 2000: 00000001 ; magic word for the Calypso boot ROM
205
206 2004: ea0000be b 0x2304
207 2008: ea0000c0 b 0x2310
208 200c: ea0000c2 b 0x231c
209 2010: ea0000c4 b 0x2328
210 2014: ea0000c6 b 0x2334
211 2018: ea0000b0 b 0x22e0
212 201c: ea0000b6 b 0x22fc
213
214 2020: 02a102a4
215 2024: 02a402a1
216 2028: 02c0009c
217 202c: 002a0040
218 2030: fffffb00
219 2034: fffef006
220 2038: 00000008
221 203c: fffffd00
222 2040: ffff9800
223 2044: fffffb10
224 2048: ffffff08
225 204c: 20021081
226 2050: f7ff0800
227 2054: 00000000
228 2058: 0001fa00
229
230 ; COME FROM 0x1fc
231 205c: e51f1024 ldr r1, [pc, #-36] ; 0x2040 =0xffff9800
232 2060: e15f21ba ldrh r2, [pc, #-26] ; 0x204e =0x2002
233 2064: e1c120b0 strh r2, [r1]
234 2068: e5912000 ldr r2, [r1]
235 206c: e2022001 and r2, r2, #1 ; 0x1
236 2070: e3520001 cmp r2, #1 ; 0x1
237 2074: 0afffffb beq 0x2068
238 2078: e51f1044 ldr r1, [pc, #-68] ; 0x203c =0xfffffd00
239 207c: e15f23b8 ldrh r2, [pc, #-56] ; 0x204c =0x1081
240 2080: e1c120b0 strh r2, [r1]
241 2084: e51f1048 ldr r1, [pc, #-72] ; 0x2044 =0xfffffb10
242 2088: e15f23be ldrh r2, [pc, #-62] ; 0x2052 =0xf7ff
243 208c: e1d100b0 ldrh r0, [r1]
244 2090: e0000002 and r0, r0, r2
245 2094: e1c100b0 strh r0, [r1] ; enable DU
246 2098: e51f1058 ldr r1, [pc, #-88] ; 0x2048 =0xffffff08
247 209c: e15f25b0 ldrh r2, [pc, #-80] ; 0x2054 =0x0000
248 20a0: e1c120b0 strh r2, [r1]
249 20a4: e51f107c ldr r1, [pc, #-124] ; 0x2030 =0xfffffb00
250 20a8: e15f29b0 ldrh r2, [pc, #-144] ; 0x2020 =0x02a4
251 20ac: e1c120b0 strh r2, [r1]
252 20b0: e15f29b6 ldrh r2, [pc, #-150] ; 0x2022 =0x02a1
253 20b4: e1c120b2 strh r2, [r1, #2]
254 20b8: e15f29bc ldrh r2, [pc, #-156] ; 0x2024 =0x02a1
255 20bc: e1c120b4 strh r2, [r1, #4]
256 20c0: e15f2ab2 ldrh r2, [pc, #-162] ; 0x2026 =0x02a4
257 20c4: e1c120b6 strh r2, [r1, #6]
258 20c8: e15f2ab8 ldrh r2, [pc, #-168] ; 0x2028 =0x009c
259 20cc: e1c120ba strh r2, [r1, #10]
260 20d0: e15f2abe ldrh r2, [pc, #-174] ; 0x202a =0x02c0
261 20d4: e1c120bc strh r2, [r1, #12]
262 20d8: e15f2bb4 ldrh r2, [pc, #-180] ; 0x202c =0x0040
263 20dc: e1c120b8 strh r2, [r1, #8]
264 20e0: e15f2bba ldrh r2, [pc, #-186] ; 0x202e =0x002a
265 20e4: e1c120be strh r2, [r1, #14]
266 20e8: e51f10bc ldr r1, [pc, #-188] ; 0x2034 =0xfffef006
267 20ec: e1d120b0 ldrh r2, [r1]
268 20f0: e51f00c0 ldr r0, [pc, #-192] ; 0x2038 =0x00000008
269 20f4: e1800002 orr r0, r0, r2
270 20f8: e1c100b0 strh r0, [r1] ; enable A22
271 20fc: e10f0000 mrs r0, CPSR
272 2100: e3c0001f bic r0, r0, #31 ; 0x1f
273 2104: e3800013 orr r0, r0, #19 ; 0x13
274 2108: e38000c0 orr r0, r0, #192 ; 0xc0
275 210c: e129f000 msr CPSR_fc, r0 ; SVC, all ints disabled
276 2110: e59f02e0 ldr r0, [pc, #736] ; 0x23f8 =0x800004
277 2114: e3a02000 mov r2, #0 ; 0x0
278 2118: e59f12dc ldr r1, [pc, #732] ; 0x23fc =0x81047c
279 211c: e1500001 cmp r0, r1
280 2120: 0a000000 beq 0x2128
281 2124: e4802004 str r2, [r0], #4
282 2128: e1500001 cmp r0, r1
283 212c: 1afffffc bne 0x2124
284 2130: e59f02c8 ldr r0, [pc, #712] ; 0x2400 =0x800000
285 2134: e3a02000 mov r2, #0 ; 0x0
286 2138: e59f12c4 ldr r1, [pc, #708] ; 0x2404 =0x81047c
287 213c: e1500001 cmp r0, r1
288 2140: 0a000000 beq 0x2148
289 2144: e4802004 str r2, [r0], #4
290 2148: e1500001 cmp r0, r1
291 214c: 1afffffc bne 0x2144
292 2150: e3a00001 mov r0, #1 ; 0x1
293 2154: e59f12b0 ldr r1, [pc, #688] ; 0x240c =0x800004
294 2158: e5810000 str r0, [r1]
295 215c: e59f02a4 ldr r0, [pc, #676] ; 0x2408 =0x81aff8
296 2160: e3a01e46 mov r1, #1120 ; 0x460
297 2164: e2411004 sub r1, r1, #4 ; 0x4
298 2168: e0802001 add r2, r0, r1
299 216c: e1a0a000 mov sl, r0
300 2170: e59f3298 ldr r3, [pc, #664] ; 0x2410 =0x800008
301 2174: e583a000 str sl, [r3]
302 2178: e1a0d002 mov sp, r2
303 217c: e59f3290 ldr r3, [pc, #656] ; 0x2414 =0x80000c
304 2180: e583d000 str sp, [r3]
305 2184: e3a01080 mov r1, #128 ; 0x80
306 2188: e0822001 add r2, r2, r1
307 218c: e10f0000 mrs r0, CPSR
308 2190: e3c0001f bic r0, r0, #31 ; 0x1f
309 2194: e3800012 orr r0, r0, #18 ; 0x12
310 2198: e129f000 msr CPSR_fc, r0 ; IRQ
311 219c: e1a0d002 mov sp, r2
312 21a0: e3a01c02 mov r1, #512 ; 0x200
313 21a4: e0822001 add r2, r2, r1
314 21a8: e10f0000 mrs r0, CPSR
315 21ac: e3c0001f bic r0, r0, #31 ; 0x1f
316 21b0: e3800011 orr r0, r0, #17 ; 0x11
317 21b4: e129f000 msr CPSR_fc, r0 ; FIQ
318 21b8: e1a0d002 mov sp, r2
319 21bc: e10f0000 mrs r0, CPSR
320 21c0: e3c0001f bic r0, r0, #31 ; 0x1f
321 21c4: e3800017 orr r0, r0, #23 ; 0x17
322 21c8: e129f000 msr CPSR_fc, r0 ; Abort
323 21cc: e59fd244 ldr sp, [pc, #580] ; 0x2418 =0x81AF60
324 21d0: e10f0000 mrs r0, CPSR
325 21d4: e3c0001f bic r0, r0, #31 ; 0x1f
326 21d8: e380001b orr r0, r0, #27 ; 0x1b
327 21dc: e129f000 msr CPSR_fc, r0 ; Undef
328 21e0: e59fd230 ldr sp, [pc, #560] ; 0x2418 =0x81AF60
329 21e4: e10f0000 mrs r0, CPSR
330 21e8: e3c0001f bic r0, r0, #31 ; 0x1f
331 21ec: e3800013 orr r0, r0, #19 ; 0x13
332 21f0: e129f000 msr CPSR_fc, r0 ; SVC
333 21f4: e1a04002 mov r4, r2
334 21f8: ebfff834 bl 0x2d0 ; 0x244 via veneer
335 21fc: e1a02004 mov r2, r4
336 2200: e59f1208 ldr r1, [pc, #520] ; 0x2410 =0x800008
337 2204: e5910000 ldr r0, [r1]
338 2208: e3a030fe mov r3, #254 ; 0xfe
339 220c: e5c03000 strb r3, [r0]
340 2210: e5c03001 strb r3, [r0, #1]
341 2214: e5c03002 strb r3, [r0, #2]
342 2218: e5c03003 strb r3, [r0, #3]
343 221c: e4903004 ldr r3, [r0], #4
344 2220: e4803004 str r3, [r0], #4
345 2224: e1500002 cmp r0, r2
346 2228: bafffffc blt 0x2220
347 222c: e51f01dc ldr r0, [pc, #-476] ; 0x2058 =0x1FA00
348 2230: e3700001 cmn r0, #1 ; 0x1
349 2234: 1b000079 blne 0x2420
350 2238: e1a00002 mov r0, r2
351 223c: ebfff81d bl 0x2b8
352
353 <2240-23F7: not yet analyzed>
354
355 23f8: 00800004
356 23fc: 0081047c
357 2400: 00800000
358 2404: 0081047c
359 2408: 0081aff8
360 240c: 00800004
361 2410: 00800008
362 2414: 0080000c
363 2418: 0081af60
364 241c: 0081af60
365
366 ; TI's initialized data function
367 2420: ea00000c b 0x2458
368 2424: e4901004 ldr r1, [r0], #4
369 2428: e3530003 cmp r3, #3 ; 0x3
370 242c: 84904004 ldrhi r4, [r0], #4
371 2430: 84814004 strhi r4, [r1], #4
372 2434: 82433004 subhi r3, r3, #4 ; 0x4
373 2438: 94d04001 ldrlsb r4, [r0], #1
374 243c: 94c14001 strlsb r4, [r1], #1
375 2440: 92433001 subls r3, r3, #1 ; 0x1
376 2444: e3530000 cmp r3, #0 ; 0x0
377 2448: 1afffff6 bne 0x2428
378 244c: e2103003 ands r3, r0, #3 ; 0x3
379 2450: 12633004 rsbne r3, r3, #4 ; 0x4
380 2454: 10800003 addne r0, r0, r3
381 2458: e4903004 ldr r3, [r0], #4
382 245c: e3530000 cmp r3, #0 ; 0x0
383 2460: 1affffef bne 0x2424
384 2464: e1a0f00e mov pc, lr
385
386 <2468-24FF: all FFs>
387
388 2500: 00000000
389 2504: ffffffff
390
391 2508: 0xAA88 bytes copied to IRAM
392 CF8F: last copied byte
393
394 <CF90-1F9FF: all FFs>
395
396 ; initialized data table
397 1fa00: 00000001
398 1fa04: 00810020
399 1fa08: c046c000
400
401 1fa0c: 00000001
402 1fa10: 00810021
403 1fa14: c046c000
404
405 1fa18: 00000004
406 1fa1c: 00810024
407 1fa20: 00000000
408
409 1fa24: 0000000c
410 1fa28: 0081006c
411 1fa2c: 0081a4d0
412 1fa30: 0081a768
413 1fa34: 0081aa00
414
415 1fa38: 00000002
416 1fa3c: 00810014
417 1fa40: 46c00000
418
419 1fa44: 00000002
420 1fa48: 00810016
421 1fa4c: 46c00000
422
423 1fa50: 00000001
424 1fa54: 00810018
425 1fa58: c046c000
426
427 1fa5c: 00000001
428 1fa60: 00810019
429 1fa64: 000000bc
430
431 1fa68: 00000001
432 1fa6c: 00800000
433 1fa70: a0000000
434
435 1fa74: 00000001
436 1fa78: 0081047c
437 1fa7c: 00000000
438
439 1fa80: 00000004
440 1fa84: 00810078
441 1fa88: 00000000
442
443 1fa8c: 00000004
444 1fa90: 0081001c
445 1fa94: 00000000
446 1fa98: 00000000
447
448 <1FA9C-2FFBF: all FFs>
449
450 0002FFC0: 42 43 5F 44 39 31 30 2E 30 2E 31 36 00 00 00 00 BC_D910.0.16....
451 0002FFD0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
452 *