1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
/*
* Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#include <linux/linkage.h>
#define ARM_CTRL_DCACHE 1 << 2
#define ARM_AUXCR_L2EN 1 << 1
/*
* cpu_cortexa8_do_idle()
*
* Idle the processor (eg, wait for interrupt).
*
* IRQs are already disabled.
*/
ENTRY(cpu_cortexa8_do_idle)
mrc p15, 0, r1, c1, c0, 1 @ R1 = auxiliary control reg
ands r2, r1, #ARM_AUXCR_L2EN @ Check if L2 is disabled
beq SkipL2Access
mrc p15, 0, r2, c1, c0, 0 @ R2 = system control reg
bic r2, r2, #ARM_CTRL_DCACHE @ Disable DCache
mcr p15, 0, r2, c1, c0, 0 @ Update system control reg
bic r1, r1, #ARM_AUXCR_L2EN @ Disable L2 cache
mcr p15, 0, r1, c1, c0, 1 @ Update aux control reg
ldr r1, =(0x0 << 6) @ A[6] = 0
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x00] @ Save tag info
ldr r1, =(0x1 << 6) @ A[6] = 1
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x04] @ Save tag info
ldr r1, =(0x0 << 3) @ A[6:3] = b0000
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x08] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x0C] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x10] @ Store data info
ldr r1, =(0x1 << 3) @ A[6:3] = b0001
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x14] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x18] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x1C] @ Store data info
ldr r1, =(0x2 << 3) @ A[6:3] = b0010
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x20] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x24] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x28] @ Store data info
ldr r1, =(0x3 << 3) @ A[6:3] = b0011
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x2C] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x30] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x34] @ Store data info
ldr r1, =(0x4 << 3) @ A[6:3] = b0100
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x38] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x3C] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x40] @ Store data info
ldr r1, =(0x5 << 3) @ A[6:3] = b0101
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x44] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x48] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x4C] @ Store data info
ldr r1, =(0x6 << 3) @ A[6:3] = b0110
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x50] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x54] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x58] @ Store data info
ldr r1, =(0x7 << 3) @ A[6:3] = b0111
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x5C] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x60] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x64] @ Store data info
ldr r1, =(0x8 << 3) @ A[6:3] = b1000
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x68] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x6C] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x70] @ Store data info
ldr r1, =(0x9 << 3) @ A[6:3] = b1001
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x74] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x78] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x7C] @ Store data info
ldr r1, =(0xA << 3) @ A[6:3] = b1010
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x80] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x84] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x88] @ Store data info
ldr r1, =(0xB << 3) @ A[6:3] = b1011
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x8C] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x90] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0x94] @ Store data info
ldr r1, =(0xC << 3) @ A[6:3] = b1100
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0x98] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0x9C] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0xA0] @ Store data info
ldr r1, =(0xD << 3) @ A[6:3] = b1101
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xA4] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0xA8] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0xAC] @ Store data info
ldr r1, =(0xE << 3) @ A[6:3] = b1110
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xB0] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0xB4] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0xB8] @ Store data info
ldr r1, =(0xF << 3) @ A[6:3] = b1111
mcr p15, 0, r1, c15, c9, 3 @ Read L2 Data RAM into L2 data 0-2 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xBC] @ Store data info
mrc p15, 0, r2, c15, c8, 1 @ Move L2 data 1 register to R2
str r2, [r0, #0xC0] @ Store data info
mrc p15, 0, r2, c15, c8, 5 @ Move L2 data 2 register to R2
str r2, [r0, #0xC4] @ Store data info
ldr r1, =(0x2 << 29) | (0x0 << 6) @ WAY = A[31:29] = 2, A[6] = 0
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xC8] @ Save tag info
ldr r1, =(0x2 << 29) | (0x1 << 6) @ WAY = A[31:29] = 2, A[6] = 1
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xCC] @ Save tag info
ldr r1, =(0x4 << 29) | (0x0 << 6) @ WAY = A[31:29] = 4, A[6] = 0
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xD0] @ Save tag info
ldr r1, =(0x4 << 29) | (0x1 << 6) @ WAY = A[31:29] = 4, A[6] = 1
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xD4] @ Save tag info
ldr r1, =(0x6 << 29) | (0x0 << 6) @ WAY = A[31:29] = 6, A[6] = 0
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xD8] @ Save tag info
ldr r1, =(0x6 << 29) | (0x1 << 6) @ WAY = A[31:29] = 6, A[6] = 1
mcr p15, 0, r1, c15, c9, 2 @ Read L2 tag RAM into L2 data 0 register
mrc p15, 0, r2, c15, c8, 0 @ Move L2 data 0 register to R2
str r2, [r0, #0xDC] @ Save tag info
.long 0xe320f003 @ Opcode for WFI
ldr r1, =(0x0 << 6) @ A[6] = 0
ldr r2, [r0, #0x00] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x1 << 6) @ A[6] = 1
ldr r2, [r0, #0x04] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x0 << 3) @ A[6:3] = b0000
ldr r2, [r0, #0x08] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x0C] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x10] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x1 << 3) @ A[6:3] = b0001
ldr r2, [r0, #0x14] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x18] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x1C] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x2 << 3) @ A[6:3] = b0010
ldr r2, [r0, #0x20] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x24] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x28] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x3 << 3) @ A[6:3] = b0011
ldr r2, [r0, #0x2C] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x30] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x34] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x4 << 3) @ A[6:3] = b0100
ldr r2, [r0, #0x38] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x3C] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x40] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x5 << 3) @ A[6:3] = b0101
ldr r2, [r0, #0x44] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x48] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x4C] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x6 << 3) @ A[6:3] = b0110
ldr r2, [r0, #0x50] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x54] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x58] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x7 << 3) @ A[6:3] = b0111
ldr r2, [r0, #0x5C] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x60] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x64] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x8 << 3) @ A[6:3] = b1000
ldr r2, [r0, #0x68] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x6C] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x70] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x9 << 3) @ A[6:3] = b1001
ldr r2, [r0, #0x74] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x78] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x7C] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xA << 3) @ A[6:3] = b1010
ldr r2, [r0, #0x80] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x84] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x88] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xB << 3) @ A[6:3] = b1011
ldr r2, [r0, #0x8C] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x90] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0x94] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xC << 3) @ A[6:3] = b1100
ldr r2, [r0, #0x98] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0x9C] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0xA0] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xD << 3) @ A[6:3] = b1101
ldr r2, [r0, #0xA4] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0xA8] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0xAC] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xE << 3) @ A[6:3] = b1110
ldr r2, [r0, #0xB0] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0xB4] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0xB8] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0xF << 3) @ A[6:3] = b1111
ldr r2, [r0, #0xBC] @ Load data info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
ldr r2, [r0, #0xC0] @ Load data info
mcr p15, 0, r2, c15, c8, 1 @ Move R2 to L2 data 1 register
ldr r2, [r0, #0xC4] @ Load data info
mcr p15, 0, r2, c15, c8, 5 @ Move R2 to L2 data 2 register
mcr p15, 0, r1, c15, c8, 3 @ Write L2 data 0-2 registers to L2 data RAM
ldr r1, =(0x2 << 29) | (0x0 << 6) @ WAY = A[31:29] = 2, A[6] = 0
ldr r2, [r0, #0xC8] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x2 << 29) | (0x1 << 6) @ WAY = A[31:29] = 2, A[6] = 1
ldr r2, [r0, #0xCC] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x4 << 29) | (0x0 << 6) @ WAY = A[31:29] = 4, A[6] = 0
ldr r2, [r0, #0xD0] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x4 << 29) | (0x1 << 6) @ WAY = A[31:29] = 4, A[6] = 1
ldr r2, [r0, #0xD4] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x6 << 29) | (0x0 << 6) @ WAY = A[31:29] = 6, A[6] = 0
ldr r2, [r0, #0xD8] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
ldr r1, =(0x6 << 29) | (0x1 << 6) @ WAY = A[31:29] = 6, A[6] = 1
ldr r2, [r0, #0xDC] @ Load tag info
mcr p15, 0, r2, c15, c8, 0 @ Move R2 to L2 data 0 register
mcr p15, 0, r1, c15, c8, 2 @ Write L2 data 0 register to L2 tag RAM
mrc p15, 0, r1, c1, c0, 1 @ R1 = auxiliary control reg
orr r1, r1, #ARM_AUXCR_L2EN @ Enable L2 cache
mcr p15, 0, r1, c1, c0, 1 @ Update aux control reg
mrc p15, 0, r2, c1, c0, 0 @ R2 = system control reg
orr r2, r2, #ARM_CTRL_DCACHE @ Enable DCache
mcr p15, 0, r2, c1, c0, 0 @ Update system control reg
b Done
SkipL2Access:
.long 0xe320f003 @ Opcode for WFI
Done:
mov pc, lr
.type cortexa8_idle_workaround, #object
ENTRY(cortexa8_idle_workaround)
.word cpu_cortexa8_do_idle
.size cortexa8_idle_workaround, . - cortexa8_idle_workaround
|