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#include <config.h>
37#include <version.h>
38
39
40#include <./configs/omap730.h>
41#endif
42
43_TEXT_BASE:
44 .word TEXT_BASE
45
46.globl lowlevel_init
47lowlevel_init:
48
49 mov r11, lr
50
51
52
53
54 mov r1,
55 ldr r0, =REG_IHL1_MIR
56 str r1, [r0]
57 ldr r0, =REG_IHL2_MIR
58 str r1, [r0]
59
60
61
62
63 ldr r0, REG_ARM_IDLECT1
64 ldr r1, VAL_ARM_IDLECT1
65 str r1, [r0]
66
67
68
69
70 ldr r0, REG_ARM_IDLECT2
71 ldr r1, VAL_ARM_IDLECT2
72 str r1, [r0]
73
74
75
76
77 ldr r0, REG_ARM_IDLECT3
78 ldr r1, VAL_ARM_IDLECT3
79 str r1, [r0]
80
81
82 mov r1,
83 ldr r0, REG_ARM_RSTCT2
84 strh r1, [r0]
85
86
87
88 mov r1,
89 ldr r0, REG_ARM_SYSST
90 strh r1, [r0]
91 mov r0,
921:
93 subs r0, r0,
94 bne 1b
95 ldr r1, VAL_ARM_CKCTL
96 ldr r0, REG_ARM_CKCTL
97 strh r1, [r0]
98
99
100 nop
101 nop
102 nop
103 nop
104 nop
105 nop
106 nop
107 nop
108 nop
109 nop
110
111
112
113 ldr r1, VAL_DPLL1_CTL
114 ldr r0, REG_DPLL1_CTL
115 strh r1, [r0]
116 ands r1, r1,
117 beq lock_end
1182:
119 ldrh r1, [r0]
120 ands r1, r1,
121 beq 2b
122lock_end:
123
124
125
126
127 ldr r0, REG_WATCHDOG
128 ldr r1, WATCHDOG_VAL1
129 str r1, [r0]
130 ldr r1, WATCHDOG_VAL2
131 str r1, [r0]
132 ldr r0, REG_WSPRDOG
133 ldr r1, WSPRDOG_VAL1
134 str r1, [r0]
135 ldr r0, REG_WWPSDOG
136
137watch1Wait:
138 ldr r1, [r0]
139 tst r1,
140 bne watch1Wait
141
142 ldr r0, REG_WSPRDOG
143 ldr r1, WSPRDOG_VAL2
144 str r1, [r0]
145 ldr r0, REG_WWPSDOG
146watch2Wait:
147 ldr r1, [r0]
148 tst r1,
149 bne watch2Wait
150
151
152
153
154
155
156
157 and r0, pc,
158
159 cmp r0,
160
161 bne skip_sdram
162
163
164
165
166 mov r3,
1673:
168 subs r3, r3,
169 bne 3b
170
171 ldr r0, REG_SDRAM_CONFIG
172 ldr r1, SDRAM_CONFIG_VAL
173 str r1, [r0]
174
175 ldr r0, REG_SDRAM_MRS_LEGACY
176 ldr r1, SDRAM_MRS_VAL
177 str r1, [r0]
178
179skip_sdram:
180
181common_tc:
182
183 ldr r1, VAL_TC_EMIFS_CS0_CONFIG
184 ldr r0, REG_TC_EMIFS_CS0_CONFIG
185 str r1, [r0]
186
187 ldr r1, VAL_TC_EMIFS_CS1_CONFIG
188 ldr r0, REG_TC_EMIFS_CS1_CONFIG
189 str r1, [r0]
190 ldr r1, VAL_TC_EMIFS_CS2_CONFIG
191 ldr r0, REG_TC_EMIFS_CS2_CONFIG
192 str r1, [r0]
193 ldr r1, VAL_TC_EMIFS_CS3_CONFIG
194 ldr r0, REG_TC_EMIFS_CS3_CONFIG
195 str r1, [r0]
196
197
198 ldr r1, PERSEUS2_CONFIG_BASE
199 ldrh r0, [r1,
200 orr r0, r0,
201 strh r0, [r1,
202
203
204
205
206
207
208 ldr R0, REG_RHEA_PUB_CTL
209 ldr R1, REG_RHEA_PRIV_CTL
210 ldr R2, VAL_RHEA_CTL
211 strh R2, [R0]
212 strh R2, [R1]
213 mov R3,
214 strh R3, [R0,
215 strh R3, [R1,
216
217
218
219 mrs r4, CPSR
220 bic r4, r4,
221 bic r4, r4,
222 msr CPSR, r4
223
224
225
226 ldr r1, [r0,
227 bic r1, r1,
228 orr r1, r1,
229 str r1, [r0,
230
231
232
233 ldr r0, PERSEUS2_CONFIG_BASE
234 ldr r1, [r0,
235 mov r2,
236 orr r1, r1, r2
237 str r1, [r0,
238
239#ifdef CONFIG_P2_OMAP1610
240
241 ldr r0, REG_TC_EMIFS_CS1_ADVANCED
242 ldr r1, VAL_TC_EMIFS_CS1_ADVANCED
243 str r1, [r0]
244#endif
245
246 ldr r0, REG_MPU_LOAD_TIMER
247 ldr r1, VAL_MPU_LOAD_TIMER
248 str r1, [r0]
249
250 ldr r0, REG_MPU_CNTL_TIMER
251 ldr r1, VAL_MPU_CNTL_TIMER
252 str r1, [r0]
253
254
255 mov pc, r11
256
257
258 .ltorg
259
260REG_TC_EMIFS_CONFIG:
261 .word 0xfffecc0c
262REG_TC_EMIFS_CS0_CONFIG:
263 .word 0xfffecc10
264REG_TC_EMIFS_CS1_CONFIG:
265 .word 0xfffecc14
266REG_TC_EMIFS_CS2_CONFIG:
267 .word 0xfffecc18
268REG_TC_EMIFS_CS3_CONFIG:
269 .word 0xfffecc1c
270
271#ifdef CONFIG_P2_OMAP730
272REG_TC_EMIFS_CS1_ADVANCED:
273 .word 0xfffecc54
274#endif
275
276
277REG_ARM_CKCTL:
278 .word 0xfffece00
279
280REG_ARM_IDLECT3:
281 .word 0xfffece24
282REG_ARM_IDLECT2:
283 .word 0xfffece08
284REG_ARM_IDLECT1:
285 .word 0xfffece04
286
287REG_ARM_RSTCT2:
288 .word 0xfffece14
289REG_ARM_SYSST:
290 .word 0xfffece18
291
292REG_DPLL1_CTL:
293 .word 0xfffecf00
294
295
296
297REG_WSPRDOG:
298 .word 0xfffeb048
299
300REG_WWPSDOG:
301 .word 0xfffeb034
302
303WSPRDOG_VAL1:
304 .word 0x0000aaaa
305WSPRDOG_VAL2:
306 .word 0x00005555
307
308
309
310REG_SDRAM_CONFIG:
311 .word 0xfffecc20
312
313REG_SDRAM_MRS_LEGACY:
314 .word 0xfffecc24
315
316REG_WATCHDOG:
317 .word 0xfffec808
318
319REG_MPU_LOAD_TIMER:
320 .word 0xfffec504
321REG_MPU_CNTL_TIMER:
322 .word 0xfffec500
323
324
325
326REG_RHEA_PUB_CTL:
327 .word 0xFFFECA00
328
329REG_RHEA_PRIV_CTL:
330 .word 0xFFFED300
331
332
333
334
335
336
337
338
339SDRAM_CONFIG_VAL:
340 .word 0x0C017DF4
341
342
343SDRAM_MRS_VAL:
344 .word 0x00000037
345
346VAL_ARM_CKCTL:
347 .word 0x6505
348VAL_DPLL1_CTL:
349 .word 0x3412
350
351#ifdef CONFIG_P2_OMAP730
352VAL_TC_EMIFS_CS0_CONFIG:
353 .word 0x0000FFF3
354VAL_TC_EMIFS_CS1_CONFIG:
355 .word 0x00004278
356VAL_TC_EMIFS_CS2_CONFIG:
357 .word 0x00004278
358VAL_TC_EMIFS_CS3_CONFIG:
359 .word 0x00004278
360VAL_TC_EMIFS_CS1_ADVANCED:
361 .word 0x00000022
362#endif
363
364VAL_ARM_IDLECT1:
365 .word 0x00000400
366VAL_ARM_IDLECT2:
367 .word 0x00000886
368VAL_ARM_IDLECT3:
369 .word 0x00000015
370
371WATCHDOG_VAL1:
372 .word 0x000000f5
373WATCHDOG_VAL2:
374 .word 0x000000a0
375
376VAL_MPU_LOAD_TIMER:
377 .word 0xffffffff
378VAL_MPU_CNTL_TIMER:
379 .word 0xffffffa1
380
381VAL_RHEA_CTL:
382 .word 0xFF22
383
384
385PERSEUS2_CONFIG_BASE:
386 .word 0xFFFE1000
387
388.equ CONFIG_PCC_CONF, 0xB4
389.equ CONFIG_MODE1, 0x10
390.equ CONFIG_MODE2, 0x14
391.equ CONF_MOD_UART1_CLK_MODE_R, 0x0A
392
393
394.equ IRQ_MASK, 0x80
395.equ FIQ_MASK, 0x40
396