1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <common.h>
25#include <ioports.h>
26#include <mpc8260.h>
27#include <pci.h>
28
29
30
31
32
33
34
35
36const iop_conf_t iop_conf_tab[4][32] = {
37
38
39 {
40 { 1, 1, 1, 0, 0, 0 },
41 { 1, 1, 1, 0, 0, 0 },
42 { 1, 1, 1, 1, 0, 0 },
43 { 1, 1, 1, 1, 0, 0 },
44 { 1, 1, 1, 0, 0, 0 },
45 { 1, 1, 1, 0, 0, 0 },
46 { 1, 0, 0, 1, 0, 0 },
47 { 1, 0, 0, 1, 0, 0 },
48 { 1, 0, 0, 1, 0, 0 },
49 { 1, 0, 0, 1, 0, 0 },
50 { 1, 1, 0, 1, 0, 0 },
51 { 1, 1, 0, 1, 0, 0 },
52 { 1, 1, 0, 1, 0, 0 },
53 { 1, 1, 0, 1, 0, 0 },
54 { 1, 1, 0, 0, 0, 0 },
55 { 1, 1, 0, 0, 0, 0 },
56 { 1, 1, 0, 0, 0, 0 },
57 { 1, 1, 0, 0, 0, 0 },
58 { 1, 0, 0, 1, 0, 0 },
59 { 1, 0, 0, 1, 0, 1 },
60 { 1, 0, 0, 1, 0, 0 },
61 { 1, 0, 0, 1, 0, 1 },
62#if 1
63 { 0, 1, 0, 1, 0, 0 },
64 { 0, 1, 0, 0, 0, 0 },
65#else
66 { 1, 1, 0, 1, 0, 0 },
67 { 1, 1, 0, 0, 0, 0 },
68#endif
69 { 0, 0, 0, 0, 0, 0 },
70 { 1, 0, 0, 1, 0, 1 },
71 { 1, 0, 0, 1, 0, 1 },
72 { 1, 0, 0, 1, 0, 0 },
73 { 1, 0, 0, 1, 0, 0 },
74 { 0, 0, 0, 0, 0, 0 },
75 { 1, 0, 0, 0, 0, 0 },
76 { 1, 0, 0, 1, 0, 0 }
77 },
78
79
80 {
81 { 1, 1, 0, 1, 0, 0 },
82 { 1, 1, 0, 0, 0, 0 },
83 { 1, 1, 1, 1, 0, 0 },
84 { 1, 1, 0, 0, 0, 0 },
85 { 1, 1, 0, 0, 0, 0 },
86 { 1, 1, 0, 0, 0, 0 },
87 { 1, 1, 0, 1, 0, 0 },
88 { 1, 1, 0, 1, 0, 0 },
89 { 1, 1, 0, 1, 0, 0 },
90 { 1, 1, 0, 1, 0, 0 },
91 { 1, 1, 0, 0, 0, 0 },
92 { 1, 1, 0, 0, 0, 0 },
93 { 1, 1, 0, 0, 0, 0 },
94 { 1, 1, 0, 0, 0, 0 },
95 { 1, 1, 0, 0, 0, 0 },
96 { 1, 1, 0, 0, 0, 0 },
97 { 1, 1, 0, 1, 0, 0 },
98 { 1, 1, 0, 1, 0, 0 },
99 { 1, 1, 0, 0, 0, 0 },
100 { 1, 1, 0, 0, 0, 0 },
101 { 1, 1, 0, 0, 0, 0 },
102 { 1, 1, 0, 0, 0, 0 },
103 { 1, 1, 0, 0, 0, 0 },
104 { 1, 1, 0, 0, 0, 0 },
105 { 1, 1, 0, 1, 0, 0 },
106 { 1, 1, 0, 1, 0, 0 },
107 { 1, 1, 0, 1, 0, 0 },
108 { 1, 1, 0, 1, 0, 0 },
109 { 0, 0, 0, 0, 0, 0 },
110 { 0, 0, 0, 0, 0, 0 },
111 { 0, 0, 0, 0, 0, 0 },
112 { 0, 0, 0, 0, 0, 0 }
113 },
114
115
116 {
117 { 0, 0, 0, 0, 0, 0 },
118 { 0, 0, 0, 0, 0, 0 },
119 { 1, 0, 0, 0, 0, 0 },
120 { 1, 0, 0, 0, 0, 0 },
121 { 0, 0, 0, 0, 0, 0 },
122 { 0, 0, 0, 0, 0, 0 },
123 { 0, 0, 0, 0, 0, 0 },
124 { 0, 0, 0, 0, 0, 0 },
125 { 0, 0, 0, 0, 0, 0 },
126 { 0, 0, 0, 0, 0, 0 },
127 { 1, 1, 0, 0, 0, 0 },
128 { 1, 1, 0, 0, 0, 0 },
129 { 1, 1, 0, 0, 0, 0 },
130 { 1, 1, 0, 0, 0, 0 },
131 { 1, 1, 0, 0, 0, 0 },
132 { 1, 1, 0, 0, 0, 0 },
133#if 0
134 { 0, 0, 0, 0, 0, 0 },
135#else
136 { 1, 1, 0, 1, 0, 0 },
137#endif
138 { 0, 0, 0, 0, 0, 0 },
139 { 0, 0, 0, 0, 0, 0 },
140 { 0, 0, 0, 0, 0, 0 },
141 { 0, 0, 0, 0, 0, 0 },
142 { 0, 0, 0, 0, 0, 0 },
143 { 0, 0, 0, 0, 0, 0 },
144 { 0, 0, 0, 0, 0, 0 },
145 { 0, 0, 0, 0, 0, 0 },
146 { 0, 0, 0, 0, 0, 0 },
147 { 0, 0, 0, 0, 0, 0 },
148 { 0, 0, 0, 0, 0, 0 },
149 { 0, 0, 0, 0, 0, 0 },
150 { 0, 0, 0, 0, 0, 0 },
151 { 0, 0, 0, 0, 0, 0 },
152 { 0, 0, 0, 0, 0, 0 },
153 },
154
155
156 {
157 { 1, 1, 0, 0, 0, 0 },
158 { 1, 1, 1, 1, 0, 0 },
159 { 1, 0, 0, 1, 0, 0 },
160 { 1, 1, 0, 0, 0, 0 },
161 { 1, 1, 0, 1, 0, 0 },
162 { 1, 0, 0, 1, 0, 0 },
163 { 0, 0, 0, 0, 0, 0 },
164 { 0, 0, 0, 0, 0, 0 },
165 { 0, 0, 0, 0, 0, 0 },
166 { 0, 0, 0, 0, 0, 0 },
167 { 0, 0, 0, 0, 0, 0 },
168 { 0, 0, 0, 0, 0, 0 },
169 { 0, 0, 0, 0, 0, 0 },
170 { 0, 0, 0, 0, 0, 0 },
171 { 0, 0, 0, 0, 0, 0 },
172 { 0, 0, 0, 0, 0, 0 },
173#if defined(CONFIG_SOFT_I2C)
174 { 1, 0, 0, 1, 1, 1 },
175 { 1, 0, 0, 1, 1, 1 },
176#else
177#if defined(CONFIG_HARD_I2C)
178 { 1, 1, 1, 0, 1, 0 },
179 { 1, 1, 1, 0, 1, 0 },
180#else
181 { 1, 1, 1, 0, 1, 0 },
182 { 1, 1, 1, 0, 1, 0 },
183#endif
184#endif
185 { 0, 0, 0, 0, 0, 0 },
186 { 0, 0, 0, 0, 0, 0 },
187 { 0, 0, 0, 0, 0, 0 },
188 { 0, 0, 0, 0, 0, 0 },
189 { 1, 1, 0, 1, 0, 0 },
190 { 1, 1, 0, 0, 0, 0 },
191 { 0, 0, 0, 0, 0, 0 },
192 { 0, 0, 0, 0, 0, 0 },
193 { 0, 0, 0, 0, 0, 0 },
194#if 0
195 { 0, 0, 0, 0, 0, 0 },
196#else
197 { 1, 1, 1, 0, 0, 0 },
198#endif
199 { 0, 0, 0, 0, 0, 0 },
200 { 0, 0, 0, 0, 0, 0 },
201 { 0, 0, 0, 0, 0, 0 },
202 { 0, 0, 0, 0, 0, 0 }
203 }
204};
205
206
207
208
209#define _NOT_USED_ 0xFFFFFFFF
210
211static const uint rtc_table[] =
212{
213
214
215
216 0xfffec00, 0xfffac00, 0xfff2d00, 0xfef2800,
217 0xfaf2080, 0xfaf2080, 0xfff2400, 0x1fff6c05,
218
219
220
221 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
222 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
223 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
224 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
225
226
227
228 0xfffec00, 0xfffac00, 0xfff2d00, 0xfef2800,
229 0xfaf2080, 0xfaf2080, 0xfaf2400, 0x1fbf6c05,
230
231
232
233 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
234 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
235 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
236 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
237
238
239
240 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
241 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
242 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
243
244
245
246 _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
247};
248
249
250
251
252
253int checkboard (void)
254{
255 printf ("Board: ATC\n");
256 return 0;
257}
258
259
260
261
262
263
264
265
266
267
268static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
269 ulong orx, volatile uchar * base)
270{
271 volatile uchar c = 0xff;
272 volatile uint *sdmr_ptr;
273 volatile uint *orx_ptr;
274 ulong maxsize, size;
275 int i;
276
277
278
279
280
281
282 maxsize = (1 + (~orx | 0x7fff)) / 2;
283
284
285
286
287 sdmr_ptr = &memctl->memc_psdmr;
288 orx_ptr = &memctl->memc_or2;
289
290 *orx_ptr = orx;
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312 *sdmr_ptr = sdmr | PSDMR_OP_PREA;
313 *base = c;
314
315 *sdmr_ptr = sdmr | PSDMR_OP_CBRR;
316 for (i = 0; i < 8; i++)
317 *base = c;
318
319 *sdmr_ptr = sdmr | PSDMR_OP_MRW;
320 *(base + CONFIG_SYS_MRS_OFFS) = c;
321
322 *sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
323 *base = c;
324
325 size = get_ram_size((long *)base, maxsize);
326
327 *orx_ptr = orx | ~(size - 1);
328
329 return (size);
330}
331
332int misc_init_r(void)
333{
334 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
335 volatile memctl8260_t *memctl = &immap->im_memctl;
336
337 upmconfig(UPMA, (uint *)rtc_table, sizeof(rtc_table) / sizeof(uint));
338 memctl->memc_mamr = MxMR_RLFx_6X | MxMR_WLFx_6X | MxMR_OP_NORM;
339
340 return (0);
341}
342
343phys_size_t initdram (int board_type)
344{
345 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
346 volatile memctl8260_t *memctl = &immap->im_memctl;
347
348#ifndef CONFIG_SYS_RAMBOOT
349 ulong size8, size9;
350#endif
351 long psize;
352
353 psize = 8 * 1024 * 1024;
354
355 memctl->memc_mptpr = CONFIG_SYS_MPTPR;
356 memctl->memc_psrt = CONFIG_SYS_PSRT;
357
358#ifndef CONFIG_SYS_RAMBOOT
359
360
361 size8 = try_init (memctl, CONFIG_SYS_PSDMR_8COL, CONFIG_SYS_OR2_8COL,
362 (uchar *) CONFIG_SYS_SDRAM_BASE);
363 size9 = try_init (memctl, CONFIG_SYS_PSDMR_9COL, CONFIG_SYS_OR2_9COL,
364 (uchar *) CONFIG_SYS_SDRAM_BASE);
365
366 if (size8 < size9) {
367 psize = size9;
368 printf ("(60x:9COL) ");
369 } else {
370 psize = try_init (memctl, CONFIG_SYS_PSDMR_8COL, CONFIG_SYS_OR2_8COL,
371 (uchar *) CONFIG_SYS_SDRAM_BASE);
372 printf ("(60x:8COL) ");
373 }
374
375#endif
376
377 icache_enable ();
378
379 return (psize);
380}
381
382#if defined(CONFIG_CMD_DOC)
383void doc_init (void)
384{
385 doc_probe (CONFIG_SYS_DOC_BASE);
386}
387#endif
388
389#ifdef CONFIG_PCI
390struct pci_controller hose;
391
392extern void pci_mpc8250_init(struct pci_controller *);
393
394void pci_init_board(void)
395{
396 pci_mpc8250_init(&hose);
397}
398#endif
399