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