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#include <config.h>
30#include <version.h>
31
32
33#include <./configs/omap1510.h>
34#endif
35
36#define OMAP1510_CLKS ((1<<EN_XORPCK)|(1<<EN_PERCK)|(1<<EN_TIMCK)|(1<<EN_GPIOCK))
37
38
39_TEXT_BASE:
40 .word TEXT_BASE
41
42.globl lowlevel_init
43lowlevel_init:
44
45
46
47
48 ldr r0, REG_PULL_DWN_CTRL_0
49 ldr r1, VAL_PULL_DWN_CTRL_0
50 str r1, [r0]
51 ldr r0, REG_PULL_DWN_CTRL_1
52 ldr r1, VAL_PULL_DWN_CTRL_1
53 str r1, [r0]
54 ldr r0, REG_PULL_DWN_CTRL_2
55 ldr r1, VAL_PULL_DWN_CTRL_2
56 str r1, [r0]
57 ldr r0, REG_PULL_DWN_CTRL_3
58 ldr r1, VAL_PULL_DWN_CTRL_3
59 str r1, [r0]
60 ldr r0, REG_FUNC_MUX_CTRL_4
61 ldr r1, VAL_FUNC_MUX_CTRL_4
62 str r1, [r0]
63 ldr r0, REG_FUNC_MUX_CTRL_5
64 ldr r1, VAL_FUNC_MUX_CTRL_5
65 str r1, [r0]
66 ldr r0, REG_FUNC_MUX_CTRL_6
67 ldr r1, VAL_FUNC_MUX_CTRL_6
68 str r1, [r0]
69 ldr r0, REG_FUNC_MUX_CTRL_7
70 ldr r1, VAL_FUNC_MUX_CTRL_7
71 str r1, [r0]
72 ldr r0, REG_FUNC_MUX_CTRL_8
73 ldr r1, VAL_FUNC_MUX_CTRL_8
74 str r1, [r0]
75 ldr r0, REG_FUNC_MUX_CTRL_9
76 ldr r1, VAL_FUNC_MUX_CTRL_9
77 str r1, [r0]
78 ldr r0, REG_FUNC_MUX_CTRL_A
79 ldr r1, VAL_FUNC_MUX_CTRL_A
80 str r1, [r0]
81 ldr r0, REG_FUNC_MUX_CTRL_B
82 ldr r1, VAL_FUNC_MUX_CTRL_B
83 str r1, [r0]
84 ldr r0, REG_FUNC_MUX_CTRL_C
85 ldr r1, VAL_FUNC_MUX_CTRL_C
86 str r1, [r0]
87 ldr r0, REG_FUNC_MUX_CTRL_D
88 ldr r1, VAL_FUNC_MUX_CTRL_D
89 str r1, [r0]
90 ldr r0, REG_VOLTAGE_CTRL_0
91 ldr r1, VAL_VOLTAGE_CTRL_0
92 str r1, [r0]
93 ldr r0, REG_TEST_DBG_CTRL_0
94 ldr r1, VAL_TEST_DBG_CTRL_0
95 str r1, [r0]
96 ldr r0, REG_MOD_CONF_CTRL_0
97 ldr r1, VAL_MOD_CONF_CTRL_0
98 str r1, [r0]
99
100
101 ldr r0, REG_COMP_MODE_CTRL_0
102 ldr r1, VAL_COMP_MODE_CTRL_0
103 str r1, [r0]
104
105
106 ldr r0, REG_TC_IMIF_PRIO
107 mov r1,
108 str r1, [r0]
109 ldr r0, REG_TC_EMIFS_PRIO
110 str r1, [r0]
111 ldr r0, REG_TC_EMIFF_PRIO
112 str r1, [r0]
113
114 ldr r0, REG_TC_EMIFS_CONFIG
115 ldr r1, [r0]
116 bic r1, r1,
117 bic r1, r1,
118 str r1, [r0]
119
120
121 ldr r1, =OMAP1510_CLKS
122 ldr r0, REG_ARM_IDLECT2
123 strh r1, [r0]
124
125 mov r1,
126 ldr r0, REG_ARM_RSTCT2
127 strh r1, [r0]
128
129
130
131 mov r1,
132 ldr r0, REG_ARM_SYSST
133 strh r1, [r0]
134 mov r0,
1351:
136 subs r0, r0,
137 bne 1b
138
139 ldr r1, VAL_ARM_CKCTL
140 ldr r0, REG_ARM_CKCTL
141 strh r1, [r0]
142
143
144 ldr r1, VAL_DPLL1_CTL
145 ldr r0, REG_DPLL1_CTL
146 strh r1, [r0]
147 ands r1, r1,
148 beq lock_end
1492:
150 ldrh r1, [r0]
151 ands r1, r1,
152 beq 2b
153lock_end:
154
155
156
157
158
159
160 mov r0,
161 mov r1, pc
162
163
164
165
166 and r1, r1,
167 cmp r1, r0
168 beq skip_sdram
169
170
171
172
173
174
175 mov r3,
1763:
177 subs r3, r3,
178 bne 3b
179
180
181
182
183 ldr r0, VAL_TC_EMIFF_SDRAM_CONFIG
184 bic r3, r0,
185 orr r3, r3,
186 orr r3, r3,
187 ldr r2, REG_TC_EMIFF_SDRAM_CONFIG
188 str r3, [r2]
189
190 ldr r1, VAL_TC_EMIFF_MRS
191 ldr r2, REG_TC_EMIFF_MRS
192 str r1, [r2]
193
194 ldr r2, REG_TC_EMIFF_SDRAM_CONFIG
195 str r0, [r2]
196
197
198
199
200 mov r3,
2014:
202 subs r3, r3,
203 bne 4b
204
205skip_sdram:
206
207
208 ldr r1, VAL_TC_EMIFS_CS0_CONFIG
209 ldr r0, REG_TC_EMIFS_CS0_CONFIG
210 str r1, [r0]
211 ldr r1, VAL_TC_EMIFS_CS1_CONFIG
212 ldr r0, REG_TC_EMIFS_CS1_CONFIG
213 str r1, [r0]
214 ldr r1, VAL_TC_EMIFS_CS2_CONFIG
215 ldr r0, REG_TC_EMIFS_CS2_CONFIG
216 str r1, [r0]
217 ldr r1, VAL_TC_EMIFS_CS3_CONFIG
218 ldr r0, REG_TC_EMIFS_CS3_CONFIG
219 str r1, [r0]
220
221
222
223
224
225
226
227
228
229
230 ldr r0, REG_FPGA_POWER
231 mov r1,
232 ldr r2, REG_FPGA_DIP_SWITCH
233 ldrb r3, [r2]
234 cmp r3,
235 movne r1,
236 strb r1, [r0]
237 ldr r0, REG_FPGA_AUDIO
238 mov r1,
239 strb r1, [r0]
240
241
242 mov pc, lr
243
244
245 .ltorg
246
247
248REG_FUNC_MUX_CTRL_0:
249 .word 0xfffe1000
250REG_FUNC_MUX_CTRL_1:
251 .word 0xfffe1004
252REG_FUNC_MUX_CTRL_2:
253 .word 0xfffe1008
254REG_COMP_MODE_CTRL_0:
255 .word 0xfffe100c
256REG_FUNC_MUX_CTRL_3:
257 .word 0xfffe1010
258REG_FUNC_MUX_CTRL_4:
259 .word 0xfffe1014
260REG_FUNC_MUX_CTRL_5:
261 .word 0xfffe1018
262REG_FUNC_MUX_CTRL_6:
263 .word 0xfffe101c
264REG_FUNC_MUX_CTRL_7:
265 .word 0xfffe1020
266REG_FUNC_MUX_CTRL_8:
267 .word 0xfffe1024
268REG_FUNC_MUX_CTRL_9:
269 .word 0xfffe1028
270REG_FUNC_MUX_CTRL_A:
271 .word 0xfffe102C
272REG_FUNC_MUX_CTRL_B:
273 .word 0xfffe1030
274REG_FUNC_MUX_CTRL_C:
275 .word 0xfffe1034
276REG_FUNC_MUX_CTRL_D:
277 .word 0xfffe1038
278REG_PULL_DWN_CTRL_0:
279 .word 0xfffe1040
280REG_PULL_DWN_CTRL_1:
281 .word 0xfffe1044
282REG_PULL_DWN_CTRL_2:
283 .word 0xfffe1048
284REG_PULL_DWN_CTRL_3:
285 .word 0xfffe104c
286REG_VOLTAGE_CTRL_0:
287 .word 0xfffe1060
288REG_TEST_DBG_CTRL_0:
289 .word 0xfffe1070
290REG_MOD_CONF_CTRL_0:
291 .word 0xfffe1080
292REG_TC_IMIF_PRIO:
293 .word 0xfffecc00
294REG_TC_EMIFS_PRIO:
295 .word 0xfffecc04
296REG_TC_EMIFF_PRIO:
297 .word 0xfffecc08
298REG_TC_EMIFS_CONFIG:
299 .word 0xfffecc0c
300REG_TC_EMIFS_CS0_CONFIG:
301 .word 0xfffecc10
302REG_TC_EMIFS_CS1_CONFIG:
303 .word 0xfffecc14
304REG_TC_EMIFS_CS2_CONFIG:
305 .word 0xfffecc18
306REG_TC_EMIFS_CS3_CONFIG:
307 .word 0xfffecc1c
308REG_TC_EMIFF_SDRAM_CONFIG:
309 .word 0xfffecc20
310REG_TC_EMIFF_MRS:
311 .word 0xfffecc24
312
313REG_ARM_CKCTL:
314 .word 0xfffece00
315REG_ARM_IDLECT2:
316 .word 0xfffece08
317REG_ARM_RSTCT2:
318 .word 0xfffece14
319REG_ARM_SYSST:
320 .word 0xfffece18
321
322REG_DPLL1_CTL:
323 .word 0xfffecf00
324
325REG_IDCODE:
326 .word 0xfffed404
327
328
329REG_FPGA_LED_DIGIT:
330 .word 0x08000003
331REG_FPGA_POWER:
332 .word 0x08000005
333REG_FPGA_AUDIO:
334 .word 0x0800000c
335REG_FPGA_DIP_SWITCH:
336 .word 0x0800000e
337
338VAL_COMP_MODE_CTRL_0:
339 .word 0x0000eaef
340VAL_FUNC_MUX_CTRL_4:
341 .word 0x00000000
342VAL_FUNC_MUX_CTRL_5:
343 .word 0x00000000
344VAL_FUNC_MUX_CTRL_6:
345 .word 0x00000001
346VAL_FUNC_MUX_CTRL_7:
347 .word 0x00000000
348VAL_FUNC_MUX_CTRL_8:
349 .word 0x10001200
350VAL_FUNC_MUX_CTRL_9:
351 .word 0x01201012
352VAL_FUNC_MUX_CTRL_A:
353 .word 0x00000248
354VAL_FUNC_MUX_CTRL_B:
355 .word 0x00000248
356VAL_FUNC_MUX_CTRL_C:
357 .word 0x09000000
358VAL_FUNC_MUX_CTRL_D:
359 .word 0x00000000
360VAL_PULL_DWN_CTRL_0:
361 .word 0x11a10000
362VAL_PULL_DWN_CTRL_1:
363 .word 0x2e047fff
364VAL_PULL_DWN_CTRL_2:
365 .word 0xffd603a6
366VAL_PULL_DWN_CTRL_3:
367 .word 0x00003e03
368VAL_VOLTAGE_CTRL_0:
369 .word 0x00000007
370VAL_TEST_DBG_CTRL_0:
371
372
373
374 .word 0x00000007
375VAL_MOD_CONF_CTRL_0:
376 .word 0x0b000008
377VAL_ARM_CKCTL:
378 .word 0x010f
379VAL_DPLL1_CTL:
380 .word 0x2710
381VAL_TC_EMIFS_CS1_CONFIG_PRELIM:
382 .word 0x00001149
383VAL_TC_EMIFS_CS2_CONFIG_PRELIM:
384 .word 0x00004158
385VAL_TC_EMIFS_CS0_CONFIG:
386 .word 0x002130b0
387VAL_TC_EMIFS_CS1_CONFIG:
388 .word 0x0000f559
389VAL_TC_EMIFS_CS2_CONFIG:
390 .word 0x000055f0
391VAL_TC_EMIFS_CS3_CONFIG:
392 .word 0x00003331
393VAL_TC_EMIFF_SDRAM_CONFIG:
394 .word 0x010290fc
395VAL_TC_EMIFF_MRS:
396 .word 0x00000027
397