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 "cpu87.h"
28#include <pci.h>
29#include <netdev.h>
30
31
32
33
34
35
36
37
38const iop_conf_t iop_conf_tab[4][32] = {
39
40
41 {
42 { 1, 1, 1, 0, 0, 0 },
43 { 1, 1, 1, 0, 0, 0 },
44 { 1, 1, 1, 1, 0, 0 },
45 { 1, 1, 1, 1, 0, 0 },
46 { 1, 1, 1, 0, 0, 0 },
47 { 1, 1, 1, 0, 0, 0 },
48 { 1, 0, 0, 1, 0, 0 },
49 { 1, 0, 0, 1, 0, 0 },
50 { 1, 0, 0, 1, 0, 0 },
51 { 1, 0, 0, 1, 0, 0 },
52 { 1, 1, 0, 1, 0, 0 },
53 { 1, 1, 0, 1, 0, 0 },
54 { 1, 1, 0, 1, 0, 0 },
55 { 1, 1, 0, 1, 0, 0 },
56 { 1, 1, 0, 0, 0, 0 },
57 { 1, 1, 0, 0, 0, 0 },
58 { 1, 1, 0, 0, 0, 0 },
59 { 1, 1, 0, 0, 0, 0 },
60 { 1, 0, 0, 1, 0, 0 },
61 { 1, 0, 0, 1, 0, 1 },
62 { 1, 0, 0, 1, 0, 0 },
63 { 1, 0, 0, 1, 0, 1 },
64 { 0, 1, 0, 1, 0, 0 },
65 { 0, 1, 0, 0, 0, 0 },
66 { 0, 0, 0, 0, 0, 0 },
67 { 1, 0, 0, 1, 0, 1 },
68 { 1, 0, 0, 1, 0, 1 },
69 { 1, 0, 0, 1, 0, 0 },
70 { 1, 0, 0, 1, 0, 0 },
71 { 0, 0, 0, 0, 0, 0 },
72 { 1, 0, 0, 0, 0, 0 },
73 { 1, 0, 0, 1, 0, 0 }
74 },
75
76
77 {
78 { 1, 1, 0, 1, 0, 0 },
79 { 1, 1, 0, 0, 0, 0 },
80 { 1, 1, 1, 1, 0, 0 },
81 { 1, 1, 0, 0, 0, 0 },
82 { 1, 1, 0, 0, 0, 0 },
83 { 1, 1, 0, 0, 0, 0 },
84 { 1, 1, 0, 1, 0, 0 },
85 { 1, 1, 0, 1, 0, 0 },
86 { 1, 1, 0, 1, 0, 0 },
87 { 1, 1, 0, 1, 0, 0 },
88 { 1, 1, 0, 0, 0, 0 },
89 { 1, 1, 0, 0, 0, 0 },
90 { 1, 1, 0, 0, 0, 0 },
91 { 1, 1, 0, 0, 0, 0 },
92 { 0, 0, 0, 0, 0, 0 },
93 { 0, 0, 0, 0, 0, 0 },
94 { 0, 0, 0, 0, 0, 0 },
95 { 0, 0, 0, 0, 0, 0 },
96 { 0, 0, 0, 0, 0, 0 },
97 { 0, 0, 0, 0, 0, 0 },
98 { 0, 0, 0, 0, 0, 0 },
99 { 0, 0, 0, 0, 0, 0 },
100 { 0, 0, 0, 0, 0, 0 },
101 { 0, 0, 0, 0, 0, 0 },
102 { 0, 0, 0, 0, 0, 0 },
103 { 0, 0, 0, 0, 0, 0 },
104 { 0, 0, 0, 0, 0, 0 },
105 { 0, 0, 0, 0, 0, 0 },
106 { 0, 0, 0, 0, 0, 0 },
107 { 0, 0, 0, 0, 0, 0 },
108 { 0, 0, 0, 0, 0, 0 },
109 { 0, 0, 0, 0, 0, 0 }
110 },
111
112
113 {
114 { 0, 0, 0, 0, 0, 0 },
115 { 0, 0, 0, 0, 0, 0 },
116 { 1, 0, 0, 0, 0, 0 },
117 { 1, 0, 0, 0, 0, 0 },
118 { 0, 0, 0, 0, 0, 0 },
119 { 0, 0, 0, 0, 0, 0 },
120 { 0, 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 { 1, 1, 0, 0, 0, 0 },
125 { 1, 1, 0, 0, 0, 0 },
126 { 1, 1, 0, 0, 0, 0 },
127 { 1, 1, 0, 0, 0, 0 },
128 { 0, 0, 0, 0, 0, 0 },
129 { 0, 0, 0, 0, 0, 0 },
130 { 0, 0, 0, 0, 0, 0 },
131 { 0, 0, 0, 0, 0, 0 },
132 { 0, 0, 0, 0, 0, 0 },
133 { 0, 0, 0, 0, 0, 0 },
134 { 0, 0, 0, 0, 0, 0 },
135 { 0, 0, 0, 0, 0, 0 },
136 { 0, 0, 0, 0, 0, 0 },
137 { 0, 0, 0, 0, 0, 0 },
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 },
147
148
149 {
150 { 1, 1, 0, 0, 0, 0 },
151 { 1, 1, 1, 1, 0, 0 },
152 { 1, 0, 0, 1, 0, 0 },
153 { 1, 1, 0, 0, 0, 0 },
154 { 1, 1, 0, 1, 0, 0 },
155 { 1, 0, 0, 1, 0, 0 },
156 { 0, 0, 0, 0, 0, 0 },
157 { 0, 0, 0, 0, 0, 0 },
158 { 0, 0, 0, 0, 0, 0 },
159 { 0, 0, 0, 0, 0, 0 },
160 { 0, 0, 0, 0, 0, 0 },
161 { 0, 0, 0, 0, 0, 0 },
162 { 0, 0, 0, 0, 0, 0 },
163 { 0, 0, 0, 0, 0, 0 },
164 { 0, 0, 0, 0, 0, 0 },
165 { 0, 0, 0, 0, 0, 0 },
166#if defined(CONFIG_SOFT_I2C)
167 { 1, 0, 0, 1, 1, 1 },
168 { 1, 0, 0, 1, 1, 1 },
169#else
170#if defined(CONFIG_HARD_I2C)
171 { 1, 1, 1, 0, 1, 0 },
172 { 1, 1, 1, 0, 1, 0 },
173#else
174 { 1, 1, 1, 0, 1, 0 },
175 { 1, 1, 1, 0, 1, 0 },
176#endif
177#endif
178 { 0, 0, 0, 0, 0, 0 },
179 { 0, 0, 0, 0, 0, 0 },
180 { 0, 0, 0, 0, 0, 0 },
181 { 0, 0, 0, 0, 0, 0 },
182 { 1, 1, 0, 1, 0, 0 },
183 { 1, 1, 0, 0, 0, 0 },
184 { 0, 0, 0, 0, 0, 0 },
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 { 0, 0, 0, 0, 0, 0 },
190 { 0, 0, 0, 0, 0, 0 },
191 { 0, 0, 0, 0, 0, 0 }
192 }
193};
194
195
196
197
198
199int checkboard (void)
200{
201 printf ("Board: CPU87 (Rev %02x)\n", CPU86_REV & 0x7f);
202 return 0;
203}
204
205
206
207
208
209
210
211
212
213
214static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
215 ulong orx, volatile uchar * base)
216{
217 volatile uchar c = 0xff;
218 volatile uint *sdmr_ptr;
219 volatile uint *orx_ptr;
220 ulong maxsize, size;
221 int i;
222
223
224
225
226
227
228 maxsize = (1 + (~orx | 0x7fff)) / 2;
229
230
231
232
233 sdmr_ptr = &memctl->memc_psdmr;
234 orx_ptr = &memctl->memc_or2;
235
236 *orx_ptr = orx;
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258 *sdmr_ptr = sdmr | PSDMR_OP_PREA;
259 *base = c;
260
261 *sdmr_ptr = sdmr | PSDMR_OP_CBRR;
262 for (i = 0; i < 8; i++)
263 *base = c;
264
265 *sdmr_ptr = sdmr | PSDMR_OP_MRW;
266 *(base + CONFIG_SYS_MRS_OFFS) = c;
267
268 *sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN;
269 *base = c;
270
271 size = get_ram_size((long *)base, maxsize);
272
273 *orx_ptr = orx | ~(size - 1);
274
275 return (size);
276}
277
278phys_size_t initdram (int board_type)
279{
280 volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
281 volatile memctl8260_t *memctl = &immap->im_memctl;
282
283#ifndef CONFIG_SYS_RAMBOOT
284 ulong size8, size9, size10;
285#endif
286 long psize;
287
288 psize = 32 * 1024 * 1024;
289
290 memctl->memc_mptpr = CONFIG_SYS_MPTPR;
291 memctl->memc_psrt = CONFIG_SYS_PSRT;
292
293#ifndef CONFIG_SYS_RAMBOOT
294
295
296 size8 = try_init (memctl, CONFIG_SYS_PSDMR_8COL, CONFIG_SYS_OR2_8COL,
297 (uchar *) CONFIG_SYS_SDRAM_BASE);
298
299 size9 = try_init (memctl, CONFIG_SYS_PSDMR_9COL, CONFIG_SYS_OR2_9COL,
300 (uchar *) CONFIG_SYS_SDRAM_BASE);
301
302 size10 = try_init (memctl, CONFIG_SYS_PSDMR_10COL, CONFIG_SYS_OR2_10COL,
303 (uchar *) CONFIG_SYS_SDRAM_BASE);
304
305 psize = max(size8,max(size9,size10));
306
307 if (psize == size8) {
308 psize = try_init (memctl, CONFIG_SYS_PSDMR_8COL, CONFIG_SYS_OR2_8COL,
309 (uchar *) CONFIG_SYS_SDRAM_BASE);
310 printf ("(60x:8COL) ");
311 } else if (psize == size9){
312 psize = try_init (memctl, CONFIG_SYS_PSDMR_9COL, CONFIG_SYS_OR2_9COL,
313 (uchar *) CONFIG_SYS_SDRAM_BASE);
314 printf ("(60x:9COL) ");
315 } else
316 printf ("(60x:10COL) ");
317
318#endif
319
320 icache_enable ();
321
322 return (psize);
323}
324
325#if defined(CONFIG_CMD_DOC)
326void doc_init (void)
327{
328 doc_probe (CONFIG_SYS_DOC_BASE);
329}
330#endif
331
332#ifdef CONFIG_PCI
333struct pci_controller hose;
334
335extern void pci_mpc8250_init(struct pci_controller *);
336
337void pci_init_board(void)
338{
339 pci_mpc8250_init(&hose);
340}
341#endif
342
343int board_eth_init(bd_t *bis)
344{
345 return pci_eth_init(bis);
346}
347