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#include <asm/macro.h>
32#include <asm/arch/mb86r0x.h>
33#include <asm/arch/asm-offsets.h>
34
35
36.globl lowlevel_init
37lowlevel_init:
38
39
40
41
42 ldr r0, =MB86R0x_CRG_BASE
43
44
45WAIT_PLL:
46 ldr r2, [r0,
47 tst r2,
48 beq WAIT_PLL
49
50
51 ldr r1, =CONFIG_SYS_CRG_CRHA_INIT
52 str r1, [r0,
53 ldr r1, =CONFIG_SYS_CRG_CRPA_INIT
54 str r1, [r0,
55 ldr r1, =CONFIG_SYS_CRG_CRPB_INIT
56 str r1, [r0,
57 ldr r1, =CONFIG_SYS_CRG_CRHB_INIT
58 str r1, [r0,
59 ldr r1, =CONFIG_SYS_CRG_CRAM_INIT
60 str r1, [r0,
61
62
63
64
65 ldr r0, =MB86R0x_MEMC_BASE
66
67 ldr r1, =CONFIG_SYS_MEMC_MCFMODE0_INIT
68 str r1, [r0,
69 ldr r1, =CONFIG_SYS_MEMC_MCFMODE2_INIT
70 str r1, [r0,
71 ldr r1, =CONFIG_SYS_MEMC_MCFMODE4_INIT
72 str r1, [r0,
73
74 ldr r1, =CONFIG_SYS_MEMC_MCFTIM0_INIT
75 str r1, [r0,
76 ldr r1, =CONFIG_SYS_MEMC_MCFTIM2_INIT
77 str r1, [r0,
78 ldr r1, =CONFIG_SYS_MEMC_MCFTIM4_INIT
79 str r1, [r0,
80
81 ldr r1, =CONFIG_SYS_MEMC_MCFAREA0_INIT
82 str r1, [r0,
83 ldr r1, =CONFIG_SYS_MEMC_MCFAREA2_INIT
84 str r1, [r0,
85 ldr r1, =CONFIG_SYS_MEMC_MCFAREA4_INIT
86 str r1, [r0,
87
88
89
90
91
92
93 wait_timer 20
94
95
96
97
98 ldr r0, =MB86R0x_DDR2_BASE
99 ldr r1, =CONFIG_SYS_DDR2_DRIMS_INIT
100 strh r1, [r0,
101
102
103
104
105 wait_timer 20
106
107
108
109
110 ldr r0, =MB86R0x_CCNT_BASE
111 ldr r1, =CONFIG_SYS_CCNT_CDCRC_INIT_1
112 str r1, [r0,
113
114
115
116
117 wait_timer 20
118
119
120
121
122 ldr r0, =MB86R0x_CCNT_BASE
123 ldr r1, =CONFIG_SYS_CCNT_CDCRC_INIT_2
124 str r1, [r0,
125
126
127
128
129 wait_timer 33536
130
131
132
133
134 ldr r0, =MB86R0x_DDR2_BASE
135 ldr r1, =CONFIG_SYS_DDR2_DRIC1_INIT
136 strh r1, [r0,
137 ldr r1, =CONFIG_SYS_DDR2_DRIC2_INIT
138 strh r1, [r0,
139 ldr r1, =CONFIG_SYS_DDR2_DRCA_INIT
140 strh r1, [r0,
141 ldr r1, =MB86R0x_DDR2_DRCI_INIT
142 strh r1, [r0,
143
144
145
146
147
148 ldr r1, =MB86R0x_DDR2_DRCI_CMD
149 strh r1, [r0,
150
151 wait_timer 67
152
153 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_1
154 strh r1, [r0,
155 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_1
156 strh r1, [r0,
157 ldr r1, =MB86R0x_DDR2_DRCI_CMD
158 strh r1, [r0,
159
160 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_2
161 strh r1, [r0,
162 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_2
163 strh r1, [r0,
164 ldr r1, =MB86R0x_DDR2_DRCI_CMD
165 strh r1, [r0,
166
167 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_3
168 strh r1, [r0,
169 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_3
170 strh r1, [r0,
171 ldr r1, =MB86R0x_DDR2_DRCI_CMD
172 strh r1, [r0,
173
174 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_4
175 strh r1, [r0,
176 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_4
177 strh r1, [r0,
178 ldr r1, =MB86R0x_DDR2_DRCI_CMD
179 strh r1, [r0,
180
181 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_5
182 strh r1, [r0,
183 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_5
184 strh r1, [r0,
185 ldr r1, =MB86R0x_DDR2_DRCI_CMD
186 strh r1, [r0,
187
188 wait_timer 200
189
190 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_6
191 strh r1, [r0,
192 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_6
193 strh r1, [r0,
194 ldr r1, =MB86R0x_DDR2_DRCI_CMD
195 strh r1, [r0,
196
197 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_7
198 strh r1, [r0,
199 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_7
200 strh r1, [r0,
201 ldr r1, =MB86R0x_DDR2_DRCI_CMD
202 strh r1, [r0,
203
204 wait_timer 18
205
206 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_8
207 strh r1, [r0,
208 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_8
209 strh r1, [r0,
210 ldr r1, =MB86R0x_DDR2_DRCI_CMD
211 strh r1, [r0,
212
213 wait_timer 200
214
215 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_9
216 strh r1, [r0,
217 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_9
218 strh r1, [r0,
219 ldr r1, =MB86R0x_DDR2_DRCI_CMD
220 strh r1, [r0,
221
222 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC1_10
223 strh r1, [r0,
224 ldr r1, =CONFIG_SYS_DDR2_INIT_DRIC2_10
225 strh r1, [r0,
226 ldr r1, =MB86R0x_DDR2_DRCI_CMD
227 strh r1, [r0,
228
229 ldr r1, =CONFIG_SYS_DDR2_DRCM_INIT
230 strh r1, [r0,
231
232 ldr r1, =CONFIG_SYS_DDR2_DRCST1_INIT
233 strh r1, [r0,
234
235 ldr r1, =CONFIG_SYS_DDR2_DRCST2_INIT
236 strh r1, [r0,
237
238 ldr r1, =CONFIG_SYS_DDR2_DRCR_INIT
239 strh r1, [r0,
240
241 ldr r1, =CONFIG_SYS_DDR2_DRCF_INIT
242 strh r1, [r0,
243
244 ldr r1, =CONFIG_SYS_DDR2_DRASR_INIT
245 strh r1, [r0,
246
247
248
249
250 ldr r1, =CONFIG_SYS_DDR2_DROBS_INIT
251 strh r1, [r0,
252 ldr r1, =CONFIG_SYS_DDR2_DROABA_INIT
253 strh r1, [r0,
254 ldr r1, =CONFIG_SYS_DDR2_DRIBSODT1_INIT
255 strh r1, [r0,
256
257
258
259
260 ldr r1, =CONFIG_SYS_DDR2_DROS_INIT
261 strh r1, [r0,
262 ldr r1, =MB86R0x_DDR2_DRCI_NORMAL
263 strh r1, [r0,
264
265 mov pc, lr
266