Commit dab0f7626edd5469f6949b826e52f74fcb48b090
Committed by
Tom Rini
1 parent
49f9337956
Exists in
v2017.01-smarct4x
and in
40 other branches
mpc8xx: remove qs850, qs860t board support
These boards are old enough and have no maintainers. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Showing 15 changed files with 3 additions and 3876 deletions Side-by-side Diff
- arch/powerpc/cpu/mpc8xx/scc.c
- board/snmc/qs850/Makefile
- board/snmc/qs850/flash.c
- board/snmc/qs850/qs850.c
- board/snmc/qs850/u-boot.lds
- board/snmc/qs860t/Makefile
- board/snmc/qs860t/flash.c
- board/snmc/qs860t/qs860t.c
- board/snmc/qs860t/u-boot.lds
- boards.cfg
- doc/README.scrapyard
- include/commproc.h
- include/configs/QS823.h
- include/configs/QS850.h
- include/configs/QS860T.h
arch/powerpc/cpu/mpc8xx/scc.c
... | ... | @@ -465,16 +465,6 @@ |
465 | 465 | *((uchar *) BCSR0) |= BCSR0_ETHEN; |
466 | 466 | #endif |
467 | 467 | |
468 | -#if defined(CONFIG_QS860T) | |
469 | - /* | |
470 | - * PB27=FDE-, set output low for full duplex | |
471 | - * PB26=Link Test Enable, normally high output | |
472 | - */ | |
473 | - immr->im_cpm.cp_pbdir |= 0x00000030; | |
474 | - immr->im_cpm.cp_pbdat |= 0x00000020; | |
475 | - immr->im_cpm.cp_pbdat &= ~0x00000010; | |
476 | -#endif /* QS860T */ | |
477 | - | |
478 | 468 | #if defined(CONFIG_NETVIA) |
479 | 469 | #if defined(PA_ENET_PDN) |
480 | 470 | immr->im_ioport.iop_papar &= ~PA_ENET_PDN; |
board/snmc/qs850/Makefile
board/snmc/qs850/flash.c
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2001 | |
6 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
7 | - * | |
8 | - * SPDX-License-Identifier: GPL-2.0+ | |
9 | - */ | |
10 | - | |
11 | -#include <common.h> | |
12 | -#include <asm/ppc4xx.h> | |
13 | -#include <asm/u-boot.h> | |
14 | -#include <asm/processor.h> | |
15 | - | |
16 | -flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ | |
17 | - | |
18 | - | |
19 | -#define FLASH_WORD_SIZE unsigned long | |
20 | -#define FLASH_ID_MASK 0xFFFFFFFF | |
21 | - | |
22 | -/*----------------------------------------------------------------------- | |
23 | - * Functions | |
24 | - */ | |
25 | -/* stolen from esteem192e/flash.c */ | |
26 | -ulong flash_get_size (volatile FLASH_WORD_SIZE *addr, flash_info_t *info); | |
27 | - | |
28 | -static int write_word (flash_info_t *info, ulong dest, ulong data); | |
29 | -static void flash_get_offsets (ulong base, flash_info_t *info); | |
30 | - | |
31 | - | |
32 | -/*----------------------------------------------------------------------- | |
33 | - */ | |
34 | - | |
35 | -unsigned long flash_init (void) | |
36 | -{ | |
37 | - unsigned long size_b0, size_b1; | |
38 | - int i; | |
39 | - uint pbcr; | |
40 | - unsigned long base_b0, base_b1; | |
41 | - volatile FLASH_WORD_SIZE* flash_base; | |
42 | - | |
43 | - /* Init: no FLASHes known */ | |
44 | - for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { | |
45 | - flash_info[i].flash_id = FLASH_UNKNOWN; | |
46 | - } | |
47 | - | |
48 | - /* Static FLASH Bank configuration here */ | |
49 | - /* Test for 8M Flash first */ | |
50 | - debug ("\n## Get flash bank 1 size @ 0x%08x\n",FLASH_BASE0_8M_PRELIM); | |
51 | - flash_base = (volatile FLASH_WORD_SIZE*)(FLASH_BASE0_8M_PRELIM); | |
52 | - size_b0 = flash_get_size(flash_base, &flash_info[0]); | |
53 | - | |
54 | - if (flash_info[0].flash_id == FLASH_UNKNOWN) { | |
55 | - printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n", | |
56 | - size_b0, size_b0<<20); | |
57 | - return 0; | |
58 | - } | |
59 | - | |
60 | - if (size_b0 < 8*1024*1024) { | |
61 | - /* Not quite 8M, try 4M Flash base address */ | |
62 | - debug ("\n## Get flash bank 1 size @ 0x%08x\n",FLASH_BASE0_4M_PRELIM); | |
63 | - flash_base = (volatile FLASH_WORD_SIZE*)(FLASH_BASE0_4M_PRELIM); | |
64 | - size_b0 = flash_get_size(flash_base, &flash_info[0]); | |
65 | - } | |
66 | - | |
67 | - if (flash_info[0].flash_id == FLASH_UNKNOWN) { | |
68 | - printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n", | |
69 | - size_b0, size_b0<<20); | |
70 | - return 0; | |
71 | - } | |
72 | - | |
73 | - /* Only one bank */ | |
74 | - if (CONFIG_SYS_MAX_FLASH_BANKS == 1) { | |
75 | - /* Setup offsets */ | |
76 | - flash_get_offsets ((ulong)flash_base, &flash_info[0]); | |
77 | - | |
78 | - /* Monitor protection ON by default */ | |
79 | - (void)flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE, | |
80 | - CONFIG_SYS_MONITOR_BASE+CONFIG_SYS_MONITOR_LEN-1, &flash_info[0]); | |
81 | - size_b1 = 0 ; | |
82 | - flash_info[0].size = size_b0; | |
83 | - return(size_b0); | |
84 | - } | |
85 | - | |
86 | - /* We have 2 banks */ | |
87 | - size_b1 = flash_get_size(flash_base, &flash_info[1]); | |
88 | - | |
89 | - /* Re-do sizing to get full correct info */ | |
90 | - if (size_b1) { | |
91 | - mtdcr(EBC0_CFGADDR, PB0CR); | |
92 | - pbcr = mfdcr(EBC0_CFGDATA); | |
93 | - mtdcr(EBC0_CFGADDR, PB0CR); | |
94 | - base_b1 = -size_b1; | |
95 | - pbcr = (pbcr & 0x0001ffff) | base_b1 | (((size_b1/1024/1024)-1)<<17); | |
96 | - mtdcr(EBC0_CFGDATA, pbcr); | |
97 | - } | |
98 | - | |
99 | - if (size_b0) { | |
100 | - mtdcr(EBC0_CFGADDR, PB1CR); | |
101 | - pbcr = mfdcr(EBC0_CFGDATA); | |
102 | - mtdcr(EBC0_CFGADDR, PB1CR); | |
103 | - base_b0 = base_b1 - size_b0; | |
104 | - pbcr = (pbcr & 0x0001ffff) | base_b0 | (((size_b0/1024/1024)-1)<<17); | |
105 | - mtdcr(EBC0_CFGDATA, pbcr); | |
106 | - } | |
107 | - | |
108 | - size_b0 = flash_get_size((volatile FLASH_WORD_SIZE *)base_b0, &flash_info[0]); | |
109 | - flash_get_offsets (base_b0, &flash_info[0]); | |
110 | - | |
111 | - /* monitor protection ON by default */ | |
112 | - (void)flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE, | |
113 | - CONFIG_SYS_MONITOR_BASE+CONFIG_SYS_MONITOR_LEN-1, &flash_info[0]); | |
114 | - | |
115 | - if (size_b1) { | |
116 | - /* Re-do sizing to get full correct info */ | |
117 | - size_b1 = flash_get_size((volatile FLASH_WORD_SIZE *)base_b1, &flash_info[1]); | |
118 | - flash_get_offsets (base_b1, &flash_info[1]); | |
119 | - | |
120 | - /* monitor protection ON by default */ | |
121 | - (void)flash_protect(FLAG_PROTECT_SET, base_b1+size_b1-CONFIG_SYS_MONITOR_LEN, | |
122 | - base_b1+size_b1-1, &flash_info[1]); | |
123 | - | |
124 | - /* monitor protection OFF by default (one is enough) */ | |
125 | - (void)flash_protect(FLAG_PROTECT_CLEAR, base_b0+size_b0-CONFIG_SYS_MONITOR_LEN, | |
126 | - base_b0+size_b0-1, &flash_info[0]); | |
127 | - } else { | |
128 | - flash_info[1].flash_id = FLASH_UNKNOWN; | |
129 | - flash_info[1].sector_count = -1; | |
130 | - } | |
131 | - | |
132 | - flash_info[0].size = size_b0; | |
133 | - flash_info[1].size = size_b1; | |
134 | - return (size_b0 + size_b1); | |
135 | -} | |
136 | - | |
137 | - | |
138 | -/*----------------------------------------------------------------------- | |
139 | - This code is specific to the AM29DL163/AM29DL232 for the QS850/QS823. | |
140 | - */ | |
141 | - | |
142 | -static void flash_get_offsets (ulong base, flash_info_t *info) | |
143 | -{ | |
144 | - int i; | |
145 | - long large_sect_size; | |
146 | - long small_sect_size; | |
147 | - | |
148 | - /* set up sector start adress table */ | |
149 | - large_sect_size = info->size / (info->sector_count - 8 + 1); | |
150 | - small_sect_size = large_sect_size / 8; | |
151 | - | |
152 | - if (info->flash_id & FLASH_BTYPE) { | |
153 | - | |
154 | - /* set sector offsets for bottom boot block type */ | |
155 | - for (i = 0; i < 7; i++) { | |
156 | - info->start[i] = base; | |
157 | - base += small_sect_size; | |
158 | - } | |
159 | - | |
160 | - for (; i < info->sector_count; i++) { | |
161 | - info->start[i] = base; | |
162 | - base += large_sect_size; | |
163 | - } | |
164 | - } | |
165 | - else | |
166 | - { | |
167 | - /* set sector offsets for top boot block type */ | |
168 | - for (i = 0; i < (info->sector_count - 8); i++) { | |
169 | - info->start[i] = base; | |
170 | - base += large_sect_size; | |
171 | - } | |
172 | - | |
173 | - for (; i < info->sector_count; i++) { | |
174 | - info->start[i] = base; | |
175 | - base += small_sect_size; | |
176 | - } | |
177 | - } | |
178 | -} | |
179 | - | |
180 | -/*----------------------------------------------------------------------- | |
181 | - */ | |
182 | - | |
183 | -void flash_print_info (flash_info_t *info) | |
184 | -{ | |
185 | - int i; | |
186 | - uchar *boottype; | |
187 | - uchar botboot[]=", bottom boot sect)\n"; | |
188 | - uchar topboot[]=", top boot sector)\n"; | |
189 | - | |
190 | - if (info->flash_id == FLASH_UNKNOWN) { | |
191 | - printf ("missing or unknown FLASH type\n"); | |
192 | - return; | |
193 | - } | |
194 | - | |
195 | - switch (info->flash_id & FLASH_VENDMASK) { | |
196 | - case FLASH_MAN_AMD: | |
197 | - printf ("AMD "); | |
198 | - break; | |
199 | - case FLASH_MAN_FUJ: | |
200 | - printf ("FUJITSU "); | |
201 | - break; | |
202 | - case FLASH_MAN_SST: | |
203 | - printf ("SST "); | |
204 | - break; | |
205 | - case FLASH_MAN_STM: | |
206 | - printf ("STM "); | |
207 | - break; | |
208 | - case FLASH_MAN_INTEL: | |
209 | - printf ("INTEL "); | |
210 | - break; | |
211 | - default: | |
212 | - printf ("Unknown Vendor "); | |
213 | - break; | |
214 | - } | |
215 | - | |
216 | - if (info->flash_id & 0x0001 ) { | |
217 | - boottype = botboot; | |
218 | - } else { | |
219 | - boottype = topboot; | |
220 | - } | |
221 | - | |
222 | - switch (info->flash_id & FLASH_TYPEMASK) { | |
223 | - case FLASH_AM160B: | |
224 | - printf ("AM29LV160B (16 Mbit%s",boottype); | |
225 | - break; | |
226 | - case FLASH_AM160T: | |
227 | - printf ("AM29LV160T (16 Mbit%s",boottype); | |
228 | - break; | |
229 | - case FLASH_AMDL163T: | |
230 | - printf ("AM29DL163T (16 Mbit%s",boottype); | |
231 | - break; | |
232 | - case FLASH_AMDL163B: | |
233 | - printf ("AM29DL163B (16 Mbit%s",boottype); | |
234 | - break; | |
235 | - case FLASH_AM320B: | |
236 | - printf ("AM29LV320B (32 Mbit%s",boottype); | |
237 | - break; | |
238 | - case FLASH_AM320T: | |
239 | - printf ("AM29LV320T (32 Mbit%s",boottype); | |
240 | - break; | |
241 | - case FLASH_AMDL323T: | |
242 | - printf ("AM29DL323T (32 Mbit%s",boottype); | |
243 | - break; | |
244 | - case FLASH_AMDL323B: | |
245 | - printf ("AM29DL323B (32 Mbit%s",boottype); | |
246 | - break; | |
247 | - case FLASH_AMDL322T: | |
248 | - printf ("AM29DL322T (32 Mbit%s",boottype); | |
249 | - break; | |
250 | - default: | |
251 | - printf ("Unknown Chip Type\n"); | |
252 | - break; | |
253 | - } | |
254 | - | |
255 | - printf (" Size: %ld MB in %d Sectors\n", | |
256 | - info->size >> 20, info->sector_count); | |
257 | - | |
258 | - printf (" Sector Start Addresses:"); | |
259 | - for (i=0; i<info->sector_count; ++i) { | |
260 | - if ((i % 5) == 0) | |
261 | - printf ("\n "); | |
262 | - printf (" %08lX%s", info->start[i], | |
263 | - info->protect[i] ? " (RO)" : " "); | |
264 | - } | |
265 | - printf ("\n"); | |
266 | - return; | |
267 | -} | |
268 | - | |
269 | - | |
270 | -/*----------------------------------------------------------------------- | |
271 | - * The following code cannot be run from FLASH! | |
272 | - */ | |
273 | -ulong flash_get_size (volatile FLASH_WORD_SIZE *addr, flash_info_t *info) | |
274 | -{ | |
275 | - short i; | |
276 | - ulong base = (ulong)addr; | |
277 | - FLASH_WORD_SIZE value; | |
278 | - | |
279 | - /* Write auto select command: read Manufacturer ID */ | |
280 | - | |
281 | - /* | |
282 | - * Note: if it is an AMD flash and the word at addr[0000] | |
283 | - * is 0x00890089 this routine will think it is an Intel | |
284 | - * flash device and may(most likely) cause trouble. | |
285 | - */ | |
286 | - | |
287 | - addr[0x0000] = 0x00900090; | |
288 | - if(addr[0x0000] != 0x00890089){ | |
289 | - addr[0x0555] = 0x00AA00AA; | |
290 | - addr[0x02AA] = 0x00550055; | |
291 | - addr[0x0555] = 0x00900090; | |
292 | - } | |
293 | - value = addr[0]; | |
294 | - | |
295 | - switch (value) { | |
296 | - case (AMD_MANUFACT & FLASH_ID_MASK): | |
297 | - info->flash_id = FLASH_MAN_AMD; | |
298 | - break; | |
299 | - case (FUJ_MANUFACT & FLASH_ID_MASK): | |
300 | - info->flash_id = FLASH_MAN_FUJ; | |
301 | - break; | |
302 | - case (STM_MANUFACT & FLASH_ID_MASK): | |
303 | - info->flash_id = FLASH_MAN_STM; | |
304 | - break; | |
305 | - case (SST_MANUFACT & FLASH_ID_MASK): | |
306 | - info->flash_id = FLASH_MAN_SST; | |
307 | - break; | |
308 | - case (INTEL_MANUFACT & FLASH_ID_MASK): | |
309 | - info->flash_id = FLASH_MAN_INTEL; | |
310 | - break; | |
311 | - default: | |
312 | - info->flash_id = FLASH_UNKNOWN; | |
313 | - info->sector_count = 0; | |
314 | - info->size = 0; | |
315 | - return (0); /* no or unknown flash */ | |
316 | - } | |
317 | - | |
318 | - value = addr[1]; /* device ID */ | |
319 | - | |
320 | - switch (value) { | |
321 | - case (AMD_ID_LV160T & FLASH_ID_MASK): | |
322 | - info->flash_id += FLASH_AM160T; | |
323 | - info->sector_count = 35; | |
324 | - info->size = 0x00400000; | |
325 | - break; /* => 4 MB */ | |
326 | - | |
327 | - case (AMD_ID_LV160B & FLASH_ID_MASK): | |
328 | - info->flash_id += FLASH_AM160B; | |
329 | - info->sector_count = 35; | |
330 | - info->size = 0x00400000; | |
331 | - break; /* => 4 MB */ | |
332 | - | |
333 | - case (AMD_ID_DL163T & FLASH_ID_MASK): | |
334 | - info->flash_id += FLASH_AMDL163T; | |
335 | - info->sector_count = 39; | |
336 | - info->size = 0x00400000; | |
337 | - break; /* => 4 MB */ | |
338 | - | |
339 | - case (AMD_ID_DL163B & FLASH_ID_MASK): | |
340 | - info->flash_id += FLASH_AMDL163B; | |
341 | - info->sector_count = 39; | |
342 | - info->size = 0x00400000; | |
343 | - break; /* => 4 MB */ | |
344 | - | |
345 | - case (AMD_ID_DL323T & FLASH_ID_MASK): | |
346 | - info->flash_id += FLASH_AMDL323T; | |
347 | - info->sector_count = 71; | |
348 | - info->size = 0x00800000; | |
349 | - break; /* => 8 MB */ | |
350 | - | |
351 | - case (AMD_ID_DL323B & FLASH_ID_MASK): | |
352 | - info->flash_id += FLASH_AMDL323B; | |
353 | - info->sector_count = 71; | |
354 | - info->size = 0x00800000; | |
355 | - break; /* => 8 MB */ | |
356 | - | |
357 | - case (AMD_ID_DL322T & FLASH_ID_MASK): | |
358 | - info->flash_id += FLASH_AMDL322T; | |
359 | - info->sector_count = 71; | |
360 | - info->size = 0x00800000; | |
361 | - break; /* => 8 MB */ | |
362 | - | |
363 | - default: | |
364 | - /* FIXME*/ | |
365 | - info->flash_id = FLASH_UNKNOWN; | |
366 | - return (0); /* => no or unknown flash */ | |
367 | - } | |
368 | - | |
369 | - flash_get_offsets(base, info); | |
370 | - | |
371 | - /* check for protected sectors */ | |
372 | - for (i = 0; i < info->sector_count; i++) { | |
373 | - /* read sector protection at sector address, (A7 .. A0) = 0x02 */ | |
374 | - /* D0 = 1 if protected */ | |
375 | - addr = (volatile FLASH_WORD_SIZE *)(info->start[i]); | |
376 | - info->protect[i] = addr[2] & 1; | |
377 | - } | |
378 | - | |
379 | - /* | |
380 | - * Prevent writes to uninitialized FLASH. | |
381 | - */ | |
382 | - if (info->flash_id != FLASH_UNKNOWN) { | |
383 | - addr = (volatile FLASH_WORD_SIZE *)info->start[0]; | |
384 | - *addr = (0x00FF00FF & FLASH_ID_MASK); /* reset bank */ | |
385 | - } | |
386 | - | |
387 | - return (info->size); | |
388 | -} | |
389 | - | |
390 | - | |
391 | -/*----------------------------------------------------------------------- | |
392 | - */ | |
393 | - | |
394 | -int flash_erase (flash_info_t *info, int s_first, int s_last) | |
395 | -{ | |
396 | - volatile FLASH_WORD_SIZE *addr=(volatile FLASH_WORD_SIZE*)(info->start[0]); | |
397 | - int flag, prot, sect, l_sect; | |
398 | - ulong start, now, last; | |
399 | - int rcode = 0; | |
400 | - | |
401 | - if ((s_first < 0) || (s_first > s_last)) { | |
402 | - if (info->flash_id == FLASH_UNKNOWN) { | |
403 | - printf ("- missing\n"); | |
404 | - } else { | |
405 | - printf ("- no sectors to erase\n"); | |
406 | - } | |
407 | - return 1; | |
408 | - } | |
409 | - | |
410 | - if ((info->flash_id == FLASH_UNKNOWN) || | |
411 | - (info->flash_id > FLASH_AMD_COMP) ) { | |
412 | - printf ("Can't erase unknown flash type - aborted\n"); | |
413 | - return 1; | |
414 | - } | |
415 | - | |
416 | - prot = 0; | |
417 | - for (sect=s_first; sect<=s_last; ++sect) { | |
418 | - if (info->protect[sect]) { | |
419 | - prot++; | |
420 | - } | |
421 | - } | |
422 | - | |
423 | - if (prot) { | |
424 | - printf ("- Warning: %d protected sectors will not be erased!\n", | |
425 | - prot); | |
426 | - } else { | |
427 | - printf ("\n"); | |
428 | - } | |
429 | - | |
430 | - l_sect = -1; | |
431 | - | |
432 | - /* Disable interrupts which might cause a timeout here */ | |
433 | - flag = disable_interrupts(); | |
434 | - addr[0x0555] = 0x00AA00AA; | |
435 | - addr[0x02AA] = 0x00550055; | |
436 | - addr[0x0555] = 0x00800080; | |
437 | - addr[0x0555] = 0x00AA00AA; | |
438 | - addr[0x02AA] = 0x00550055; | |
439 | - /* Start erase on unprotected sectors */ | |
440 | - for (sect = s_first; sect<=s_last; sect++) { | |
441 | - if (info->protect[sect] == 0) { /* not protected */ | |
442 | - addr = (volatile FLASH_WORD_SIZE *)(info->start[sect]); | |
443 | - addr[0] = (0x00300030 & FLASH_ID_MASK); | |
444 | - l_sect = sect; | |
445 | - } | |
446 | - } | |
447 | - | |
448 | - /* re-enable interrupts if necessary */ | |
449 | - if (flag) | |
450 | - enable_interrupts(); | |
451 | - | |
452 | - /* wait at least 80us - let's wait 1 ms */ | |
453 | - udelay (1000); | |
454 | - | |
455 | - /* | |
456 | - * We wait for the last triggered sector | |
457 | - */ | |
458 | - if (l_sect < 0) | |
459 | - goto DONE; | |
460 | - | |
461 | - start = get_timer (0); | |
462 | - last = start; | |
463 | - addr = (volatile FLASH_WORD_SIZE*)(info->start[l_sect]); | |
464 | - while ((addr[0] & (0x00800080&FLASH_ID_MASK)) != | |
465 | - (0x00800080&FLASH_ID_MASK) ) | |
466 | - { | |
467 | - if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { | |
468 | - printf ("Timeout\n"); | |
469 | - return 1; | |
470 | - } | |
471 | - /* show that we're waiting */ | |
472 | - if ((now - last) > 1000) { /* every second */ | |
473 | - serial_putc ('.'); | |
474 | - last = now; | |
475 | - } | |
476 | - } | |
477 | - | |
478 | -DONE: | |
479 | - /* reset to read mode */ | |
480 | - addr = (volatile FLASH_WORD_SIZE *)info->start[0]; | |
481 | - addr[0] = (0x00F000F0 & FLASH_ID_MASK); /* reset bank */ | |
482 | - | |
483 | - printf (" done\n"); | |
484 | - return rcode; | |
485 | -} | |
486 | - | |
487 | -/*----------------------------------------------------------------------- | |
488 | - * Copy memory to flash, returns: | |
489 | - * 0 - OK | |
490 | - * 1 - write timeout | |
491 | - * 2 - Flash not erased | |
492 | - */ | |
493 | - | |
494 | -int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) | |
495 | -{ | |
496 | - ulong cp, wp, data; | |
497 | - int l; | |
498 | - int i, rc; | |
499 | - | |
500 | - wp = (addr & ~3); /* get lower word aligned address */ | |
501 | - | |
502 | - /* | |
503 | - * handle unaligned start bytes | |
504 | - */ | |
505 | - if ((l = addr - wp) != 0) { | |
506 | - data = 0; | |
507 | - for (i=0, cp=wp; i<l; ++i, ++cp) { | |
508 | - data = (data << 8) | (*(uchar *)cp); | |
509 | - } | |
510 | - for (; i<4 && cnt>0; ++i) { | |
511 | - data = (data << 8) | *src++; | |
512 | - --cnt; | |
513 | - ++cp; | |
514 | - } | |
515 | - for (; cnt==0 && i<4; ++i, ++cp) { | |
516 | - data = (data << 8) | (*(uchar *)cp); | |
517 | - } | |
518 | - | |
519 | - if ((rc = write_word(info, wp, data)) != 0) { | |
520 | - return (rc); | |
521 | - } | |
522 | - wp += 4; | |
523 | - } | |
524 | - | |
525 | - /* | |
526 | - * handle word aligned part | |
527 | - */ | |
528 | - while (cnt >= 4) { | |
529 | - data = 0; | |
530 | - for (i=0; i<4; ++i) { | |
531 | - data = (data << 8) | *src++; | |
532 | - } | |
533 | - if ((rc = write_word(info, wp, data)) != 0) { | |
534 | - return (rc); | |
535 | - } | |
536 | - wp += 4; | |
537 | - cnt -= 4; | |
538 | - } | |
539 | - | |
540 | - if (cnt == 0) { | |
541 | - return (0); | |
542 | - } | |
543 | - | |
544 | - /* | |
545 | - * handle unaligned tail bytes | |
546 | - */ | |
547 | - data = 0; | |
548 | - for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) { | |
549 | - data = (data << 8) | *src++; | |
550 | - --cnt; | |
551 | - } | |
552 | - for (; i<4; ++i, ++cp) { | |
553 | - data = (data << 8) | (*(uchar *)cp); | |
554 | - } | |
555 | - | |
556 | - return (write_word(info, wp, data)); | |
557 | -} | |
558 | - | |
559 | -/*----------------------------------------------------------------------- | |
560 | - * Write a word to Flash, returns: | |
561 | - * 0 - OK | |
562 | - * 1 - write timeout | |
563 | - * 2 - Flash not erased | |
564 | - */ | |
565 | -static int write_word (flash_info_t *info, ulong dest, ulong data) | |
566 | -{ | |
567 | - vu_long *addr = (vu_long*)(info->start[0]); | |
568 | - ulong start; | |
569 | - int flag; | |
570 | - | |
571 | - /* Check if Flash is (sufficiently) erased */ | |
572 | - if ((*((vu_long *)dest) & data) != data) { | |
573 | - return (2); | |
574 | - } | |
575 | - | |
576 | - /* Disable interrupts which might cause a timeout here */ | |
577 | - flag = disable_interrupts(); | |
578 | - | |
579 | - /* AMD stuff */ | |
580 | - addr[0x0555] = 0x00AA00AA; | |
581 | - addr[0x02AA] = 0x00550055; | |
582 | - addr[0x0555] = 0x00A000A0; | |
583 | - | |
584 | - *((vu_long *)dest) = data; | |
585 | - | |
586 | - /* re-enable interrupts if necessary */ | |
587 | - if (flag) | |
588 | - enable_interrupts(); | |
589 | - | |
590 | - /* data polling for D7 */ | |
591 | - start = get_timer(0); | |
592 | - | |
593 | - while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) { | |
594 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | |
595 | - return (1); | |
596 | - } | |
597 | - } | |
598 | - | |
599 | - return (0); | |
600 | -} |
board/snmc/qs850/qs850.c
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2002 | |
6 | - * Simple Network Magic Corporation, dnevil@snmc.com | |
7 | - * | |
8 | - * (C) Copyright 2000 | |
9 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
10 | - * | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -#include <common.h> | |
15 | -#include <asm/u-boot.h> | |
16 | -#include <commproc.h> | |
17 | -#include "mpc8xx.h" | |
18 | - | |
19 | -/* ------------------------------------------------------------------------- */ | |
20 | - | |
21 | -static long int dram_size (long int, long int *, long int); | |
22 | - | |
23 | -/* ------------------------------------------------------------------------- */ | |
24 | - | |
25 | -const uint sdram_table[] = | |
26 | -{ | |
27 | - /* | |
28 | - * Single Read. (Offset 0 in UPMA RAM) | |
29 | - */ | |
30 | - 0x0f07cc04, 0x00adcc04, 0x00a74c00, 0x00bfcc04, | |
31 | - 0x1fffcc05, 0xffffcc05, 0xffffcc05, 0xffffcc05, | |
32 | - /* | |
33 | - * Burst Read. (Offset 8 in UPMA RAM) | |
34 | - */ | |
35 | - 0x0ff7fc04, 0x0ffffc04, 0x00bdfc04, 0x00fffc00, | |
36 | - 0x00fffc00, 0x00fffc00, 0x0ff77c00, 0x1ffffc05, | |
37 | - 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, | |
38 | - 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, | |
39 | - /* | |
40 | - * Single Write. (Offset 18 in UPMA RAM) | |
41 | - */ | |
42 | - 0x0f07cc04, 0x0fafcc00, 0x01ad0c04, 0x1ff74c07, | |
43 | - 0xffffcc05, 0xffffcc05, 0xffffcc05, 0xffffcc05, | |
44 | - /* | |
45 | - * Burst Write. (Offset 20 in UPMA RAM) | |
46 | - */ | |
47 | - 0x0ff7fc04, 0x0ffffc00, 0x00bd7c00, 0x00fffc00, | |
48 | - 0x00fffc00, 0x00fffc00, 0x0ffffc04, 0x0ff77c04, | |
49 | - 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, | |
50 | - 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, 0x1ffffc05, | |
51 | - /* | |
52 | - * Refresh (Offset 30 in UPMA RAM) | |
53 | - */ | |
54 | - 0xffffcc04, 0x1ff5cc84, 0xffffcc04, 0xffffcc04, | |
55 | - 0xffffcc84, 0xffffcc05, 0xffffcc04, 0xffffcc04, | |
56 | - 0xffffcc04, 0xffffcc04, 0xffffcc04, 0xffffcc04, | |
57 | - /* | |
58 | - * Exception. (Offset 3c in UPMA RAM) | |
59 | - */ | |
60 | - 0x1ff74c04, 0xffffcc07, 0xffffaa34, 0x1fb54a37 | |
61 | -}; | |
62 | - | |
63 | -/* ------------------------------------------------------------------------- */ | |
64 | - | |
65 | - | |
66 | -/* | |
67 | - * Check Board Identity: | |
68 | - * | |
69 | - * Test ID string (QS850, QS823, ...) | |
70 | - * | |
71 | - * Always return 1 | |
72 | - */ | |
73 | -#if defined(CONFIG_QS850) | |
74 | -#define BOARD_IDENTITY "QS850" | |
75 | -#elif defined(CONFIG_QS823) | |
76 | -#define BOARD_IDENTITY "QS823" | |
77 | -#else | |
78 | -#define BOARD_IDENTITY "QS???" | |
79 | -#endif | |
80 | - | |
81 | -int checkboard (void) | |
82 | -{ | |
83 | - char *s, *e; | |
84 | - char buf[64]; | |
85 | - int i; | |
86 | - | |
87 | - i = getenv_f("serial#", buf, sizeof(buf)); | |
88 | - s = (i>0) ? buf : NULL; | |
89 | - | |
90 | - if (!s || strncmp(s, BOARD_IDENTITY, 5)) { | |
91 | - puts ("### No HW ID - assuming " BOARD_IDENTITY); | |
92 | - } else { | |
93 | - for (e=s; *e; ++e) { | |
94 | - if (*e == ' ') | |
95 | - break; | |
96 | - } | |
97 | - | |
98 | - for ( ; s<e; ++s) { | |
99 | - putc (*s); | |
100 | - } | |
101 | - } | |
102 | - putc ('\n'); | |
103 | - | |
104 | - return (0); | |
105 | -} | |
106 | - | |
107 | -/* ------------------------------------------------------------------------- */ | |
108 | -/* SDRAM Mode Register Definitions */ | |
109 | - | |
110 | -/* Set SDRAM Burst Length to 4 (010) */ | |
111 | -/* See Motorola MPC850 User Manual, Page 13-14 */ | |
112 | -#define SDRAM_BURST_LENGTH (2) | |
113 | - | |
114 | -/* Set Wrap Type to Sequential (0) */ | |
115 | -/* See Motorola MPC850 User Manual, Page 13-14 */ | |
116 | -#define SDRAM_WRAP_TYPE (0 << 3) | |
117 | - | |
118 | -/* Set /CAS Latentcy to 2 clocks */ | |
119 | -#define SDRAM_CAS_LATENTCY (2 << 4) | |
120 | - | |
121 | -/* The Mode Register value must be shifted left by 2, since it is */ | |
122 | -/* placed on the address bus, and the 2 LSBs are ignored for 32-bit accesses */ | |
123 | -#define SDRAM_MODE_REG ((SDRAM_BURST_LENGTH|SDRAM_WRAP_TYPE|SDRAM_CAS_LATENTCY) << 2) | |
124 | - | |
125 | -#define UPMA_RUN(loops,index) (0x80002000 + (loops<<8) + index) | |
126 | - | |
127 | -/* Please note a value of zero = 16 loops */ | |
128 | -#define REFRESH_INIT_LOOPS (0) | |
129 | - | |
130 | - | |
131 | -phys_size_t initdram (int board_type) | |
132 | -{ | |
133 | - volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; | |
134 | - volatile memctl8xx_t *memctl = &immap->im_memctl; | |
135 | - long int size; | |
136 | - | |
137 | - upmconfig(UPMA, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint)); | |
138 | - | |
139 | - /* | |
140 | - * Prescaler for refresh | |
141 | - */ | |
142 | - memctl->memc_mptpr = CONFIG_SYS_MPTPR; | |
143 | - | |
144 | - /* | |
145 | - * Map controller bank 1 to the SDRAM address | |
146 | - */ | |
147 | - memctl->memc_or1 = CONFIG_SYS_OR1; | |
148 | - memctl->memc_br1 = CONFIG_SYS_BR1; | |
149 | - udelay(1000); | |
150 | - | |
151 | - /* perform SDRAM initialization sequence */ | |
152 | - memctl->memc_mamr = CONFIG_SYS_16M_MAMR; | |
153 | - udelay(100); | |
154 | - | |
155 | - /* Program the SDRAM's Mode Register */ | |
156 | - memctl->memc_mar = SDRAM_MODE_REG; | |
157 | - | |
158 | - /* Run the Prechard Pattern at 0x3C */ | |
159 | - memctl->memc_mcr = UPMA_RUN(1,0x3c); | |
160 | - udelay(1); | |
161 | - | |
162 | - /* Run the Refresh program residing at MAD index 0x30 */ | |
163 | - /* This contains the CBR Refresh command with a loop */ | |
164 | - /* The SDRAM must be refreshed at least 2 times */ | |
165 | - /* Please note a value of zero = 16 loops */ | |
166 | - memctl->memc_mcr = UPMA_RUN(REFRESH_INIT_LOOPS,0x30); | |
167 | - udelay(1); | |
168 | - | |
169 | - /* Run the Exception program residing at MAD index 0x3E */ | |
170 | - /* This contains the Write Mode Register command */ | |
171 | - /* The Write Mode Register command uses the value written to MAR */ | |
172 | - memctl->memc_mcr = UPMA_RUN(1,0x3e); | |
173 | - | |
174 | - udelay (1000); | |
175 | - | |
176 | - /* | |
177 | - * Check for 32M SDRAM Memory Size | |
178 | - */ | |
179 | - size = dram_size(CONFIG_SYS_32M_MAMR|MAMR_PTAE, | |
180 | - (long *)SDRAM_BASE, SDRAM_32M_MAX_SIZE); | |
181 | - udelay (1000); | |
182 | - | |
183 | - /* | |
184 | - * Check for 16M SDRAM Memory Size | |
185 | - */ | |
186 | - if (size != SDRAM_32M_MAX_SIZE) { | |
187 | - size = dram_size(CONFIG_SYS_16M_MAMR|MAMR_PTAE, | |
188 | - (long *)SDRAM_BASE, SDRAM_16M_MAX_SIZE); | |
189 | - udelay (1000); | |
190 | - } | |
191 | - | |
192 | - udelay(10000); | |
193 | - return (size); | |
194 | -} | |
195 | - | |
196 | -/* ------------------------------------------------------------------------- */ | |
197 | - | |
198 | -/* | |
199 | - * Check memory range for valid RAM. A simple memory test determines | |
200 | - * the actually available RAM size between addresses `base' and | |
201 | - * `base + maxsize'. Some (not all) hardware errors are detected: | |
202 | - * - short between address lines | |
203 | - * - short between data lines | |
204 | - */ | |
205 | - | |
206 | -static long int dram_size (long int mamr_value, long int *base, long int maxsize) | |
207 | -{ | |
208 | - volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; | |
209 | - volatile memctl8xx_t *memctl = &immap->im_memctl; | |
210 | - | |
211 | - memctl->memc_mamr = mamr_value; | |
212 | - | |
213 | - return (get_ram_size(base, maxsize)); | |
214 | -} |
board/snmc/qs850/u-boot.lds
1 | -/* | |
2 | - * (C) Copyright 2000-2010 | |
3 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | - * | |
5 | - * SPDX-License-Identifier: GPL-2.0+ | |
6 | - */ | |
7 | - | |
8 | -OUTPUT_ARCH(powerpc) | |
9 | - | |
10 | -SECTIONS | |
11 | -{ | |
12 | - /* Read-only sections, merged into text segment: */ | |
13 | - . = + SIZEOF_HEADERS; | |
14 | - .text : | |
15 | - { | |
16 | - /* WARNING - the following is hand-optimized to fit within */ | |
17 | - /* the sector layout of our flash chips! XXX FIXME XXX */ | |
18 | - | |
19 | - arch/powerpc/cpu/mpc8xx/start.o (.text*) | |
20 | - arch/powerpc/cpu/mpc8xx/traps.o (.text*) | |
21 | - | |
22 | - *(.text*) | |
23 | - } | |
24 | - _etext = .; | |
25 | - PROVIDE (etext = .); | |
26 | - .rodata : | |
27 | - { | |
28 | - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) | |
29 | - } | |
30 | - | |
31 | - /* Read-write section, merged into data segment: */ | |
32 | - . = (. + 0x00FF) & 0xFFFFFF00; | |
33 | - _erotext = .; | |
34 | - PROVIDE (erotext = .); | |
35 | - .reloc : | |
36 | - { | |
37 | - _GOT2_TABLE_ = .; | |
38 | - KEEP(*(.got2)) | |
39 | - KEEP(*(.got)) | |
40 | - PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); | |
41 | - _FIXUP_TABLE_ = .; | |
42 | - KEEP(*(.fixup)) | |
43 | - } | |
44 | - __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; | |
45 | - __fixup_entries = (. - _FIXUP_TABLE_)>>2; | |
46 | - | |
47 | - .data : | |
48 | - { | |
49 | - *(.data*) | |
50 | - *(.sdata*) | |
51 | - } | |
52 | - _edata = .; | |
53 | - PROVIDE (edata = .); | |
54 | - | |
55 | - . = .; | |
56 | - | |
57 | - . = ALIGN(4); | |
58 | - .u_boot_list : { | |
59 | - KEEP(*(SORT(.u_boot_list*))); | |
60 | - } | |
61 | - | |
62 | - | |
63 | - . = .; | |
64 | - __start___ex_table = .; | |
65 | - __ex_table : { *(__ex_table) } | |
66 | - __stop___ex_table = .; | |
67 | - | |
68 | - . = ALIGN(256); | |
69 | - __init_begin = .; | |
70 | - .text.init : { *(.text.init) } | |
71 | - .data.init : { *(.data.init) } | |
72 | - . = ALIGN(256); | |
73 | - __init_end = .; | |
74 | - | |
75 | - __bss_start = .; | |
76 | - .bss (NOLOAD) : | |
77 | - { | |
78 | - *(.bss*) | |
79 | - *(.sbss*) | |
80 | - *(COMMON) | |
81 | - . = ALIGN(4); | |
82 | - } | |
83 | - __bss_end = . ; | |
84 | - PROVIDE (end = .); | |
85 | -} |
board/snmc/qs860t/Makefile
board/snmc/qs860t/flash.c
Changes suppressed. Click to show
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2001 | |
6 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
7 | - * | |
8 | - * SPDX-License-Identifier: GPL-2.0+ | |
9 | - */ | |
10 | - | |
11 | -#include <common.h> | |
12 | -#include <asm/ppc4xx.h> | |
13 | -#include <asm/u-boot.h> | |
14 | -#include <asm/processor.h> | |
15 | - | |
16 | -flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ | |
17 | - | |
18 | - | |
19 | -#ifdef CONFIG_SYS_FLASH_16BIT | |
20 | -#define FLASH_WORD_SIZE unsigned short | |
21 | -#define FLASH_ID_MASK 0xFFFF | |
22 | -#else | |
23 | -#define FLASH_WORD_SIZE unsigned long | |
24 | -#define FLASH_ID_MASK 0xFFFFFFFF | |
25 | -#endif | |
26 | - | |
27 | -/*----------------------------------------------------------------------- | |
28 | - * Functions | |
29 | - */ | |
30 | -/* stolen from esteem192e/flash.c */ | |
31 | -ulong flash_get_size (volatile FLASH_WORD_SIZE *addr, flash_info_t *info); | |
32 | - | |
33 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
34 | -static int write_word (flash_info_t *info, ulong dest, ulong data); | |
35 | -#else | |
36 | -static int write_short (flash_info_t *info, ulong dest, ushort data); | |
37 | -#endif | |
38 | -static void flash_get_offsets (ulong base, flash_info_t *info); | |
39 | - | |
40 | - | |
41 | -/*----------------------------------------------------------------------- | |
42 | - */ | |
43 | - | |
44 | -unsigned long flash_init (void) | |
45 | -{ | |
46 | - unsigned long size_b0, size_b1; | |
47 | - int i; | |
48 | - uint pbcr; | |
49 | - unsigned long base_b0, base_b1; | |
50 | - | |
51 | - /* Init: no FLASHes known */ | |
52 | - for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { | |
53 | - flash_info[i].flash_id = FLASH_UNKNOWN; | |
54 | - } | |
55 | - | |
56 | - /* Static FLASH Bank configuration here - FIXME XXX */ | |
57 | - | |
58 | - size_b0 = flash_get_size((volatile FLASH_WORD_SIZE *)FLASH_BASE1_PRELIM, &flash_info[0]); | |
59 | - | |
60 | - if (flash_info[0].flash_id == FLASH_UNKNOWN) { | |
61 | - printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n", | |
62 | - size_b0, size_b0<<20); | |
63 | - } | |
64 | - | |
65 | - /* Only one bank */ | |
66 | - if (CONFIG_SYS_MAX_FLASH_BANKS == 1) { | |
67 | - /* Setup offsets */ | |
68 | - flash_get_offsets (FLASH_BASE1_PRELIM, &flash_info[0]); | |
69 | - | |
70 | - /* Monitor protection ON by default */ | |
71 | -#if 0 /* sand: */ | |
72 | - (void)flash_protect(FLAG_PROTECT_SET, | |
73 | - FLASH_BASE1_PRELIM-CONFIG_SYS_MONITOR_LEN+size_b0, | |
74 | - FLASH_BASE1_PRELIM-1+size_b0, | |
75 | - &flash_info[0]); | |
76 | -#else | |
77 | - (void)flash_protect(FLAG_PROTECT_SET, | |
78 | - CONFIG_SYS_MONITOR_BASE, | |
79 | - CONFIG_SYS_MONITOR_BASE+CONFIG_SYS_MONITOR_LEN-1, | |
80 | - &flash_info[0]); | |
81 | -#endif | |
82 | - size_b1 = 0 ; | |
83 | - flash_info[0].size = size_b0; | |
84 | - } else { /* 2 banks */ | |
85 | - size_b1 = flash_get_size((volatile FLASH_WORD_SIZE *)FLASH_BASE1_PRELIM, &flash_info[1]); | |
86 | - | |
87 | - /* Re-do sizing to get full correct info */ | |
88 | - if (size_b1) { | |
89 | - mtdcr(EBC0_CFGADDR, PB0CR); | |
90 | - pbcr = mfdcr(EBC0_CFGDATA); | |
91 | - mtdcr(EBC0_CFGADDR, PB0CR); | |
92 | - base_b1 = -size_b1; | |
93 | - pbcr = (pbcr & 0x0001ffff) | base_b1 | (((size_b1/1024/1024)-1)<<17); | |
94 | - mtdcr(EBC0_CFGDATA, pbcr); | |
95 | - } | |
96 | - | |
97 | - if (size_b0) { | |
98 | - mtdcr(EBC0_CFGADDR, PB1CR); | |
99 | - pbcr = mfdcr(EBC0_CFGDATA); | |
100 | - mtdcr(EBC0_CFGADDR, PB1CR); | |
101 | - base_b0 = base_b1 - size_b0; | |
102 | - pbcr = (pbcr & 0x0001ffff) | base_b0 | (((size_b0/1024/1024)-1)<<17); | |
103 | - mtdcr(EBC0_CFGDATA, pbcr); | |
104 | - } | |
105 | - | |
106 | - size_b0 = flash_get_size((volatile FLASH_WORD_SIZE *)base_b0, &flash_info[0]); | |
107 | - | |
108 | - flash_get_offsets (base_b0, &flash_info[0]); | |
109 | - | |
110 | - /* monitor protection ON by default */ | |
111 | -#if 0 /* sand: */ | |
112 | - (void)flash_protect(FLAG_PROTECT_SET, | |
113 | - FLASH_BASE1_PRELIM-CONFIG_SYS_MONITOR_LEN+size_b0, | |
114 | - FLASH_BASE1_PRELIM-1+size_b0, | |
115 | - &flash_info[0]); | |
116 | -#else | |
117 | - (void)flash_protect(FLAG_PROTECT_SET, | |
118 | - CONFIG_SYS_MONITOR_BASE, | |
119 | - CONFIG_SYS_MONITOR_BASE+CONFIG_SYS_MONITOR_LEN-1, | |
120 | - &flash_info[0]); | |
121 | -#endif | |
122 | - | |
123 | - if (size_b1) { | |
124 | - /* Re-do sizing to get full correct info */ | |
125 | - size_b1 = flash_get_size((volatile FLASH_WORD_SIZE *)base_b1, &flash_info[1]); | |
126 | - | |
127 | - flash_get_offsets (base_b1, &flash_info[1]); | |
128 | - | |
129 | - /* monitor protection ON by default */ | |
130 | - (void)flash_protect(FLAG_PROTECT_SET, | |
131 | - base_b1+size_b1-CONFIG_SYS_MONITOR_LEN, | |
132 | - base_b1+size_b1-1, | |
133 | - &flash_info[1]); | |
134 | - /* monitor protection OFF by default (one is enough) */ | |
135 | - (void)flash_protect(FLAG_PROTECT_CLEAR, | |
136 | - base_b0+size_b0-CONFIG_SYS_MONITOR_LEN, | |
137 | - base_b0+size_b0-1, | |
138 | - &flash_info[0]); | |
139 | - } else { | |
140 | - flash_info[1].flash_id = FLASH_UNKNOWN; | |
141 | - flash_info[1].sector_count = -1; | |
142 | - } | |
143 | - | |
144 | - flash_info[0].size = size_b0; | |
145 | - flash_info[1].size = size_b1; | |
146 | - }/* else 2 banks */ | |
147 | - return (size_b0 + size_b1); | |
148 | -} | |
149 | - | |
150 | - | |
151 | -/*----------------------------------------------------------------------- | |
152 | - */ | |
153 | - | |
154 | -static void flash_get_offsets (ulong base, flash_info_t *info) | |
155 | -{ | |
156 | - int i; | |
157 | - | |
158 | - /* set up sector start adress table */ | |
159 | - if ((info->flash_id & FLASH_TYPEMASK) == INTEL_ID_28F320J3A || | |
160 | - (info->flash_id & FLASH_TYPEMASK) == INTEL_ID_28F640J3A || | |
161 | - (info->flash_id & FLASH_TYPEMASK) == INTEL_ID_28F128J3A) { | |
162 | - for (i = 0; i < info->sector_count; i++) { | |
163 | - info->start[i] = base + (i * info->size/info->sector_count); | |
164 | - } | |
165 | - } | |
166 | - else if (info->flash_id & FLASH_BTYPE) { | |
167 | - if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { | |
168 | - | |
169 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
170 | - /* set sector offsets for bottom boot block type */ | |
171 | - info->start[0] = base + 0x00000000; | |
172 | - info->start[1] = base + 0x00004000; | |
173 | - info->start[2] = base + 0x00008000; | |
174 | - info->start[3] = base + 0x0000C000; | |
175 | - info->start[4] = base + 0x00010000; | |
176 | - info->start[5] = base + 0x00014000; | |
177 | - info->start[6] = base + 0x00018000; | |
178 | - info->start[7] = base + 0x0001C000; | |
179 | - for (i = 8; i < info->sector_count; i++) { | |
180 | - info->start[i] = base + (i * 0x00020000) - 0x000E0000; | |
181 | - } | |
182 | - } else { | |
183 | - /* set sector offsets for bottom boot block type */ | |
184 | - info->start[0] = base + 0x00000000; | |
185 | - info->start[1] = base + 0x00008000; | |
186 | - info->start[2] = base + 0x0000C000; | |
187 | - info->start[3] = base + 0x00010000; | |
188 | - for (i = 4; i < info->sector_count; i++) { | |
189 | - info->start[i] = base + (i * 0x00020000) - 0x00060000; | |
190 | - } | |
191 | - } | |
192 | -#else | |
193 | - /* set sector offsets for bottom boot block type */ | |
194 | - info->start[0] = base + 0x00000000; | |
195 | - info->start[1] = base + 0x00002000; | |
196 | - info->start[2] = base + 0x00004000; | |
197 | - info->start[3] = base + 0x00006000; | |
198 | - info->start[4] = base + 0x00008000; | |
199 | - info->start[5] = base + 0x0000A000; | |
200 | - info->start[6] = base + 0x0000C000; | |
201 | - info->start[7] = base + 0x0000E000; | |
202 | - for (i = 8; i < info->sector_count; i++) { | |
203 | - info->start[i] = base + (i * 0x00010000) - 0x00070000; | |
204 | - } | |
205 | - } else { | |
206 | - /* set sector offsets for bottom boot block type */ | |
207 | - info->start[0] = base + 0x00000000; | |
208 | - info->start[1] = base + 0x00004000; | |
209 | - info->start[2] = base + 0x00006000; | |
210 | - info->start[3] = base + 0x00008000; | |
211 | - for (i = 4; i < info->sector_count; i++) { | |
212 | - info->start[i] = base + (i * 0x00010000) - 0x00030000; | |
213 | - } | |
214 | - } | |
215 | -#endif | |
216 | - } else { | |
217 | - /* set sector offsets for top boot block type */ | |
218 | - i = info->sector_count - 1; | |
219 | - if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { | |
220 | - | |
221 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
222 | - info->start[i--] = base + info->size - 0x00004000; | |
223 | - info->start[i--] = base + info->size - 0x00008000; | |
224 | - info->start[i--] = base + info->size - 0x0000C000; | |
225 | - info->start[i--] = base + info->size - 0x00010000; | |
226 | - info->start[i--] = base + info->size - 0x00014000; | |
227 | - info->start[i--] = base + info->size - 0x00018000; | |
228 | - info->start[i--] = base + info->size - 0x0001C000; | |
229 | - for (; i >= 0; i--) { | |
230 | - info->start[i] = base + i * 0x00020000; | |
231 | - } | |
232 | - } else { | |
233 | - | |
234 | - info->start[i--] = base + info->size - 0x00008000; | |
235 | - info->start[i--] = base + info->size - 0x0000C000; | |
236 | - info->start[i--] = base + info->size - 0x00010000; | |
237 | - for (; i >= 0; i--) { | |
238 | - info->start[i] = base + i * 0x00020000; | |
239 | - } | |
240 | - } | |
241 | -#else | |
242 | - info->start[i--] = base + info->size - 0x00002000; | |
243 | - info->start[i--] = base + info->size - 0x00004000; | |
244 | - info->start[i--] = base + info->size - 0x00006000; | |
245 | - info->start[i--] = base + info->size - 0x00008000; | |
246 | - info->start[i--] = base + info->size - 0x0000A000; | |
247 | - info->start[i--] = base + info->size - 0x0000C000; | |
248 | - info->start[i--] = base + info->size - 0x0000E000; | |
249 | - for (; i >= 0; i--) { | |
250 | - info->start[i] = base + i * 0x00010000; | |
251 | - } | |
252 | - } else { | |
253 | - info->start[i--] = base + info->size - 0x00004000; | |
254 | - info->start[i--] = base + info->size - 0x00006000; | |
255 | - info->start[i--] = base + info->size - 0x00008000; | |
256 | - for (; i >= 0; i--) { | |
257 | - info->start[i] = base + i * 0x00010000; | |
258 | - } | |
259 | - } | |
260 | -#endif | |
261 | - } | |
262 | -} | |
263 | - | |
264 | -/*----------------------------------------------------------------------- | |
265 | - */ | |
266 | - | |
267 | -void flash_print_info (flash_info_t *info) | |
268 | -{ | |
269 | - int i; | |
270 | - uchar *boottype; | |
271 | - uchar botboot[]=", bottom boot sect)\n"; | |
272 | - uchar topboot[]=", top boot sector)\n"; | |
273 | - | |
274 | - if (info->flash_id == FLASH_UNKNOWN) { | |
275 | - printf ("missing or unknown FLASH type\n"); | |
276 | - return; | |
277 | - } | |
278 | - | |
279 | - switch (info->flash_id & FLASH_VENDMASK) { | |
280 | - case FLASH_MAN_AMD: printf ("AMD "); break; | |
281 | - case FLASH_MAN_FUJ: printf ("FUJITSU "); break; | |
282 | - case FLASH_MAN_SST: printf ("SST "); break; | |
283 | - case FLASH_MAN_STM: printf ("STM "); break; | |
284 | - case FLASH_MAN_INTEL: printf ("INTEL "); break; | |
285 | - default: printf ("Unknown Vendor "); break; | |
286 | - } | |
287 | - | |
288 | - if (info->flash_id & 0x0001 ) { | |
289 | - boottype = botboot; | |
290 | - } else { | |
291 | - boottype = topboot; | |
292 | - } | |
293 | - | |
294 | - switch (info->flash_id & FLASH_TYPEMASK) { | |
295 | - case FLASH_AM400B: printf ("AM29LV400B (4 Mbit%s",boottype); | |
296 | - break; | |
297 | - case FLASH_AM400T: printf ("AM29LV400T (4 Mbit%s",boottype); | |
298 | - break; | |
299 | - case FLASH_AM800B: printf ("AM29LV800B (8 Mbit%s",boottype); | |
300 | - break; | |
301 | - case FLASH_AM800T: printf ("AM29LV800T (8 Mbit%s",boottype); | |
302 | - break; | |
303 | - case FLASH_AM160B: printf ("AM29LV160B (16 Mbit%s",boottype); | |
304 | - break; | |
305 | - case FLASH_AM160T: printf ("AM29LV160T (16 Mbit%s",boottype); | |
306 | - break; | |
307 | - case FLASH_AM320B: printf ("AM29LV320B (32 Mbit%s",boottype); | |
308 | - break; | |
309 | - case FLASH_AM320T: printf ("AM29LV320T (32 Mbit%s",boottype); | |
310 | - break; | |
311 | - case FLASH_INTEL800B: printf ("INTEL28F800B (8 Mbit%s",boottype); | |
312 | - break; | |
313 | - case FLASH_INTEL800T: printf ("INTEL28F800T (8 Mbit%s",boottype); | |
314 | - break; | |
315 | - case FLASH_INTEL160B: printf ("INTEL28F160B (16 Mbit%s",boottype); | |
316 | - break; | |
317 | - case FLASH_INTEL160T: printf ("INTEL28F160T (16 Mbit%s",boottype); | |
318 | - break; | |
319 | - case FLASH_INTEL320B: printf ("INTEL28F320B (32 Mbit%s",boottype); | |
320 | - break; | |
321 | - case FLASH_INTEL320T: printf ("INTEL28F320T (32 Mbit%s",boottype); | |
322 | - break; | |
323 | - case FLASH_AMDL322T: printf ("AM29DL322T (32 Mbit%s",boottype); | |
324 | - break; | |
325 | - | |
326 | -#if 0 /* enable when devices are available */ | |
327 | - | |
328 | - case FLASH_INTEL640B: printf ("INTEL28F640B (64 Mbit%s",boottype); | |
329 | - break; | |
330 | - case FLASH_INTEL640T: printf ("INTEL28F640T (64 Mbit%s",boottype); | |
331 | - break; | |
332 | -#endif | |
333 | - case INTEL_ID_28F320J3A: printf ("INTEL28F320JA3 (32 Mbit%s",boottype); | |
334 | - break; | |
335 | - case INTEL_ID_28F640J3A: printf ("INTEL28F640JA3 (64 Mbit%s",boottype); | |
336 | - break; | |
337 | - case INTEL_ID_28F128J3A: printf ("INTEL28F128JA3 (128 Mbit%s",boottype); | |
338 | - break; | |
339 | - | |
340 | - default: printf ("Unknown Chip Type\n"); | |
341 | - break; | |
342 | - } | |
343 | - | |
344 | - printf (" Size: %ld MB in %d Sectors\n", | |
345 | - info->size >> 20, info->sector_count); | |
346 | - | |
347 | - printf (" Sector Start Addresses:"); | |
348 | - for (i=0; i<info->sector_count; ++i) { | |
349 | - if ((i % 5) == 0) | |
350 | - printf ("\n "); | |
351 | - printf (" %08lX%s", | |
352 | - info->start[i], | |
353 | - info->protect[i] ? " (RO)" : " " | |
354 | - ); | |
355 | - } | |
356 | - printf ("\n"); | |
357 | - return; | |
358 | -} | |
359 | - | |
360 | - | |
361 | -/*----------------------------------------------------------------------- | |
362 | - */ | |
363 | - | |
364 | - | |
365 | -/*----------------------------------------------------------------------- | |
366 | - */ | |
367 | - | |
368 | -/* | |
369 | - * The following code cannot be run from FLASH! | |
370 | - */ | |
371 | -ulong flash_get_size (volatile FLASH_WORD_SIZE *addr, flash_info_t *info) | |
372 | -{ | |
373 | - short i; | |
374 | - ulong base = (ulong)addr; | |
375 | - FLASH_WORD_SIZE value; | |
376 | - | |
377 | - /* Write auto select command: read Manufacturer ID */ | |
378 | - | |
379 | - | |
380 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
381 | - | |
382 | - /* | |
383 | - * Note: if it is an AMD flash and the word at addr[0000] | |
384 | - * is 0x00890089 this routine will think it is an Intel | |
385 | - * flash device and may(most likely) cause trouble. | |
386 | - */ | |
387 | - | |
388 | - addr[0x0000] = 0x00900090; | |
389 | - if(addr[0x0000] != 0x00890089){ | |
390 | - addr[0x0555] = 0x00AA00AA; | |
391 | - addr[0x02AA] = 0x00550055; | |
392 | - addr[0x0555] = 0x00900090; | |
393 | -#else | |
394 | - | |
395 | - /* | |
396 | - * Note: if it is an AMD flash and the word at addr[0000] | |
397 | - * is 0x0089 this routine will think it is an Intel | |
398 | - * flash device and may(most likely) cause trouble. | |
399 | - */ | |
400 | - | |
401 | - addr[0x0000] = 0x0090; | |
402 | - | |
403 | - if(addr[0x0000] != 0x0089){ | |
404 | - addr[0x0555] = 0x00AA; | |
405 | - addr[0x02AA] = 0x0055; | |
406 | - addr[0x0555] = 0x0090; | |
407 | -#endif | |
408 | - } | |
409 | - value = addr[0]; | |
410 | - | |
411 | - switch (value) { | |
412 | - case (AMD_MANUFACT & FLASH_ID_MASK): | |
413 | - info->flash_id = FLASH_MAN_AMD; | |
414 | - break; | |
415 | - case (FUJ_MANUFACT & FLASH_ID_MASK): | |
416 | - info->flash_id = FLASH_MAN_FUJ; | |
417 | - break; | |
418 | - case (STM_MANUFACT & FLASH_ID_MASK): | |
419 | - info->flash_id = FLASH_MAN_STM; | |
420 | - break; | |
421 | - case (SST_MANUFACT & FLASH_ID_MASK): | |
422 | - info->flash_id = FLASH_MAN_SST; | |
423 | - break; | |
424 | - case (INTEL_MANUFACT & FLASH_ID_MASK): | |
425 | - info->flash_id = FLASH_MAN_INTEL; | |
426 | - break; | |
427 | - default: | |
428 | - info->flash_id = FLASH_UNKNOWN; | |
429 | - info->sector_count = 0; | |
430 | - info->size = 0; | |
431 | - return (0); /* no or unknown flash */ | |
432 | - | |
433 | - } | |
434 | - | |
435 | - value = addr[1]; /* device ID */ | |
436 | - | |
437 | - switch (value) { | |
438 | - | |
439 | - case (AMD_ID_LV400T & FLASH_ID_MASK): | |
440 | - info->flash_id += FLASH_AM400T; | |
441 | - info->sector_count = 11; | |
442 | - info->size = 0x00100000; | |
443 | - break; /* => 1 MB */ | |
444 | - | |
445 | - case (AMD_ID_LV400B & FLASH_ID_MASK): | |
446 | - info->flash_id += FLASH_AM400B; | |
447 | - info->sector_count = 11; | |
448 | - info->size = 0x00100000; | |
449 | - break; /* => 1 MB */ | |
450 | - | |
451 | - case (AMD_ID_LV800T & FLASH_ID_MASK): | |
452 | - info->flash_id += FLASH_AM800T; | |
453 | - info->sector_count = 19; | |
454 | - info->size = 0x00200000; | |
455 | - break; /* => 2 MB */ | |
456 | - | |
457 | - case (AMD_ID_LV800B & FLASH_ID_MASK): | |
458 | - info->flash_id += FLASH_AM800B; | |
459 | - info->sector_count = 19; | |
460 | - info->size = 0x00200000; | |
461 | - break; /* => 2 MB */ | |
462 | - | |
463 | - case (AMD_ID_LV160T & FLASH_ID_MASK): | |
464 | - info->flash_id += FLASH_AM160T; | |
465 | - info->sector_count = 35; | |
466 | - info->size = 0x00400000; | |
467 | - break; /* => 4 MB */ | |
468 | - | |
469 | - case (AMD_ID_LV160B & FLASH_ID_MASK): | |
470 | - info->flash_id += FLASH_AM160B; | |
471 | - info->sector_count = 35; | |
472 | - info->size = 0x00400000; | |
473 | - break; /* => 4 MB */ | |
474 | -#if 0 /* enable when device IDs are available */ | |
475 | - case (AMD_ID_LV320T & FLASH_ID_MASK): | |
476 | - info->flash_id += FLASH_AM320T; | |
477 | - info->sector_count = 67; | |
478 | - info->size = 0x00800000; | |
479 | - break; /* => 8 MB */ | |
480 | - | |
481 | - case (AMD_ID_LV320B & FLASH_ID_MASK): | |
482 | - info->flash_id += FLASH_AM320B; | |
483 | - info->sector_count = 67; | |
484 | - info->size = 0x00800000; | |
485 | - break; /* => 8 MB */ | |
486 | -#endif | |
487 | - | |
488 | - case (AMD_ID_DL322T & FLASH_ID_MASK): | |
489 | - info->flash_id += FLASH_AMDL322T; | |
490 | - info->sector_count = 71; | |
491 | - info->size = 0x00800000; | |
492 | - break; /* => 8 MB */ | |
493 | - | |
494 | - case (INTEL_ID_28F800B3T & FLASH_ID_MASK): | |
495 | - info->flash_id += FLASH_INTEL800T; | |
496 | - info->sector_count = 23; | |
497 | - info->size = 0x00200000; | |
498 | - break; /* => 2 MB */ | |
499 | - | |
500 | - case (INTEL_ID_28F800B3B & FLASH_ID_MASK): | |
501 | - info->flash_id += FLASH_INTEL800B; | |
502 | - info->sector_count = 23; | |
503 | - info->size = 0x00200000; | |
504 | - break; /* => 2 MB */ | |
505 | - | |
506 | - case (INTEL_ID_28F160B3T & FLASH_ID_MASK): | |
507 | - info->flash_id += FLASH_INTEL160T; | |
508 | - info->sector_count = 39; | |
509 | - info->size = 0x00400000; | |
510 | - break; /* => 4 MB */ | |
511 | - | |
512 | - case (INTEL_ID_28F160B3B & FLASH_ID_MASK): | |
513 | - info->flash_id += FLASH_INTEL160B; | |
514 | - info->sector_count = 39; | |
515 | - info->size = 0x00400000; | |
516 | - break; /* => 4 MB */ | |
517 | - | |
518 | - case (INTEL_ID_28F320B3T & FLASH_ID_MASK): | |
519 | - info->flash_id += FLASH_INTEL320T; | |
520 | - info->sector_count = 71; | |
521 | - info->size = 0x00800000; | |
522 | - break; /* => 8 MB */ | |
523 | - | |
524 | - case (INTEL_ID_28F320B3B & FLASH_ID_MASK): | |
525 | - info->flash_id += FLASH_AM320B; | |
526 | - info->sector_count = 71; | |
527 | - info->size = 0x00800000; | |
528 | - break; /* => 8 MB */ | |
529 | - | |
530 | -#if 0 /* enable when devices are available */ | |
531 | - case (INTEL_ID_28F320B3T & FLASH_ID_MASK): | |
532 | - info->flash_id += FLASH_INTEL320T; | |
533 | - info->sector_count = 135; | |
534 | - info->size = 0x01000000; | |
535 | - break; /* => 16 MB */ | |
536 | - | |
537 | - case (INTEL_ID_28F320B3B & FLASH_ID_MASK): | |
538 | - info->flash_id += FLASH_AM320B; | |
539 | - info->sector_count = 135; | |
540 | - info->size = 0x01000000; | |
541 | - break; /* => 16 MB */ | |
542 | -#endif | |
543 | - case (INTEL_ID_28F320J3A & FLASH_ID_MASK): | |
544 | - info->flash_id += FLASH_28F320J3A; | |
545 | - info->sector_count = 32; | |
546 | - info->size = 0x00400000; | |
547 | - break; /* => 32 MBit */ | |
548 | - case (INTEL_ID_28F640J3A & FLASH_ID_MASK): | |
549 | - info->flash_id += FLASH_28F640J3A; | |
550 | - info->sector_count = 64; | |
551 | - info->size = 0x00800000; | |
552 | - break; /* => 64 MBit */ | |
553 | - case (INTEL_ID_28F128J3A & FLASH_ID_MASK): | |
554 | - info->flash_id += FLASH_28F128J3A; | |
555 | - info->sector_count = 128; | |
556 | - info->size = 0x01000000; | |
557 | - break; /* => 128 MBit */ | |
558 | - | |
559 | - default: | |
560 | - /* FIXME*/ | |
561 | - info->flash_id = FLASH_UNKNOWN; | |
562 | - return (0); /* => no or unknown flash */ | |
563 | - } | |
564 | - | |
565 | - flash_get_offsets(base, info); | |
566 | - | |
567 | - /* check for protected sectors */ | |
568 | - for (i = 0; i < info->sector_count; i++) { | |
569 | - /* read sector protection at sector address, (A7 .. A0) = 0x02 */ | |
570 | - /* D0 = 1 if protected */ | |
571 | - addr = (volatile FLASH_WORD_SIZE *)(info->start[i]); | |
572 | - info->protect[i] = addr[2] & 1; | |
573 | - } | |
574 | - | |
575 | - /* | |
576 | - * Prevent writes to uninitialized FLASH. | |
577 | - */ | |
578 | - if (info->flash_id != FLASH_UNKNOWN) { | |
579 | - addr = (volatile FLASH_WORD_SIZE *)info->start[0]; | |
580 | - if( (info->flash_id & 0xFF00) == FLASH_MAN_INTEL){ | |
581 | - *addr = (0x00F000F0 & FLASH_ID_MASK); /* reset bank */ | |
582 | - } else { | |
583 | - *addr = (0x00FF00FF & FLASH_ID_MASK); /* reset bank */ | |
584 | - } | |
585 | - } | |
586 | - | |
587 | - return (info->size); | |
588 | -} | |
589 | - | |
590 | - | |
591 | -/*----------------------------------------------------------------------- | |
592 | - */ | |
593 | - | |
594 | -int flash_erase (flash_info_t * info, int s_first, int s_last) | |
595 | -{ | |
596 | - | |
597 | - volatile FLASH_WORD_SIZE *addr = | |
598 | - (volatile FLASH_WORD_SIZE *) (info->start[0]); | |
599 | - int flag, prot, sect, l_sect, barf; | |
600 | - ulong start, now, last; | |
601 | - int rcode = 0; | |
602 | - | |
603 | - if ((s_first < 0) || (s_first > s_last)) { | |
604 | - if (info->flash_id == FLASH_UNKNOWN) { | |
605 | - printf ("- missing\n"); | |
606 | - } else { | |
607 | - printf ("- no sectors to erase\n"); | |
608 | - } | |
609 | - return 1; | |
610 | - } | |
611 | - | |
612 | - if ((info->flash_id == FLASH_UNKNOWN) || | |
613 | - ((info->flash_id > FLASH_AMD_COMP) && | |
614 | - ((info->flash_id & FLASH_VENDMASK) != FLASH_MAN_INTEL))) { | |
615 | - printf ("Can't erase unknown flash type - aborted\n"); | |
616 | - return 1; | |
617 | - } | |
618 | - | |
619 | - prot = 0; | |
620 | - for (sect = s_first; sect <= s_last; ++sect) { | |
621 | - if (info->protect[sect]) { | |
622 | - prot++; | |
623 | - } | |
624 | - } | |
625 | - | |
626 | - if (prot) { | |
627 | - printf ("- Warning: %d protected sectors will not be erased!\n", prot); | |
628 | - } else { | |
629 | - printf ("\n"); | |
630 | - } | |
631 | - | |
632 | - l_sect = -1; | |
633 | - | |
634 | - /* Disable interrupts which might cause a timeout here */ | |
635 | - flag = disable_interrupts (); | |
636 | - if (info->flash_id < FLASH_AMD_COMP) { | |
637 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
638 | - addr[0x0555] = 0x00AA00AA; | |
639 | - addr[0x02AA] = 0x00550055; | |
640 | - addr[0x0555] = 0x00800080; | |
641 | - addr[0x0555] = 0x00AA00AA; | |
642 | - addr[0x02AA] = 0x00550055; | |
643 | -#else | |
644 | - addr[0x0555] = 0x00AA; | |
645 | - addr[0x02AA] = 0x0055; | |
646 | - addr[0x0555] = 0x0080; | |
647 | - addr[0x0555] = 0x00AA; | |
648 | - addr[0x02AA] = 0x0055; | |
649 | -#endif | |
650 | - /* Start erase on unprotected sectors */ | |
651 | - for (sect = s_first; sect <= s_last; sect++) { | |
652 | - if (info->protect[sect] == 0) { /* not protected */ | |
653 | - addr = (volatile FLASH_WORD_SIZE *) (info->start[sect]); | |
654 | - addr[0] = (0x00300030 & FLASH_ID_MASK); | |
655 | - l_sect = sect; | |
656 | - } | |
657 | - } | |
658 | - | |
659 | - /* re-enable interrupts if necessary */ | |
660 | - if (flag) | |
661 | - enable_interrupts (); | |
662 | - | |
663 | - /* wait at least 80us - let's wait 1 ms */ | |
664 | - udelay (1000); | |
665 | - | |
666 | - /* | |
667 | - * We wait for the last triggered sector | |
668 | - */ | |
669 | - if (l_sect < 0) | |
670 | - goto DONE; | |
671 | - | |
672 | - start = get_timer (0); | |
673 | - last = start; | |
674 | - addr = (volatile FLASH_WORD_SIZE *) (info->start[l_sect]); | |
675 | - while ((addr[0] & (0x00800080 & FLASH_ID_MASK)) != | |
676 | - (0x00800080 & FLASH_ID_MASK)) { | |
677 | - if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { | |
678 | - printf ("Timeout\n"); | |
679 | - return 1; | |
680 | - } | |
681 | - /* show that we're waiting */ | |
682 | - if ((now - last) > 1000) { /* every second */ | |
683 | - serial_putc ('.'); | |
684 | - last = now; | |
685 | - } | |
686 | - } | |
687 | - | |
688 | - DONE: | |
689 | - /* reset to read mode */ | |
690 | - addr = (volatile FLASH_WORD_SIZE *) info->start[0]; | |
691 | - addr[0] = (0x00F000F0 & FLASH_ID_MASK); /* reset bank */ | |
692 | - } else { | |
693 | - | |
694 | - | |
695 | - for (sect = s_first; sect <= s_last; sect++) { | |
696 | - if (info->protect[sect] == 0) { /* not protected */ | |
697 | - barf = 0; | |
698 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
699 | - addr = (vu_long *) (info->start[sect]); | |
700 | - addr[0] = 0x00200020; | |
701 | - addr[0] = 0x00D000D0; | |
702 | - while (!(addr[0] & 0x00800080)); /* wait for error or finish */ | |
703 | - if (addr[0] & 0x003A003A) { /* check for error */ | |
704 | - barf = addr[0] & 0x003A0000; | |
705 | - if (barf) { | |
706 | - barf >>= 16; | |
707 | - } else { | |
708 | - barf = addr[0] & 0x0000003A; | |
709 | - } | |
710 | - } | |
711 | -#else | |
712 | - addr = (vu_short *) (info->start[sect]); | |
713 | - addr[0] = 0x0020; | |
714 | - addr[0] = 0x00D0; | |
715 | - while (!(addr[0] & 0x0080)); /* wait for error or finish */ | |
716 | - if (addr[0] & 0x003A) /* check for error */ | |
717 | - barf = addr[0] & 0x003A; | |
718 | -#endif | |
719 | - if (barf) { | |
720 | - printf ("\nFlash error in sector at %lx\n", | |
721 | - (unsigned long) addr); | |
722 | - if (barf & 0x0002) | |
723 | - printf ("Block locked, not erased.\n"); | |
724 | - if ((barf & 0x0030) == 0x0030) | |
725 | - printf ("Command Sequence error.\n"); | |
726 | - if ((barf & 0x0030) == 0x0020) | |
727 | - printf ("Block Erase error.\n"); | |
728 | - if (barf & 0x0008) | |
729 | - printf ("Vpp Low error.\n"); | |
730 | - rcode = 1; | |
731 | - } else | |
732 | - printf ("."); | |
733 | - l_sect = sect; | |
734 | - } | |
735 | - addr = (volatile FLASH_WORD_SIZE *) info->start[0]; | |
736 | - addr[0] = (0x00FF00FF & FLASH_ID_MASK); /* reset bank */ | |
737 | - | |
738 | - } | |
739 | - | |
740 | - } | |
741 | - printf (" done\n"); | |
742 | - return rcode; | |
743 | -} | |
744 | - | |
745 | -/*----------------------------------------------------------------------- | |
746 | - */ | |
747 | - | |
748 | -/*flash_info_t *addr2info (ulong addr) | |
749 | -{ | |
750 | - flash_info_t *info; | |
751 | - int i; | |
752 | - | |
753 | - for (i=0, info=&flash_info[0]; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i, ++info) { | |
754 | - if ((addr >= info->start[0]) && | |
755 | - (addr < (info->start[0] + info->size)) ) { | |
756 | - return (info); | |
757 | - } | |
758 | - } | |
759 | - | |
760 | - return (NULL); | |
761 | -} | |
762 | -*/ | |
763 | -/*----------------------------------------------------------------------- | |
764 | - * Copy memory to flash. | |
765 | - * Make sure all target addresses are within Flash bounds, | |
766 | - * and no protected sectors are hit. | |
767 | - * Returns: | |
768 | - * 0 - OK | |
769 | - * 1 - write timeout | |
770 | - * 2 - Flash not erased | |
771 | - * 4 - target range includes protected sectors | |
772 | - * 8 - target address not in Flash memory | |
773 | - */ | |
774 | - | |
775 | -/*int flash_write (uchar *src, ulong addr, ulong cnt) | |
776 | -{ | |
777 | - int i; | |
778 | - ulong end = addr + cnt - 1; | |
779 | - flash_info_t *info_first = addr2info (addr); | |
780 | - flash_info_t *info_last = addr2info (end ); | |
781 | - flash_info_t *info; | |
782 | - | |
783 | - if (cnt == 0) { | |
784 | - return (0); | |
785 | - } | |
786 | - | |
787 | - if (!info_first || !info_last) { | |
788 | - return (8); | |
789 | - } | |
790 | - | |
791 | - for (info = info_first; info <= info_last; ++info) { | |
792 | - ulong b_end = info->start[0] + info->size;*/ /* bank end addr */ | |
793 | -/* short s_end = info->sector_count - 1; | |
794 | - for (i=0; i<info->sector_count; ++i) { | |
795 | - ulong e_addr = (i == s_end) ? b_end : info->start[i + 1]; | |
796 | - | |
797 | - if ((end >= info->start[i]) && (addr < e_addr) && | |
798 | - (info->protect[i] != 0) ) { | |
799 | - return (4); | |
800 | - } | |
801 | - } | |
802 | - } | |
803 | - | |
804 | -*/ /* finally write data to flash */ | |
805 | -/* for (info = info_first; info <= info_last && cnt>0; ++info) { | |
806 | - ulong len; | |
807 | - | |
808 | - len = info->start[0] + info->size - addr; | |
809 | - if (len > cnt) | |
810 | - len = cnt; | |
811 | - if ((i = write_buff(info, src, addr, len)) != 0) { | |
812 | - return (i); | |
813 | - } | |
814 | - cnt -= len; | |
815 | - addr += len; | |
816 | - src += len; | |
817 | - } | |
818 | - return (0); | |
819 | -} | |
820 | -*/ | |
821 | -/*----------------------------------------------------------------------- | |
822 | - * Copy memory to flash, returns: | |
823 | - * 0 - OK | |
824 | - * 1 - write timeout | |
825 | - * 2 - Flash not erased | |
826 | - */ | |
827 | - | |
828 | -int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) | |
829 | -{ | |
830 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
831 | - ulong cp, wp, data; | |
832 | - int l; | |
833 | -#else | |
834 | - ulong cp, wp; | |
835 | - ushort data; | |
836 | -#endif | |
837 | - int i, rc; | |
838 | - | |
839 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
840 | - | |
841 | - | |
842 | - wp = (addr & ~3); /* get lower word aligned address */ | |
843 | - | |
844 | - /* | |
845 | - * handle unaligned start bytes | |
846 | - */ | |
847 | - if ((l = addr - wp) != 0) { | |
848 | - data = 0; | |
849 | - for (i=0, cp=wp; i<l; ++i, ++cp) { | |
850 | - data = (data << 8) | (*(uchar *)cp); | |
851 | - } | |
852 | - for (; i<4 && cnt>0; ++i) { | |
853 | - data = (data << 8) | *src++; | |
854 | - --cnt; | |
855 | - ++cp; | |
856 | - } | |
857 | - for (; cnt==0 && i<4; ++i, ++cp) { | |
858 | - data = (data << 8) | (*(uchar *)cp); | |
859 | - } | |
860 | - | |
861 | - if ((rc = write_word(info, wp, data)) != 0) { | |
862 | - return (rc); | |
863 | - } | |
864 | - wp += 4; | |
865 | - } | |
866 | - | |
867 | - /* | |
868 | - * handle word aligned part | |
869 | - */ | |
870 | - while (cnt >= 4) { | |
871 | - data = 0; | |
872 | - for (i=0; i<4; ++i) { | |
873 | - data = (data << 8) | *src++; | |
874 | - } | |
875 | - if ((rc = write_word(info, wp, data)) != 0) { | |
876 | - return (rc); | |
877 | - } | |
878 | - wp += 4; | |
879 | - cnt -= 4; | |
880 | - } | |
881 | - | |
882 | - if (cnt == 0) { | |
883 | - return (0); | |
884 | - } | |
885 | - | |
886 | - /* | |
887 | - * handle unaligned tail bytes | |
888 | - */ | |
889 | - data = 0; | |
890 | - for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) { | |
891 | - data = (data << 8) | *src++; | |
892 | - --cnt; | |
893 | - } | |
894 | - for (; i<4; ++i, ++cp) { | |
895 | - data = (data << 8) | (*(uchar *)cp); | |
896 | - } | |
897 | - | |
898 | - return (write_word(info, wp, data)); | |
899 | - | |
900 | -#else | |
901 | - wp = (addr & ~1); /* get lower word aligned address */ | |
902 | - | |
903 | - /* | |
904 | - * handle unaligned start byte | |
905 | - */ | |
906 | - if (addr - wp) { | |
907 | - data = 0; | |
908 | - data = (data << 8) | *src++; | |
909 | - --cnt; | |
910 | - if ((rc = write_short(info, wp, data)) != 0) { | |
911 | - return (rc); | |
912 | - } | |
913 | - wp += 2; | |
914 | - } | |
915 | - | |
916 | - /* | |
917 | - * handle word aligned part | |
918 | - */ | |
919 | -/* l = 0; used for debuging */ | |
920 | - while (cnt >= 2) { | |
921 | - data = 0; | |
922 | - for (i=0; i<2; ++i) { | |
923 | - data = (data << 8) | *src++; | |
924 | - } | |
925 | - | |
926 | -/* if(!l){ | |
927 | - printf("%x",data); | |
928 | - l = 1; | |
929 | - } used for debuging */ | |
930 | - | |
931 | - if ((rc = write_short(info, wp, data)) != 0) { | |
932 | - return (rc); | |
933 | - } | |
934 | - wp += 2; | |
935 | - cnt -= 2; | |
936 | - } | |
937 | - | |
938 | - if (cnt == 0) { | |
939 | - return (0); | |
940 | - } | |
941 | - | |
942 | - /* | |
943 | - * handle unaligned tail bytes | |
944 | - */ | |
945 | - data = 0; | |
946 | - for (i=0, cp=wp; i<2 && cnt>0; ++i, ++cp) { | |
947 | - data = (data << 8) | *src++; | |
948 | - --cnt; | |
949 | - } | |
950 | - for (; i<2; ++i, ++cp) { | |
951 | - data = (data << 8) | (*(uchar *)cp); | |
952 | - } | |
953 | - | |
954 | - return (write_short(info, wp, data)); | |
955 | - | |
956 | - | |
957 | -#endif | |
958 | -} | |
959 | - | |
960 | -/*----------------------------------------------------------------------- | |
961 | - * Write a word to Flash, returns: | |
962 | - * 0 - OK | |
963 | - * 1 - write timeout | |
964 | - * 2 - Flash not erased | |
965 | - */ | |
966 | -#ifndef CONFIG_SYS_FLASH_16BIT | |
967 | -static int write_word (flash_info_t *info, ulong dest, ulong data) | |
968 | -{ | |
969 | - vu_long *addr = (vu_long*)(info->start[0]); | |
970 | - ulong start,barf; | |
971 | - int flag; | |
972 | - | |
973 | - | |
974 | - /* Check if Flash is (sufficiently) erased */ | |
975 | - if ((*((vu_long *)dest) & data) != data) { | |
976 | - return (2); | |
977 | - } | |
978 | - | |
979 | - /* Disable interrupts which might cause a timeout here */ | |
980 | - flag = disable_interrupts(); | |
981 | - | |
982 | - if(info->flash_id > FLASH_AMD_COMP) { | |
983 | - /* AMD stuff */ | |
984 | - addr[0x0555] = 0x00AA00AA; | |
985 | - addr[0x02AA] = 0x00550055; | |
986 | - addr[0x0555] = 0x00A000A0; | |
987 | - } else { | |
988 | - /* intel stuff */ | |
989 | - *addr = 0x00400040; | |
990 | - } | |
991 | - *((vu_long *)dest) = data; | |
992 | - | |
993 | - /* re-enable interrupts if necessary */ | |
994 | - if (flag) | |
995 | - enable_interrupts(); | |
996 | - | |
997 | - /* data polling for D7 */ | |
998 | - start = get_timer (0); | |
999 | - | |
1000 | - if(info->flash_id > FLASH_AMD_COMP) { | |
1001 | - while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) { | |
1002 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | |
1003 | - return (1); | |
1004 | - } | |
1005 | - } | |
1006 | - } else { | |
1007 | - while(!(addr[0] & 0x00800080)) { /* wait for error or finish */ | |
1008 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | |
1009 | - return (1); | |
1010 | - } | |
1011 | - | |
1012 | - if( addr[0] & 0x003A003A) { /* check for error */ | |
1013 | - barf = addr[0] & 0x003A0000; | |
1014 | - if( barf ) { | |
1015 | - barf >>=16; | |
1016 | - } else { | |
1017 | - barf = addr[0] & 0x0000003A; | |
1018 | - } | |
1019 | - printf("\nFlash write error at address %lx\n",(unsigned long)dest); | |
1020 | - if(barf & 0x0002) printf("Block locked, not erased.\n"); | |
1021 | - if(barf & 0x0010) printf("Programming error.\n"); | |
1022 | - if(barf & 0x0008) printf("Vpp Low error.\n"); | |
1023 | - return(2); | |
1024 | - } | |
1025 | - } | |
1026 | - | |
1027 | - return (0); | |
1028 | -} | |
1029 | - | |
1030 | -#else | |
1031 | - | |
1032 | -static int write_short (flash_info_t *info, ulong dest, ushort data) | |
1033 | -{ | |
1034 | - vu_short *addr = (vu_short*)(info->start[0]); | |
1035 | - ulong start,barf; | |
1036 | - int flag; | |
1037 | - | |
1038 | - /* Check if Flash is (sufficiently) erased */ | |
1039 | - if ((*((vu_short *)dest) & data) != data) { | |
1040 | - return (2); | |
1041 | - } | |
1042 | - | |
1043 | - /* Disable interrupts which might cause a timeout here */ | |
1044 | - flag = disable_interrupts(); | |
1045 | - | |
1046 | - if(info->flash_id < FLASH_AMD_COMP) { | |
1047 | - /* AMD stuff */ | |
1048 | - addr[0x0555] = 0x00AA; | |
1049 | - addr[0x02AA] = 0x0055; | |
1050 | - addr[0x0555] = 0x00A0; | |
1051 | - } else { | |
1052 | - /* intel stuff */ | |
1053 | - *addr = 0x00D0; | |
1054 | - *addr = 0x0040; | |
1055 | - } | |
1056 | - *((vu_short *)dest) = data; | |
1057 | - | |
1058 | - /* re-enable interrupts if necessary */ | |
1059 | - if (flag) | |
1060 | - enable_interrupts(); | |
1061 | - | |
1062 | - /* data polling for D7 */ | |
1063 | - start = get_timer (0); | |
1064 | - | |
1065 | - if(info->flash_id < FLASH_AMD_COMP) { | |
1066 | - /* AMD stuff */ | |
1067 | - while ((*((vu_short *)dest) & 0x0080) != (data & 0x0080)) { | |
1068 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | |
1069 | - return (1); | |
1070 | - } | |
1071 | - } | |
1072 | - | |
1073 | - } else { | |
1074 | - /* intel stuff */ | |
1075 | - while(!(addr[0] & 0x0080)){ /* wait for error or finish */ | |
1076 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1); | |
1077 | - } | |
1078 | - | |
1079 | - if( addr[0] & 0x003A) { /* check for error */ | |
1080 | - barf = addr[0] & 0x003A; | |
1081 | - printf("\nFlash write error at address %lx\n",(unsigned long)dest); | |
1082 | - if(barf & 0x0002) printf("Block locked, not erased.\n"); | |
1083 | - if(barf & 0x0010) printf("Programming error.\n"); | |
1084 | - if(barf & 0x0008) printf("Vpp Low error.\n"); | |
1085 | - return(2); | |
1086 | - } | |
1087 | - *addr = 0x00B0; | |
1088 | - *addr = 0x0070; | |
1089 | - while(!(addr[0] & 0x0080)){ /* wait for error or finish */ | |
1090 | - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1); | |
1091 | - } | |
1092 | - *addr = 0x00FF; | |
1093 | - } | |
1094 | - return (0); | |
1095 | -} | |
1096 | - | |
1097 | -#endif | |
1098 | - | |
1099 | -/*-----------------------------------------------------------------------*/ |
board/snmc/qs860t/qs860t.c
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2002 | |
6 | - * Simple Network Magic Corporation, dnevil@snmc.com | |
7 | - * | |
8 | - * (C) Copyright 2000 | |
9 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
10 | - * | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -#include <common.h> | |
15 | -#include <asm/u-boot.h> | |
16 | -#include <commproc.h> | |
17 | -#include "mpc8xx.h" | |
18 | - | |
19 | -/* ------------------------------------------------------------------------- */ | |
20 | - | |
21 | -static long int dram_size (long int, long int *, long int); | |
22 | - | |
23 | -/* ------------------------------------------------------------------------- */ | |
24 | - | |
25 | -const uint sdram_table[] = | |
26 | -{ | |
27 | - /* | |
28 | - * Single Read. (Offset 0 in UPMA RAM) | |
29 | - */ | |
30 | - 0x1F07FC04, 0xEEAEFC04, 0x11ADFC04, 0xEFBBBC00, | |
31 | - 0x1FF77C47, 0x1FF77C35, 0xEFEABC34, 0x1FB57C35, | |
32 | - /* | |
33 | - * Burst Read. (Offset 8 in UPMA RAM) | |
34 | - */ | |
35 | - 0x1F07FC04, 0xEEAEFC04, 0x10ADFC04, 0xF0AFFC00, | |
36 | - 0xF0AFFC00, 0xF1AFFC00, 0xEFBBBC00, 0x1FF77C47, | |
37 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
38 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
39 | - /* | |
40 | - * Single Write. (Offset 18 in UPMA RAM) | |
41 | - */ | |
42 | - 0x1F27FC04, 0xEEAEBC00, 0x01B93C04, 0x1FF77C47, | |
43 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
44 | - /* | |
45 | - * Burst Write. (Offset 20 in UPMA RAM) | |
46 | - */ | |
47 | - 0x1F07FC04, 0xEEAEBC00, 0x10AD7C00, 0xF0AFFC00, | |
48 | - 0xF0AFFC00, 0xE1BBBC04, 0x1FF77C47, 0xFFFFEC04, | |
49 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
50 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
51 | - /* | |
52 | - * Refresh (Offset 30 in UPMA RAM) | |
53 | - */ | |
54 | - 0x1FF5FC84, 0xFFFFFC04, 0xFFFFFC04, 0xFFFFFC04, | |
55 | - 0xFFFFFC84, 0xFFFFFC07, 0xFFFFEC04, 0xFFFFEC04, | |
56 | - 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04, | |
57 | - /* | |
58 | - * Exception. (Offset 3c in UPMA RAM) | |
59 | - */ | |
60 | - 0x7FFFFC07, 0xFFFFEC04, 0xFFFFEC04, 0xFFFFEC04 | |
61 | -}; | |
62 | - | |
63 | -/* ------------------------------------------------------------------------- */ | |
64 | - | |
65 | - | |
66 | -/* | |
67 | - * Check Board Identity: | |
68 | - * | |
69 | - * Test ID string (QS860T...) | |
70 | - * | |
71 | - * Always return 1 | |
72 | - */ | |
73 | - | |
74 | -int checkboard (void) | |
75 | -{ | |
76 | - char *s, *e; | |
77 | - char buf[64]; | |
78 | - int i; | |
79 | - | |
80 | - i = getenv_f("serial#", buf, sizeof(buf)); | |
81 | - s = (i>0) ? buf : NULL; | |
82 | - | |
83 | - if (!s || strncmp(s, "QS860T", 6)) { | |
84 | - puts ("### No HW ID - assuming QS860T"); | |
85 | - } else { | |
86 | - for (e=s; *e; ++e) { | |
87 | - if (*e == ' ') | |
88 | - break; | |
89 | - } | |
90 | - | |
91 | - for ( ; s<e; ++s) { | |
92 | - putc (*s); | |
93 | - } | |
94 | - } | |
95 | - putc ('\n'); | |
96 | - | |
97 | - return (0); | |
98 | -} | |
99 | - | |
100 | -/* ------------------------------------------------------------------------- */ | |
101 | - | |
102 | -phys_size_t initdram (int board_type) | |
103 | -{ | |
104 | - volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; | |
105 | - volatile memctl8xx_t *memctl = &immap->im_memctl; | |
106 | - long int size; | |
107 | - | |
108 | - upmconfig(UPMB, (uint *)sdram_table, sizeof(sdram_table)/sizeof(uint)); | |
109 | - | |
110 | - /* | |
111 | - * Prescaler for refresh | |
112 | - */ | |
113 | - memctl->memc_mptpr = 0x0400; | |
114 | - | |
115 | - /* | |
116 | - * Map controller bank 2 to the SDRAM address | |
117 | - */ | |
118 | - memctl->memc_or2 = CONFIG_SYS_OR2; | |
119 | - memctl->memc_br2 = CONFIG_SYS_BR2; | |
120 | - udelay(200); | |
121 | - | |
122 | - /* perform SDRAM initialization sequence */ | |
123 | - memctl->memc_mbmr = CONFIG_SYS_16M_MBMR; | |
124 | - udelay(100); | |
125 | - | |
126 | - memctl->memc_mar = 0x00000088; | |
127 | - memctl->memc_mcr = 0x80804105; /* run precharge pattern */ | |
128 | - udelay(1); | |
129 | - | |
130 | - /* Run two refresh cycles on SDRAM */ | |
131 | - memctl->memc_mbmr = 0x18802118; | |
132 | - memctl->memc_mcr = 0x80804130; | |
133 | - memctl->memc_mbmr = 0x18802114; | |
134 | - memctl->memc_mcr = 0x80804106; | |
135 | - | |
136 | - udelay (1000); | |
137 | - | |
138 | -#if 0 | |
139 | - /* | |
140 | - * Check for 64M SDRAM Memory Size | |
141 | - */ | |
142 | - size = dram_size (CONFIG_SYS_64M_MBMR, (ulong *)SDRAM_BASE, SDRAM_64M_MAX_SIZE); | |
143 | - udelay (1000); | |
144 | - | |
145 | - /* | |
146 | - * Check for 16M SDRAM Memory Size | |
147 | - */ | |
148 | - if (size != SDRAM_64M_MAX_SIZE) { | |
149 | -#endif | |
150 | - size = dram_size (CONFIG_SYS_16M_MBMR, (long *)SDRAM_BASE, SDRAM_16M_MAX_SIZE); | |
151 | - udelay (1000); | |
152 | -#if 0 | |
153 | - } | |
154 | - | |
155 | - memctl->memc_or2 = ((-size) & 0xFFFF0000) | SDRAM_TIMING; | |
156 | -#endif | |
157 | - | |
158 | - | |
159 | - udelay(10000); | |
160 | - | |
161 | - | |
162 | -#if 0 | |
163 | - | |
164 | - /* | |
165 | - * Also, map other memory to correct position | |
166 | - */ | |
167 | - | |
168 | - /* | |
169 | - * Map the 8M Intel Flash device to chip select 1 | |
170 | - */ | |
171 | - memctl->memc_or1 = CONFIG_SYS_OR1; | |
172 | - memctl->memc_br1 = CONFIG_SYS_BR1; | |
173 | - | |
174 | - | |
175 | - /* | |
176 | - * Map 64K NVRAM, Sipex Device, NAND Ctl Reg, and LED Ctl Reg | |
177 | - * to chip select 3 | |
178 | - */ | |
179 | - memctl->memc_or3 = CONFIG_SYS_OR3; | |
180 | - memctl->memc_br3 = CONFIG_SYS_BR3; | |
181 | - | |
182 | - /* | |
183 | - * Map chip selects 4, 5, 6, & 7 for external expansion connector | |
184 | - */ | |
185 | - memctl->memc_or4 = CONFIG_SYS_OR4; | |
186 | - memctl->memc_br4 = CONFIG_SYS_BR4; | |
187 | - | |
188 | - memctl->memc_or5 = CONFIG_SYS_OR5; | |
189 | - memctl->memc_br5 = CONFIG_SYS_BR5; | |
190 | - | |
191 | - memctl->memc_or6 = CONFIG_SYS_OR6; | |
192 | - memctl->memc_br6 = CONFIG_SYS_BR6; | |
193 | - | |
194 | - memctl->memc_or7 = CONFIG_SYS_OR7; | |
195 | - memctl->memc_br7 = CONFIG_SYS_BR7; | |
196 | - | |
197 | -#endif | |
198 | - | |
199 | - return (size); | |
200 | -} | |
201 | - | |
202 | -/* ------------------------------------------------------------------------- */ | |
203 | - | |
204 | -/* | |
205 | - * Check memory range for valid RAM. A simple memory test determines | |
206 | - * the actually available RAM size between addresses `base' and | |
207 | - * `base + maxsize'. Some (not all) hardware errors are detected: | |
208 | - * - short between address lines | |
209 | - * - short between data lines | |
210 | - */ | |
211 | - | |
212 | -static long int dram_size (long int mbmr_value, long int *base, long int maxsize) | |
213 | -{ | |
214 | - volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; | |
215 | - volatile memctl8xx_t *memctl = &immap->im_memctl; | |
216 | - | |
217 | - memctl->memc_mbmr = mbmr_value; | |
218 | - | |
219 | - return (get_ram_size(base, maxsize)); | |
220 | -} |
board/snmc/qs860t/u-boot.lds
1 | -/* | |
2 | - * (C) Copyright 2000-2010 | |
3 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | - * | |
5 | - * SPDX-License-Identifier: GPL-2.0+ | |
6 | - */ | |
7 | - | |
8 | -OUTPUT_ARCH(powerpc) | |
9 | - | |
10 | -SECTIONS | |
11 | -{ | |
12 | - /* Read-only sections, merged into text segment: */ | |
13 | - . = + SIZEOF_HEADERS; | |
14 | - .text : | |
15 | - { | |
16 | - arch/powerpc/cpu/mpc8xx/start.o (.text*) | |
17 | - arch/powerpc/cpu/mpc8xx/traps.o (.text*) | |
18 | - | |
19 | - *(.text*) | |
20 | - } | |
21 | - _etext = .; | |
22 | - PROVIDE (etext = .); | |
23 | - .rodata : | |
24 | - { | |
25 | - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) | |
26 | - } | |
27 | - | |
28 | - /* Read-write section, merged into data segment: */ | |
29 | - . = (. + 0x00FF) & 0xFFFFFF00; | |
30 | - _erotext = .; | |
31 | - PROVIDE (erotext = .); | |
32 | - .reloc : | |
33 | - { | |
34 | - _GOT2_TABLE_ = .; | |
35 | - KEEP(*(.got2)) | |
36 | - KEEP(*(.got)) | |
37 | - PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); | |
38 | - _FIXUP_TABLE_ = .; | |
39 | - KEEP(*(.fixup)) | |
40 | - } | |
41 | - __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; | |
42 | - __fixup_entries = (. - _FIXUP_TABLE_)>>2; | |
43 | - | |
44 | - .data : | |
45 | - { | |
46 | - *(.data*) | |
47 | - *(.sdata*) | |
48 | - } | |
49 | - _edata = .; | |
50 | - PROVIDE (edata = .); | |
51 | - | |
52 | - . = .; | |
53 | - | |
54 | - . = ALIGN(4); | |
55 | - .u_boot_list : { | |
56 | - KEEP(*(SORT(.u_boot_list*))); | |
57 | - } | |
58 | - | |
59 | - | |
60 | - . = .; | |
61 | - __start___ex_table = .; | |
62 | - __ex_table : { *(__ex_table) } | |
63 | - __stop___ex_table = .; | |
64 | - | |
65 | - . = ALIGN(256); | |
66 | - __init_begin = .; | |
67 | - .text.init : { *(.text.init) } | |
68 | - .data.init : { *(.data.init) } | |
69 | - . = ALIGN(256); | |
70 | - __init_end = .; | |
71 | - | |
72 | - __bss_start = .; | |
73 | - .bss (NOLOAD) : | |
74 | - { | |
75 | - *(.bss*) | |
76 | - *(.sbss*) | |
77 | - *(COMMON) | |
78 | - . = ALIGN(4); | |
79 | - } | |
80 | - __bss_end = . ; | |
81 | - PROVIDE (end = .); | |
82 | -} |
boards.cfg
... | ... | @@ -1026,9 +1026,6 @@ |
1026 | 1026 | Active powerpc mpc8xx - kup kup4x KUP4X - Klaus Heydeck <heydeck@kieback-peter.de> |
1027 | 1027 | Active powerpc mpc8xx - LEOX elpt860 ELPT860 - The LEOX team <team@leox.org> |
1028 | 1028 | Active powerpc mpc8xx - manroland - uc100 - Stefan Roese <sr@denx.de> |
1029 | -Active powerpc mpc8xx - snmc qs850 QS823 - - | |
1030 | -Active powerpc mpc8xx - snmc qs850 QS850 - - | |
1031 | -Active powerpc mpc8xx - snmc qs860t QS860T - - | |
1032 | 1029 | Active powerpc mpc8xx - tqc tqm8xx FPS850L - Wolfgang Denk <wd@denx.de> |
1033 | 1030 | Active powerpc mpc8xx - tqc tqm8xx FPS860L - Wolfgang Denk <wd@denx.de> |
1034 | 1031 | Active powerpc mpc8xx - tqc tqm8xx NSCU - - |
doc/README.scrapyard
... | ... | @@ -11,7 +11,9 @@ |
11 | 11 | |
12 | 12 | Board Arch CPU Commit Removed Last known maintainer/contact |
13 | 13 | ================================================================================================= |
14 | -simpc8313 powerpc mpc83xx - 2014-04-28 Ron Madrid <info@sheldoninst.com> | |
14 | +qs850 powerpc mpc8xx - - | |
15 | +qs860t powerpc mpc8xx - - | |
16 | +simpc8313 powerpc mpc83xx 7445207f 2014-06-05 Ron Madrid <info@sheldoninst.com> | |
15 | 17 | hidden_dragon powerpc mpc824x 3fe1a854 2014-05-30 Yusdi Santoso <yusdi_santoso@adaptec.com> |
16 | 18 | debris powerpc mpc824x 7edb1f7b 2014-05-30 Sangmoon Kim <dogoil@etinsys.com> |
17 | 19 | kvme080 powerpc mpc824x 2868f862 2014-05-30 Sangmoon Kim <dogoil@etinsys.com> |
include/commproc.h
... | ... | @@ -900,60 +900,6 @@ |
900 | 900 | |
901 | 901 | #endif /* CONFIG_NETVIA */ |
902 | 902 | |
903 | -/*** QS850/QS823 ***************************************************/ | |
904 | - | |
905 | -#if defined(CONFIG_QS850) || defined(CONFIG_QS823) | |
906 | -#undef FEC_ENET /* Don't use FEC for EThernet */ | |
907 | - | |
908 | -#define PROFF_ENET PROFF_SCC2 | |
909 | -#define CPM_CR_ENET CPM_CR_CH_SCC2 | |
910 | -#define SCC_ENET 1 | |
911 | - | |
912 | -#define PA_ENET_RXD ((ushort)0x0004) /* RXD on PA13 (Pin D9) */ | |
913 | -#define PA_ENET_TXD ((ushort)0x0008) /* TXD on PA12 (Pin D7) */ | |
914 | -#define PC_ENET_RENA ((ushort)0x0080) /* RENA on PC8 (Pin D12) */ | |
915 | -#define PC_ENET_CLSN ((ushort)0x0040) /* CLSN on PC9 (Pin C12) */ | |
916 | -#define PA_ENET_TCLK ((ushort)0x0200) /* TCLK on PA6 (Pin D8) */ | |
917 | -#define PA_ENET_RCLK ((ushort)0x0800) /* RCLK on PA4 (Pin D10) */ | |
918 | -#define PB_ENET_TENA ((uint)0x00002000) /* TENA on PB18 (Pin D11) */ | |
919 | -#define PC_ENET_LBK ((ushort)0x0010) /* Loopback control on PC11 (Pin B14) */ | |
920 | -#define PC_ENET_LI ((ushort)0x0020) /* Link Integrity control PC10 (A15) */ | |
921 | -#define PC_ENET_SQE ((ushort)0x0100) /* SQE Disable control PC7 (B15) */ | |
922 | - | |
923 | -/* SCC2 TXCLK from CLK2 | |
924 | - * SCC2 RXCLK from CLK4 | |
925 | - * SCC2 Connected to NMSI */ | |
926 | -#define SICR_ENET_MASK ((uint)0x00007F00) | |
927 | -#define SICR_ENET_CLKRT ((uint)0x00003D00) | |
928 | - | |
929 | -#endif /* CONFIG_QS850/QS823 */ | |
930 | - | |
931 | -/*** QS860T ***************************************************/ | |
932 | - | |
933 | -#ifdef CONFIG_QS860T | |
934 | -#ifdef CONFIG_FEC_ENET | |
935 | -#define FEC_ENET /* use FEC for EThernet */ | |
936 | -#endif /* CONFIG_FEC_ETHERNET */ | |
937 | - | |
938 | -/* This ENET stuff is for GTH 10 Mbit ( SCC ) */ | |
939 | -#define PROFF_ENET PROFF_SCC1 | |
940 | -#define CPM_CR_ENET CPM_CR_CH_SCC1 | |
941 | -#define SCC_ENET 0 | |
942 | - | |
943 | -#define PA_ENET_RXD ((ushort)0x0001) /* PA15 */ | |
944 | -#define PA_ENET_TXD ((ushort)0x0002) /* PA14 */ | |
945 | -#define PA_ENET_TCLK ((ushort)0x0800) /* PA4 */ | |
946 | -#define PA_ENET_RCLK ((ushort)0x0200) /* PA6 */ | |
947 | -#define PB_ENET_TENA ((uint)0x00001000) /* PB19 */ | |
948 | -#define PC_ENET_CLSN ((ushort)0x0010) /* PC11 */ | |
949 | -#define PC_ENET_RENA ((ushort)0x0020) /* PC10 */ | |
950 | - | |
951 | -#define SICR_ENET_MASK ((uint)0x000000ff) | |
952 | -/* RCLK PA4 -->CLK4, TCLK PA6 -->CLK2 */ | |
953 | -#define SICR_ENET_CLKRT ((uint)0x0000003D) | |
954 | - | |
955 | -#endif /* CONFIG_QS860T */ | |
956 | - | |
957 | 903 | /*** RPXLITE ********************************************************/ |
958 | 904 | |
959 | 905 | #ifdef CONFIG_RPXLITE |
include/configs/QS823.h
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2002 | |
6 | - * Simple Network Magic Corporation | |
7 | - * | |
8 | - * (C) Copyright 2000 | |
9 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
10 | - * | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -/* | |
15 | - * board/config.h - configuration options, board specific | |
16 | - */ | |
17 | - | |
18 | -#ifndef __CONFIG_H | |
19 | -#define __CONFIG_H | |
20 | - | |
21 | -/* various debug settings */ | |
22 | -#undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ | |
23 | -#undef CONFIG_SILENT_CONSOLE /* silent console */ | |
24 | -#undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ | |
25 | -#undef DEBUG_FLASH /* debug flash code */ | |
26 | -#undef FLASH_DEBUG /* debug fash code */ | |
27 | -#undef DEBUG_ENV /* debug environment code */ | |
28 | - | |
29 | -#define CONFIG_SYS_DIRECT_FLASH_TFTP 1 /* allow direct tftp to flash */ | |
30 | -#define CONFIG_ENV_OVERWRITE 1 /* allow overwrite MAC address */ | |
31 | - | |
32 | -/* | |
33 | - * High Level Configuration Options | |
34 | - * (easy to change) | |
35 | - */ | |
36 | -#define CONFIG_MPC823 1 /* This is a MPC823 CPU */ | |
37 | -#define CONFIG_QS823 1 /* ...on a QS823 module */ | |
38 | -#define CONFIG_SCC2_ENET 1 /* SCC2 10BaseT ethernet */ | |
39 | - | |
40 | -#define CONFIG_SYS_TEXT_BASE 0xFFF00000 | |
41 | - | |
42 | -/* Select the target clock speed */ | |
43 | -#undef CONFIG_CLOCK_16MHZ /* cpu=16,777,216 Hz, mem=16Mhz */ | |
44 | -#undef CONFIG_CLOCK_33MHZ /* cpu=33,554,432 Hz, mem=33Mhz */ | |
45 | -#undef CONFIG_CLOCK_50MHZ /* cpu=49,971,200 Hz, mem=33Mhz */ | |
46 | -#define CONFIG_CLOCK_66MHZ 1 /* cpu=67,108,864 Hz, mem=66Mhz */ | |
47 | -#undef CONFIG_CLOCK_80MHZ /* cpu=79,986,688 Hz, mem=33Mhz */ | |
48 | - | |
49 | -#ifdef CONFIG_CLOCK_16MHZ | |
50 | -#define CONFIG_CLOCK_MULT 512 | |
51 | -#endif | |
52 | - | |
53 | -#ifdef CONFIG_CLOCK_33MHZ | |
54 | -#define CONFIG_CLOCK_MULT 1024 | |
55 | -#endif | |
56 | - | |
57 | -#ifdef CONFIG_CLOCK_50MHZ | |
58 | -#define CONFIG_CLOCK_MULT 1525 | |
59 | -#endif | |
60 | - | |
61 | -#ifdef CONFIG_CLOCK_66MHZ | |
62 | -#define CONFIG_CLOCK_MULT 2048 | |
63 | -#endif | |
64 | - | |
65 | -#ifdef CONFIG_CLOCK_80MHZ | |
66 | -#define CONFIG_CLOCK_MULT 2441 | |
67 | -#endif | |
68 | - | |
69 | -/* choose flash size, 4Mb or 8Mb */ | |
70 | -#define CONFIG_FLASH_4MB 1 /* board has 4Mb flash */ | |
71 | -#undef CONFIG_FLASH_8MB /* board has 8Mb flash */ | |
72 | - | |
73 | -#define CONFIG_CLOCK_BASE 32768 /* Base clock input freq */ | |
74 | - | |
75 | -#undef CONFIG_8xx_CONS_SMC1 | |
76 | -#define CONFIG_8xx_CONS_SMC2 1 /* Console is on SMC2 */ | |
77 | -#undef CONFIG_8xx_CONS_NONE | |
78 | - | |
79 | -#define CONFIG_BAUDRATE 38400 /* console baudrate = 38.4kbps */ | |
80 | - | |
81 | -#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in MHz */ | |
82 | - | |
83 | -/* Define default IP addresses */ | |
84 | -#define CONFIG_IPADDR 192.168.1.99 /* own ip address */ | |
85 | -#define CONFIG_SERVERIP 192.168.1.19 /* used for tftp (not nfs?) */ | |
86 | - | |
87 | -/* message to say directly after booting */ | |
88 | -#define CONFIG_PREBOOT "echo '';" \ | |
89 | - "echo 'type:';" \ | |
90 | - "echo 'run boot_nfs to boot to NFS';" \ | |
91 | - "echo 'run boot_flash to boot to flash';" \ | |
92 | - "echo '';" \ | |
93 | - "echo 'run flash_rootfs to install a new rootfs';" \ | |
94 | - "echo 'run flash_env to clear the env sector';" \ | |
95 | - "echo 'run flash_rw to clear the rw fs';" \ | |
96 | - "echo 'run flash_uboot to install a new u-boot';" \ | |
97 | - "echo 'run flash_kernel to install a new kernel';" | |
98 | - | |
99 | -/* wait 5 seconds before executing CONFIG_BOOTCOMMAND */ | |
100 | -#define CONFIG_BOOTDELAY 5 | |
101 | -#define CONFIG_BOOTCOMMAND "run boot_nfs" | |
102 | - | |
103 | -#undef CONFIG_BOOTARGS /* made by set_nfs of set_flash */ | |
104 | - | |
105 | -/* Our flash filesystem looks like this | |
106 | - * | |
107 | - * 4Mb board: | |
108 | - * ffc0 0000 - ffeb ffff root filesystem (jffs2) (~3Mb) | |
109 | - * ffec 0000 - ffed ffff read-write filesystem (ext2) | |
110 | - * ffee 0000 - ffef ffff environment | |
111 | - * fff0 0000 - fff1 ffff u-boot | |
112 | - * fff2 0000 - ffff ffff linux kernel | |
113 | - * | |
114 | - * 8Mb board: | |
115 | - * ff80 0000 - ffeb ffff root filesystem (jffs2) (~7Mb) | |
116 | - * ffec 0000 - ffed ffff read-write filesystem (ext2) | |
117 | - * ffee 0000 - ffef ffff environment | |
118 | - * fff0 0000 - fff1 ffff u-boot | |
119 | - * fff2 0000 - ffff ffff linux kernel | |
120 | - * | |
121 | - */ | |
122 | - | |
123 | -/* environment for 4Mb board */ | |
124 | -#ifdef CONFIG_FLASH_4MB | |
125 | -#define CONFIG_EXTRA_ENV_SETTINGS \ | |
126 | - "serial#=QS823\0" \ | |
127 | - "hostname=qs823\0" \ | |
128 | - "netdev=eth0\0" \ | |
129 | - "ethaddr=00:01:02:B4:36:56\0" \ | |
130 | - "rootpath=/exports/rootfs\0" \ | |
131 | - "mtdparts=mtdparts=phys:2816k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \ | |
132 | - /* fill in variables */ \ | |
133 | - "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \ | |
134 | - "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \ | |
135 | - "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \ | |
136 | - /* commands */ \ | |
137 | - "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \ | |
138 | - "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \ | |
139 | - /* reinstall flash parts */ \ | |
140 | - "flash_rootfs=protect off ffc00000 ffebffff; era ffc00000 ffebffff; tftp ffc00000 /tftpboot/rootfs.jffs2\0" \ | |
141 | - "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \ | |
142 | - "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \ | |
143 | - "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.4mb.bin\0" \ | |
144 | - "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0" | |
145 | -#endif /* CONFIG_FLASH_4MB */ | |
146 | - | |
147 | -/* environment for 8Mb board */ | |
148 | -#ifdef CONFIG_FLASH_8MB | |
149 | -#define CONFIG_EXTRA_ENV_SETTINGS \ | |
150 | - "serial#=QS823\0" \ | |
151 | - "hostname=qs823\0" \ | |
152 | - "netdev=eth0\0" \ | |
153 | - "ethaddr=00:01:02:B4:36:56\0" \ | |
154 | - "rootpath=/exports/rootfs\0" \ | |
155 | - "mtdparts=mtdparts=phys:6912k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \ | |
156 | - /* fill in variables */ \ | |
157 | - "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \ | |
158 | - "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \ | |
159 | - "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \ | |
160 | - /* commands */ \ | |
161 | - "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \ | |
162 | - "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \ | |
163 | - /* reinstall flash parts */ \ | |
164 | - "flash_rootfs=protect off ff800000 ffebffff; era ff800000 ffebffff; tftp ff800000 /tftpboot/rootfs.jffs2\0" \ | |
165 | - "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \ | |
166 | - "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \ | |
167 | - "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.8mb.bin\0" \ | |
168 | - "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0" | |
169 | -#endif /* CONFIG_FLASH_8MB */ | |
170 | - | |
171 | -#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ | |
172 | -#undef CONFIG_SYS_LOADS_BAUD_CHANGE /* don't allow baudrate change */ | |
173 | -#undef CONFIG_WATCHDOG /* watchdog disabled */ | |
174 | -#undef CONFIG_STATUS_LED /* Status LED disabled */ | |
175 | -#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */ | |
176 | - | |
177 | -/* | |
178 | - * BOOTP options | |
179 | - */ | |
180 | -#define CONFIG_BOOTP_SUBNETMASK | |
181 | -#define CONFIG_BOOTP_GATEWAY | |
182 | -#define CONFIG_BOOTP_HOSTNAME | |
183 | -#define CONFIG_BOOTP_BOOTPATH | |
184 | -#define CONFIG_BOOTP_BOOTFILESIZE | |
185 | - | |
186 | - | |
187 | -#undef CONFIG_MAC_PARTITION | |
188 | -#undef CONFIG_DOS_PARTITION | |
189 | - | |
190 | -#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ | |
191 | - | |
192 | - | |
193 | -/* | |
194 | - * Command line configuration. | |
195 | - */ | |
196 | -#define CONFIG_CMD_BDI | |
197 | -#define CONFIG_CMD_BOOTD | |
198 | -#define CONFIG_CMD_CONSOLE | |
199 | -#define CONFIG_CMD_DATE | |
200 | -#define CONFIG_CMD_SAVEENV | |
201 | -#define CONFIG_CMD_FLASH | |
202 | -#define CONFIG_CMD_IMI | |
203 | -#define CONFIG_CMD_IMMAP | |
204 | -#define CONFIG_CMD_MEMORY | |
205 | -#define CONFIG_CMD_NET | |
206 | -#define CONFIG_CMD_RUN | |
207 | - | |
208 | - | |
209 | -/*----------------------------------------------------------------------- | |
210 | - * Environment variable storage is in FLASH, one sector before U-boot | |
211 | - */ | |
212 | -#define CONFIG_ENV_IS_IN_FLASH 1 | |
213 | -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128Kb, one whole sector */ | |
214 | -#define CONFIG_ENV_SIZE 0x2000 /* 8kb */ | |
215 | -#define CONFIG_ENV_ADDR 0xffee0000 /* address of env sector */ | |
216 | - | |
217 | -/*----------------------------------------------------------------------- | |
218 | - * Miscellaneous configurable options | |
219 | - */ | |
220 | -#define CONFIG_SYS_LONGHELP /* undef to save memory */ | |
221 | - | |
222 | -#define CONFIG_SYS_HUSH_PARSER 1 /* use "hush" command parser */ | |
223 | - | |
224 | -#if defined(CONFIG_CMD_KGDB) | |
225 | -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ | |
226 | -#else | |
227 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
228 | -#endif | |
229 | -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */ | |
230 | -#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ | |
231 | -#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ | |
232 | - | |
233 | -#define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works */ | |
234 | -#define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */ | |
235 | - | |
236 | -#define CONFIG_SYS_LOAD_ADDR 0x400000 /* default load address */ | |
237 | - | |
238 | -/*----------------------------------------------------------------------- | |
239 | - * Low Level Configuration Settings | |
240 | - * (address mappings, register initial values, etc.) | |
241 | - * You should know what you are doing if you make changes here. | |
242 | - */ | |
243 | - | |
244 | -/*----------------------------------------------------------------------- | |
245 | - * Internal Memory Mapped Register | |
246 | - */ | |
247 | -#define CONFIG_SYS_IMMR 0xFF000000 | |
248 | - | |
249 | -/*----------------------------------------------------------------------- | |
250 | - * Definitions for initial stack pointer and data area (in DPRAM) | |
251 | - */ | |
252 | -#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR | |
253 | -#define CONFIG_SYS_INIT_RAM_SIZE 0x2F00 /* Size of used area in DPRAM */ | |
254 | -#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
255 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET | |
256 | - | |
257 | -/*----------------------------------------------------------------------- | |
258 | - * Start addresses for the final memory configuration | |
259 | - * (Set up by the startup code) | |
260 | - * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 | |
261 | - */ | |
262 | -#define CONFIG_SYS_SDRAM_BASE 0x00000000 | |
263 | -#define CONFIG_SYS_FLASH_BASE 0xFF800000 /* Allow an 8Mbyte window */ | |
264 | - | |
265 | -#define FLASH_BASE0_4M_PRELIM 0xFFC00000 /* Base for 4M Flash */ | |
266 | -#define FLASH_BASE0_8M_PRELIM 0xFF800000 /* Base for 8M Flash */ | |
267 | - | |
268 | -#define CONFIG_SYS_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ | |
269 | -#define CONFIG_SYS_MONITOR_BASE 0xFFF00000 /* U-boot location */ | |
270 | -#define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ | |
271 | - | |
272 | -/* | |
273 | - * For booting Linux, the board info and command line data | |
274 | - * have to be in the first 8 MB of memory, since this is | |
275 | - * the maximum mapped by the Linux kernel during initialization. | |
276 | - */ | |
277 | -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ | |
278 | - | |
279 | -/*----------------------------------------------------------------------- | |
280 | - * TODO flash parameters | |
281 | - * FLASH organization for Intel Strataflash | |
282 | - */ | |
283 | -#undef CONFIG_SYS_FLASH_16BIT /* 32-bit wide flash memory */ | |
284 | -#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */ | |
285 | -#define CONFIG_SYS_MAX_FLASH_SECT 71 /* max number of sectors on one chip */ | |
286 | - | |
287 | -#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */ | |
288 | -#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */ | |
289 | - | |
290 | -/*----------------------------------------------------------------------- | |
291 | - * Cache Configuration | |
292 | - */ | |
293 | -#define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */ | |
294 | -#if defined(CONFIG_CMD_KGDB) | |
295 | -#define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of the above value */ | |
296 | -#endif | |
297 | - | |
298 | -/*----------------------------------------------------------------------- | |
299 | - * SYPCR - System Protection Control 11-9 | |
300 | - * SYPCR can only be written once after reset! | |
301 | - *----------------------------------------------------------------------- | |
302 | - * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze | |
303 | - */ | |
304 | - | |
305 | -#ifdef CONFIG_WATCHDOG | |
306 | -#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWE | SYPCR_SWRI | SYPCR_SWP) | |
307 | -#else | |
308 | -#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWRI | SYPCR_SWP) | |
309 | -#endif | |
310 | - | |
311 | -/*----------------------------------------------------------------------- | |
312 | - * SIUMCR - SIU Module Configuration 11-6 | |
313 | - *----------------------------------------------------------------------- | |
314 | - */ | |
315 | -#define CONFIG_SYS_SIUMCR (SIUMCR_DLK | SIUMCR_DPC | SIUMCR_MPRE | SIUMCR_MLRC01 | SIUMCR_GB5E) | |
316 | - | |
317 | -/*----------------------------------------------------------------------- | |
318 | - * TBSCR - Time Base Status and Control 11-26 | |
319 | - *----------------------------------------------------------------------- | |
320 | - */ | |
321 | -#define CONFIG_SYS_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF) | |
322 | - | |
323 | -/*----------------------------------------------------------------------- | |
324 | - * RTCSC - Real-Time Clock Status and Control Register 11-27 | |
325 | - *----------------------------------------------------------------------- | |
326 | - */ | |
327 | -#define CONFIG_SYS_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE) | |
328 | - | |
329 | -/*----------------------------------------------------------------------- | |
330 | - * PISCR - Periodic Interrupt Status and Control 11-31 | |
331 | - *----------------------------------------------------------------------- | |
332 | - */ | |
333 | -#define CONFIG_SYS_PISCR (PISCR_PS | PISCR_PITF) | |
334 | - | |
335 | -/*----------------------------------------------------------------------- | |
336 | - * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30 | |
337 | - *----------------------------------------------------------------------- | |
338 | - */ | |
339 | - | |
340 | -/* MF (Multiplication Factor of SPLL) */ | |
341 | -/* Sets the QS823 to specified clock from 32KHz clock at EXTAL. */ | |
342 | -#define vPLPRCR_MF ((CONFIG_CLOCK_MULT+1) << 20) | |
343 | -#define CONFIG_SYS_PLPRCR (vPLPRCR_MF | PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST | PLPRCR_LOLRE) | |
344 | - | |
345 | -/*----------------------------------------------------------------------- | |
346 | - * SCCR - System Clock and reset Control Register 15-27 | |
347 | - *----------------------------------------------------------------------- | |
348 | - */ | |
349 | -#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ) | |
350 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG00) | |
351 | -#define CONFIG_SYS_BRGCLK_PRESCALE 1 | |
352 | -#endif | |
353 | - | |
354 | -#if defined(CONFIG_CLOCK_66MHZ) | |
355 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG01) | |
356 | -#define CONFIG_SYS_BRGCLK_PRESCALE 4 | |
357 | -#endif | |
358 | - | |
359 | -#if defined(CONFIG_CLOCK_80MHZ) | |
360 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF01 | SCCR_DFBRG01) | |
361 | -#define CONFIG_SYS_BRGCLK_PRESCALE 4 | |
362 | -#endif | |
363 | - | |
364 | -#define SCCR_MASK CONFIG_SYS_SCCR | |
365 | - | |
366 | -/*----------------------------------------------------------------------- | |
367 | - * Debug Enable Register | |
368 | - * 0x73E67C0F - All interrupts handled by BDM | |
369 | - * 0x00824001 - Only interrupts needed by MWDebug.exe handled by BDM | |
370 | - *----------------------------------------------------------------------- | |
371 | -#define CONFIG_SYS_DER 0x73E67C0F | |
372 | -#define CONFIG_SYS_DER 0x0082400F | |
373 | - | |
374 | - #------------------------------------------------------------------------- | |
375 | - # Program the Debug Enable Register (DER). This register provides the user | |
376 | - # with the reason for entering into the debug mode. We want all conditions | |
377 | - # to end up as an exception. We don't want to enter into debug mode for | |
378 | - # any condition. See the back of of the Development Support section of the | |
379 | - # MPC860 User Manual for a description of this register. | |
380 | - #------------------------------------------------------------------------- | |
381 | -*/ | |
382 | -#define CONFIG_SYS_DER 0 | |
383 | - | |
384 | -/*----------------------------------------------------------------------- | |
385 | - * Memory Controller Initialization Constants | |
386 | - *----------------------------------------------------------------------- | |
387 | - */ | |
388 | - | |
389 | -/* | |
390 | - * BR0 and OR0 (AMD dual FLASH devices) | |
391 | - * Base address = 0xFFF0_0000 - 0xFFF7_FFFF (After relocation) | |
392 | - */ | |
393 | -#define CONFIG_SYS_PRELIM_OR_AM | |
394 | -#define CONFIG_SYS_OR_TIMING_FLASH | |
395 | - | |
396 | -/* | |
397 | - *----------------------------------------------------------------------- | |
398 | - * Base Register 0 (BR0): Bank 0 is assigned to the 8Mbyte (2M X 32) | |
399 | - * flash that resides on the QS823. | |
400 | - *----------------------------------------------------------------------- | |
401 | - */ | |
402 | - | |
403 | -/* BA (Base Address) = 0xFF80+0b for a total of 17 bits. 17 bit base addr */ | |
404 | -/* represents a minumum 32K block size. */ | |
405 | -#define vBR0_BA ((0xFF80 << 16) + (0 << 15)) | |
406 | -#define CONFIG_SYS_BR0_PRELIM (vBR0_BA | BR_V) | |
407 | - | |
408 | -/* AM (Address Mask) = 0xFF80+0b = We've masked the upper 9 bits */ | |
409 | -/* which defines a 8 Mbyte memory block. */ | |
410 | -#define vOR0_AM ((0xFF80 << 16) + (0 << 15)) | |
411 | - | |
412 | -#if defined(CONFIG_CLOCK_50MHZ) || defined(CONFIG_CLOCK_80MHZ) | |
413 | -/* 0101 = Add a 5 clock cycle wait state */ | |
414 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | 0R_ACS_DIV4 | OR_BI | OR_SCY_5_CLK) | |
415 | -#endif | |
416 | - | |
417 | -#if defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_66MHZ) | |
418 | -/* 0011 = Add a 3 clock cycle wait state */ | |
419 | -/* 29.8ns clock * (3 + 2) = 149ns cycle time */ | |
420 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK) | |
421 | -#endif | |
422 | - | |
423 | -#if defined(CONFIG_CLOCK_16MHZ) | |
424 | -/* 0010 = Add a 2 clock cycle wait state */ | |
425 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_2_CLK) | |
426 | -#endif | |
427 | - | |
428 | -/* | |
429 | - * BR1 and OR1 (SDRAM) | |
430 | - * Base Address = 0x00000000 - 0x00FF_FFFF (16M After relocation) | |
431 | - * Base Address = 0x00000000 - 0x01FF_FFFF (32M After relocation) | |
432 | - * Base Address = 0x00000000 - 0x03FF_FFFF (64M After relocation) | |
433 | - * Base Address = 0x00000000 - 0x07FF_FFFF (128M After relocation) | |
434 | - */ | |
435 | - | |
436 | -#define SDRAM_BASE 0x00000000 /* SDRAM bank */ | |
437 | -#define SDRAM_PRELIM_OR_AM 0xF8000000 /* map max. 128 MB */ | |
438 | - | |
439 | -/* AM (Address Mask) = 0xF800+0b = We've masked the upper 5 bits which | |
440 | - * represents a 128 Mbyte block the DRAM in | |
441 | - * this address base. | |
442 | - */ | |
443 | -#define vOR1_AM ((0xF800 << 16) + (0 << 15)) | |
444 | -#define vBR1_BA ((0x0000 << 16) + (0 << 15)) | |
445 | -#define CONFIG_SYS_OR1 (vOR1_AM | OR_CSNT_SAM | OR_BI) | |
446 | -#define CONFIG_SYS_BR1 (vBR1_BA | BR_MS_UPMA | BR_V) | |
447 | - | |
448 | -/* Machine A Mode Register */ | |
449 | - | |
450 | -/* PTA Periodic Timer A */ | |
451 | - | |
452 | -#if defined(CONFIG_CLOCK_80MHZ) | |
453 | -#define vMAMR_PTA (19 << 24) | |
454 | -#endif | |
455 | - | |
456 | -#if defined(CONFIG_CLOCK_66MHZ) | |
457 | -#define vMAMR_PTA (16 << 24) | |
458 | -#endif | |
459 | - | |
460 | -#if defined(CONFIG_CLOCK_50MHZ) | |
461 | -#define vMAMR_PTA (195 << 24) | |
462 | -#endif | |
463 | - | |
464 | -#if defined(CONFIG_CLOCK_33MHZ) | |
465 | -#define vMAMR_PTA (131 << 24) | |
466 | -#endif | |
467 | - | |
468 | -#if defined(CONFIG_CLOCK_16MHZ) | |
469 | -#define vMAMR_PTA (65 << 24) | |
470 | -#endif | |
471 | - | |
472 | -/* For boards with 16M of SDRAM */ | |
473 | -#define SDRAM_16M_MAX_SIZE 0x01000000 /* max 16MB SDRAM */ | |
474 | -#define CONFIG_SYS_16M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_0 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A11 |\ | |
475 | -MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X) | |
476 | - | |
477 | -/* For boards with 32M of SDRAM */ | |
478 | -#define SDRAM_32M_MAX_SIZE 0x02000000 /* max 32MB SDRAM */ | |
479 | -#define CONFIG_SYS_32M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_1 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A10 |\ | |
480 | -MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X) | |
481 | - | |
482 | - | |
483 | -/* Memory Periodic Timer Prescaler Register */ | |
484 | - | |
485 | -#if defined(CONFIG_CLOCK_66MHZ) || defined(CONFIG_CLOCK_80MHZ) | |
486 | -/* Divide by 32 */ | |
487 | -#define CONFIG_SYS_MPTPR 0x02 | |
488 | -#endif | |
489 | - | |
490 | -#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ) | |
491 | -/* Divide by 16 */ | |
492 | -#define CONFIG_SYS_MPTPR 0x04 | |
493 | -#endif | |
494 | - | |
495 | -/* | |
496 | - * BR2 and OR2 (Unused) | |
497 | - * Base address = 0xF020_0000 - 0xF020_0FFF | |
498 | - * | |
499 | - */ | |
500 | -#define CONFIG_SYS_OR2_PRELIM 0xFFF00000 | |
501 | -#define CONFIG_SYS_BR2_PRELIM 0xF0200000 | |
502 | - | |
503 | -/* | |
504 | - * BR3 and OR3 (External Bus CS3) | |
505 | - * Base address = 0xF030_0000 - 0xF030_0FFF | |
506 | - * | |
507 | - */ | |
508 | -#define CONFIG_SYS_OR3_PRELIM 0xFFF00000 | |
509 | -#define CONFIG_SYS_BR3_PRELIM 0xF0300000 | |
510 | - | |
511 | -/* | |
512 | - * BR4 and OR4 (External Bus CS3) | |
513 | - * Base address = 0xF040_0000 - 0xF040_0FFF | |
514 | - * | |
515 | - */ | |
516 | -#define CONFIG_SYS_OR4_PRELIM 0xFFF00000 | |
517 | -#define CONFIG_SYS_BR4_PRELIM 0xF0400000 | |
518 | - | |
519 | - | |
520 | -/* | |
521 | - * BR4 and OR4 (External Bus CS3) | |
522 | - * Base address = 0xF050_0000 - 0xF050_0FFF | |
523 | - * | |
524 | - */ | |
525 | -#define CONFIG_SYS_OR5_PRELIM 0xFFF00000 | |
526 | -#define CONFIG_SYS_BR5_PRELIM 0xF0500000 | |
527 | - | |
528 | -/* | |
529 | - * BR6 and OR6 (Unused) | |
530 | - * Base address = 0xF060_0000 - 0xF060_0FFF | |
531 | - * | |
532 | - */ | |
533 | -#define CONFIG_SYS_OR6_PRELIM 0xFFF00000 | |
534 | -#define CONFIG_SYS_BR6_PRELIM 0xF0600000 | |
535 | - | |
536 | -/* | |
537 | - * BR7 and OR7 (Unused) | |
538 | - * Base address = 0xF070_0000 - 0xF070_0FFF | |
539 | - * | |
540 | - */ | |
541 | -#define CONFIG_SYS_OR7_PRELIM 0xFFF00000 | |
542 | -#define CONFIG_SYS_BR7_PRELIM 0xF0700000 | |
543 | - | |
544 | -/* | |
545 | - * Sanity checks | |
546 | - */ | |
547 | -#if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET) | |
548 | -#error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured | |
549 | -#endif | |
550 | - | |
551 | -#endif /* __CONFIG_H */ |
include/configs/QS850.h
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2002 | |
6 | - * Simple Network Magic Corporation | |
7 | - * | |
8 | - * (C) Copyright 2000 | |
9 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
10 | - * | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -/* | |
15 | - * board/config.h - configuration options, board specific | |
16 | - */ | |
17 | - | |
18 | -#ifndef __CONFIG_H | |
19 | -#define __CONFIG_H | |
20 | - | |
21 | -/* various debug settings */ | |
22 | -#undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ | |
23 | -#undef CONFIG_SILENT_CONSOLE /* silent console */ | |
24 | -#undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ | |
25 | -#undef DEBUG_FLASH /* debug flash code */ | |
26 | -#undef FLASH_DEBUG /* debug fash code */ | |
27 | -#undef DEBUG_ENV /* debug environment code */ | |
28 | - | |
29 | -#define CONFIG_SYS_DIRECT_FLASH_TFTP 1 /* allow direct tftp to flash */ | |
30 | -#define CONFIG_ENV_OVERWRITE 1 /* allow overwrite MAC address */ | |
31 | - | |
32 | -/* | |
33 | - * High Level Configuration Options | |
34 | - * (easy to change) | |
35 | - */ | |
36 | -#define CONFIG_MPC850 1 /* This is a MPC850 CPU */ | |
37 | -#define CONFIG_QS850 1 /* ...on a QS850 module */ | |
38 | -#define CONFIG_SCC2_ENET 1 /* SCC2 10BaseT ethernet */ | |
39 | - | |
40 | -#define CONFIG_SYS_TEXT_BASE 0xFFF00000 | |
41 | - | |
42 | -/* Select the target clock speed */ | |
43 | -#undef CONFIG_CLOCK_16MHZ /* cpu=16,777,216 Hz, mem=16Mhz */ | |
44 | -#undef CONFIG_CLOCK_33MHZ /* cpu=33,554,432 Hz, mem=33Mhz */ | |
45 | -#undef CONFIG_CLOCK_50MHZ /* cpu=49,971,200 Hz, mem=33Mhz */ | |
46 | -#define CONFIG_CLOCK_66MHZ 1 /* cpu=67,108,864 Hz, mem=66Mhz */ | |
47 | -#undef CONFIG_CLOCK_80MHZ /* cpu=79,986,688 Hz, mem=33Mhz */ | |
48 | - | |
49 | -#ifdef CONFIG_CLOCK_16MHZ | |
50 | -#define CONFIG_CLOCK_MULT 512 | |
51 | -#endif | |
52 | - | |
53 | -#ifdef CONFIG_CLOCK_33MHZ | |
54 | -#define CONFIG_CLOCK_MULT 1024 | |
55 | -#endif | |
56 | - | |
57 | -#ifdef CONFIG_CLOCK_50MHZ | |
58 | -#define CONFIG_CLOCK_MULT 1525 | |
59 | -#endif | |
60 | - | |
61 | -#ifdef CONFIG_CLOCK_66MHZ | |
62 | -#define CONFIG_CLOCK_MULT 2048 | |
63 | -#endif | |
64 | - | |
65 | -#ifdef CONFIG_CLOCK_80MHZ | |
66 | -#define CONFIG_CLOCK_MULT 2441 | |
67 | -#endif | |
68 | - | |
69 | -/* choose flash size, 4Mb or 8Mb */ | |
70 | -#define CONFIG_FLASH_4MB 1 /* board has 4Mb flash */ | |
71 | -#undef CONFIG_FLASH_8MB /* board has 8Mb flash */ | |
72 | - | |
73 | -#define CONFIG_CLOCK_BASE 32768 /* Base clock input freq */ | |
74 | - | |
75 | -#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */ | |
76 | -#undef CONFIG_8xx_CONS_SMC2 | |
77 | -#undef CONFIG_8xx_CONS_NONE | |
78 | - | |
79 | -#define CONFIG_BAUDRATE 38400 /* console baudrate = 38.4kbps */ | |
80 | - | |
81 | -#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in MHz */ | |
82 | - | |
83 | -/* Define default IP addresses */ | |
84 | -#define CONFIG_IPADDR 192.168.1.99 /* own ip address */ | |
85 | -#define CONFIG_SERVERIP 192.168.1.19 /* used for tftp (not nfs?) */ | |
86 | - | |
87 | -/* message to say directly after booting */ | |
88 | -#define CONFIG_PREBOOT "echo '';" \ | |
89 | - "echo 'type:';" \ | |
90 | - "echo 'run boot_nfs to boot to NFS';" \ | |
91 | - "echo 'run boot_flash to boot to flash';" \ | |
92 | - "echo '';" \ | |
93 | - "echo 'run flash_rootfs to install a new rootfs';" \ | |
94 | - "echo 'run flash_env to clear the env sector';" \ | |
95 | - "echo 'run flash_rw to clear the rw fs';" \ | |
96 | - "echo 'run flash_uboot to install a new u-boot';" \ | |
97 | - "echo 'run flash_kernel to install a new kernel';" | |
98 | - | |
99 | -/* wait 5 seconds before executing CONFIG_BOOTCOMMAND */ | |
100 | -#define CONFIG_BOOTDELAY 5 | |
101 | -#define CONFIG_BOOTCOMMAND "run boot_nfs" | |
102 | - | |
103 | -#undef CONFIG_BOOTARGS /* made by set_nfs of set_flash */ | |
104 | - | |
105 | -/* Our flash filesystem looks like this | |
106 | - * | |
107 | - * 4Mb board: | |
108 | - * ffc0 0000 - ffeb ffff root filesystem (jffs2) (~3Mb) | |
109 | - * ffec 0000 - ffed ffff read-write filesystem (ext2) | |
110 | - * ffee 0000 - ffef ffff environment | |
111 | - * fff0 0000 - fff1 ffff u-boot | |
112 | - * fff2 0000 - ffff ffff linux kernel | |
113 | - * | |
114 | - * 8Mb board: | |
115 | - * ff80 0000 - ffeb ffff root filesystem (jffs2) (~7Mb) | |
116 | - * ffec 0000 - ffed ffff read-write filesystem (ext2) | |
117 | - * ffee 0000 - ffef ffff environment | |
118 | - * fff0 0000 - fff1 ffff u-boot | |
119 | - * fff2 0000 - ffff ffff linux kernel | |
120 | - * | |
121 | - */ | |
122 | - | |
123 | -/* environment for 4Mb board */ | |
124 | -#ifdef CONFIG_FLASH_4MB | |
125 | -#define CONFIG_EXTRA_ENV_SETTINGS \ | |
126 | - "serial#=QS850\0" \ | |
127 | - "hostname=qs850\0" \ | |
128 | - "netdev=eth0\0" \ | |
129 | - "ethaddr=00:01:02:B4:36:56\0" \ | |
130 | - "rootpath=/exports/rootfs\0" \ | |
131 | - "mtdparts=mtdparts=phys:2816k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \ | |
132 | - /* fill in variables */ \ | |
133 | - "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \ | |
134 | - "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \ | |
135 | - "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \ | |
136 | - /* commands */ \ | |
137 | - "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \ | |
138 | - "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \ | |
139 | - /* reinstall flash parts */ \ | |
140 | - "flash_rootfs=protect off ffc00000 ffebffff; era ffc00000 ffebffff; tftp ffc00000 /tftpboot/rootfs.jffs2\0" \ | |
141 | - "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \ | |
142 | - "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \ | |
143 | - "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.4mb.bin\0" \ | |
144 | - "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0" | |
145 | -#endif /* CONFIG_FLASH_4MB */ | |
146 | - | |
147 | -/* environment for 8Mb board */ | |
148 | -#ifdef CONFIG_FLASH_8MB | |
149 | -#define CONFIG_EXTRA_ENV_SETTINGS \ | |
150 | - "serial#=QS850\0" \ | |
151 | - "hostname=qs850\0" \ | |
152 | - "netdev=eth0\0" \ | |
153 | - "ethaddr=00:01:02:B4:36:56\0" \ | |
154 | - "rootpath=/exports/rootfs\0" \ | |
155 | - "mtdparts=mtdparts=phys:6912k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \ | |
156 | - /* fill in variables */ \ | |
157 | - "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \ | |
158 | - "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \ | |
159 | - "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \ | |
160 | - /* commands */ \ | |
161 | - "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \ | |
162 | - "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \ | |
163 | - /* reinstall flash parts */ \ | |
164 | - "flash_rootfs=protect off ff800000 ffebffff; era ff800000 ffebffff; tftp ff800000 /tftpboot/rootfs.jffs2\0" \ | |
165 | - "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \ | |
166 | - "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \ | |
167 | - "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.8mb.bin\0" \ | |
168 | - "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0" | |
169 | -#endif /* CONFIG_FLASH_8MB */ | |
170 | - | |
171 | -#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ | |
172 | -#undef CONFIG_SYS_LOADS_BAUD_CHANGE /* don't allow baudrate change */ | |
173 | -#undef CONFIG_WATCHDOG /* watchdog disabled */ | |
174 | -#undef CONFIG_STATUS_LED /* Status LED disabled */ | |
175 | -#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */ | |
176 | - | |
177 | -/* | |
178 | - * BOOTP options | |
179 | - */ | |
180 | -#define CONFIG_BOOTP_SUBNETMASK | |
181 | -#define CONFIG_BOOTP_GATEWAY | |
182 | -#define CONFIG_BOOTP_HOSTNAME | |
183 | -#define CONFIG_BOOTP_BOOTPATH | |
184 | -#define CONFIG_BOOTP_BOOTFILESIZE | |
185 | - | |
186 | -#undef CONFIG_MAC_PARTITION | |
187 | -#undef CONFIG_DOS_PARTITION | |
188 | - | |
189 | -#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ | |
190 | - | |
191 | - | |
192 | -/* | |
193 | - * Command line configuration. | |
194 | - */ | |
195 | - | |
196 | -#define CONFIG_CMD_BDI | |
197 | -#define CONFIG_CMD_BOOTD | |
198 | -#define CONFIG_CMD_CONSOLE | |
199 | -#define CONFIG_CMD_DATE | |
200 | -#define CONFIG_CMD_SAVEENV | |
201 | -#define CONFIG_CMD_FLASH | |
202 | -#define CONFIG_CMD_IMI | |
203 | -#define CONFIG_CMD_IMMAP | |
204 | -#define CONFIG_CMD_MEMORY | |
205 | -#define CONFIG_CMD_NET | |
206 | -#define CONFIG_CMD_RUN | |
207 | - | |
208 | - | |
209 | -/*----------------------------------------------------------------------- | |
210 | - * Environment variable storage is in FLASH, one sector before U-boot | |
211 | - */ | |
212 | -#define CONFIG_ENV_IS_IN_FLASH 1 | |
213 | -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128Kb, one whole sector */ | |
214 | -#define CONFIG_ENV_SIZE 0x2000 /* 8kb */ | |
215 | -#define CONFIG_ENV_ADDR 0xffee0000 /* address of env sector */ | |
216 | - | |
217 | -/*----------------------------------------------------------------------- | |
218 | - * Miscellaneous configurable options | |
219 | - */ | |
220 | -#define CONFIG_SYS_LONGHELP /* undef to save memory */ | |
221 | - | |
222 | -#define CONFIG_SYS_HUSH_PARSER 1 /* use "hush" command parser */ | |
223 | - | |
224 | -#if defined(CONFIG_CMD_KGDB) | |
225 | -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ | |
226 | -#else | |
227 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
228 | -#endif | |
229 | -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */ | |
230 | -#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ | |
231 | -#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ | |
232 | - | |
233 | -#define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works */ | |
234 | -#define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */ | |
235 | - | |
236 | -#define CONFIG_SYS_LOAD_ADDR 0x400000 /* default load address */ | |
237 | - | |
238 | -/*----------------------------------------------------------------------- | |
239 | - * Low Level Configuration Settings | |
240 | - * (address mappings, register initial values, etc.) | |
241 | - * You should know what you are doing if you make changes here. | |
242 | - */ | |
243 | - | |
244 | -/*----------------------------------------------------------------------- | |
245 | - * Internal Memory Mapped Register | |
246 | - */ | |
247 | -#define CONFIG_SYS_IMMR 0xFF000000 | |
248 | - | |
249 | -/*----------------------------------------------------------------------- | |
250 | - * Definitions for initial stack pointer and data area (in DPRAM) | |
251 | - */ | |
252 | -#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR | |
253 | -#define CONFIG_SYS_INIT_RAM_SIZE 0x2F00 /* Size of used area in DPRAM */ | |
254 | -#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
255 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET | |
256 | - | |
257 | -/*----------------------------------------------------------------------- | |
258 | - * Start addresses for the final memory configuration | |
259 | - * (Set up by the startup code) | |
260 | - * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 | |
261 | - */ | |
262 | -#define CONFIG_SYS_SDRAM_BASE 0x00000000 | |
263 | -#define CONFIG_SYS_FLASH_BASE 0xFF800000 /* Allow an 8Mbyte window */ | |
264 | - | |
265 | -#define FLASH_BASE0_4M_PRELIM 0xFFC00000 /* Base for 4M Flash */ | |
266 | -#define FLASH_BASE0_8M_PRELIM 0xFF800000 /* Base for 8M Flash */ | |
267 | - | |
268 | -#define CONFIG_SYS_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ | |
269 | -#define CONFIG_SYS_MONITOR_BASE 0xFFF00000 /* U-boot location */ | |
270 | -#define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ | |
271 | - | |
272 | -/* | |
273 | - * For booting Linux, the board info and command line data | |
274 | - * have to be in the first 8 MB of memory, since this is | |
275 | - * the maximum mapped by the Linux kernel during initialization. | |
276 | - */ | |
277 | -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ | |
278 | - | |
279 | -/*----------------------------------------------------------------------- | |
280 | - * TODO flash parameters | |
281 | - * FLASH organization for Intel Strataflash | |
282 | - */ | |
283 | -#undef CONFIG_SYS_FLASH_16BIT /* 32-bit wide flash memory */ | |
284 | -#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */ | |
285 | -#define CONFIG_SYS_MAX_FLASH_SECT 71 /* max number of sectors on one chip */ | |
286 | - | |
287 | -#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */ | |
288 | -#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */ | |
289 | - | |
290 | -/*----------------------------------------------------------------------- | |
291 | - * Cache Configuration | |
292 | - */ | |
293 | -#define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */ | |
294 | -#if defined(CONFIG_CMD_KGDB) | |
295 | -#define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of the above value */ | |
296 | -#endif | |
297 | - | |
298 | -/*----------------------------------------------------------------------- | |
299 | - * SYPCR - System Protection Control 11-9 | |
300 | - * SYPCR can only be written once after reset! | |
301 | - *----------------------------------------------------------------------- | |
302 | - * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze | |
303 | - */ | |
304 | - | |
305 | -#ifdef CONFIG_WATCHDOG | |
306 | -#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWE | SYPCR_SWRI | SYPCR_SWP) | |
307 | -#else | |
308 | -#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWRI | SYPCR_SWP) | |
309 | -#endif | |
310 | - | |
311 | -/*----------------------------------------------------------------------- | |
312 | - * SIUMCR - SIU Module Configuration 11-6 | |
313 | - *----------------------------------------------------------------------- | |
314 | - */ | |
315 | -#define CONFIG_SYS_SIUMCR (SIUMCR_DLK | SIUMCR_DPC | SIUMCR_MPRE | SIUMCR_MLRC01 | SIUMCR_GB5E) | |
316 | - | |
317 | -/*----------------------------------------------------------------------- | |
318 | - * TBSCR - Time Base Status and Control 11-26 | |
319 | - *----------------------------------------------------------------------- | |
320 | - */ | |
321 | -#define CONFIG_SYS_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF) | |
322 | - | |
323 | -/*----------------------------------------------------------------------- | |
324 | - * RTCSC - Real-Time Clock Status and Control Register 11-27 | |
325 | - *----------------------------------------------------------------------- | |
326 | - */ | |
327 | -#define CONFIG_SYS_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE) | |
328 | - | |
329 | -/*----------------------------------------------------------------------- | |
330 | - * PISCR - Periodic Interrupt Status and Control 11-31 | |
331 | - *----------------------------------------------------------------------- | |
332 | - */ | |
333 | -#define CONFIG_SYS_PISCR (PISCR_PS | PISCR_PITF) | |
334 | - | |
335 | -/*----------------------------------------------------------------------- | |
336 | - * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30 | |
337 | - *----------------------------------------------------------------------- | |
338 | - */ | |
339 | - | |
340 | -/* MF (Multiplication Factor of SPLL) */ | |
341 | -/* Sets the QS850 to specified clock from 32KHz clock at EXTAL. */ | |
342 | -#define vPLPRCR_MF ((CONFIG_CLOCK_MULT+1) << 20) | |
343 | -#define CONFIG_SYS_PLPRCR (vPLPRCR_MF | PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST | PLPRCR_LOLRE) | |
344 | - | |
345 | -/*----------------------------------------------------------------------- | |
346 | - * SCCR - System Clock and reset Control Register 15-27 | |
347 | - *----------------------------------------------------------------------- | |
348 | - */ | |
349 | -#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ) | |
350 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG00) | |
351 | -#define CONFIG_SYS_BRGCLK_PRESCALE 1 | |
352 | -#endif | |
353 | - | |
354 | -#if defined(CONFIG_CLOCK_66MHZ) | |
355 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG01) | |
356 | -#define CONFIG_SYS_BRGCLK_PRESCALE 4 | |
357 | -#endif | |
358 | - | |
359 | -#if defined(CONFIG_CLOCK_80MHZ) | |
360 | -#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF01 | SCCR_DFBRG01) | |
361 | -#define CONFIG_SYS_BRGCLK_PRESCALE 4 | |
362 | -#endif | |
363 | - | |
364 | -#define SCCR_MASK CONFIG_SYS_SCCR | |
365 | - | |
366 | -/*----------------------------------------------------------------------- | |
367 | - * Debug Enable Register | |
368 | - * 0x73E67C0F - All interrupts handled by BDM | |
369 | - * 0x00824001 - Only interrupts needed by MWDebug.exe handled by BDM | |
370 | - *----------------------------------------------------------------------- | |
371 | -#define CONFIG_SYS_DER 0x73E67C0F | |
372 | -#define CONFIG_SYS_DER 0x0082400F | |
373 | - | |
374 | - #------------------------------------------------------------------------- | |
375 | - # Program the Debug Enable Register (DER). This register provides the user | |
376 | - # with the reason for entering into the debug mode. We want all conditions | |
377 | - # to end up as an exception. We don't want to enter into debug mode for | |
378 | - # any condition. See the back of of the Development Support section of the | |
379 | - # MPC860 User Manual for a description of this register. | |
380 | - #------------------------------------------------------------------------- | |
381 | -*/ | |
382 | -#define CONFIG_SYS_DER 0 | |
383 | - | |
384 | -/*----------------------------------------------------------------------- | |
385 | - * Memory Controller Initialization Constants | |
386 | - *----------------------------------------------------------------------- | |
387 | - */ | |
388 | - | |
389 | -/* | |
390 | - * BR0 and OR0 (AMD dual FLASH devices) | |
391 | - * Base address = 0xFFF0_0000 - 0xFFF7_FFFF (After relocation) | |
392 | - */ | |
393 | -#define CONFIG_SYS_PRELIM_OR_AM | |
394 | -#define CONFIG_SYS_OR_TIMING_FLASH | |
395 | - | |
396 | -/* | |
397 | - *----------------------------------------------------------------------- | |
398 | - * Base Register 0 (BR0): Bank 0 is assigned to the 8Mbyte (2M X 32) | |
399 | - * flash that resides on the QS850. | |
400 | - *----------------------------------------------------------------------- | |
401 | - */ | |
402 | - | |
403 | -/* BA (Base Address) = 0xFF80+0b for a total of 17 bits. 17 bit base addr */ | |
404 | -/* represents a minumum 32K block size. */ | |
405 | -#define vBR0_BA ((0xFF80 << 16) + (0 << 15)) | |
406 | -#define CONFIG_SYS_BR0_PRELIM (vBR0_BA | BR_V) | |
407 | - | |
408 | -/* AM (Address Mask) = 0xFF80+0b = We've masked the upper 9 bits */ | |
409 | -/* which defines a 8 Mbyte memory block. */ | |
410 | -#define vOR0_AM ((0xFF80 << 16) + (0 << 15)) | |
411 | - | |
412 | -#if defined(CONFIG_CLOCK_50MHZ) || defined(CONFIG_CLOCK_80MHZ) | |
413 | -/* 0101 = Add a 5 clock cycle wait state */ | |
414 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | 0R_ACS_DIV4 | OR_BI | OR_SCY_5_CLK) | |
415 | -#endif | |
416 | - | |
417 | -#if defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_66MHZ) | |
418 | -/* 0011 = Add a 3 clock cycle wait state */ | |
419 | -/* 29.8ns clock * (3 + 2) = 149ns cycle time */ | |
420 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK) | |
421 | -#endif | |
422 | - | |
423 | -#if defined(CONFIG_CLOCK_16MHZ) | |
424 | -/* 0010 = Add a 2 clock cycle wait state */ | |
425 | -#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_2_CLK) | |
426 | -#endif | |
427 | - | |
428 | -/* | |
429 | - * BR1 and OR1 (SDRAM) | |
430 | - * Base Address = 0x00000000 - 0x00FF_FFFF (16M After relocation) | |
431 | - * Base Address = 0x00000000 - 0x01FF_FFFF (32M After relocation) | |
432 | - * Base Address = 0x00000000 - 0x03FF_FFFF (64M After relocation) | |
433 | - * Base Address = 0x00000000 - 0x07FF_FFFF (128M After relocation) | |
434 | - */ | |
435 | - | |
436 | -#define SDRAM_BASE 0x00000000 /* SDRAM bank */ | |
437 | -#define SDRAM_PRELIM_OR_AM 0xF8000000 /* map max. 128 MB */ | |
438 | - | |
439 | -/* AM (Address Mask) = 0xF800+0b = We've masked the upper 5 bits which | |
440 | - * represents a 128 Mbyte block the DRAM in | |
441 | - * this address base. | |
442 | - */ | |
443 | -#define vOR1_AM ((0xF800 << 16) + (0 << 15)) | |
444 | -#define vBR1_BA ((0x0000 << 16) + (0 << 15)) | |
445 | -#define CONFIG_SYS_OR1 (vOR1_AM | OR_CSNT_SAM | OR_BI) | |
446 | -#define CONFIG_SYS_BR1 (vBR1_BA | BR_MS_UPMA | BR_V) | |
447 | - | |
448 | -/* Machine A Mode Register */ | |
449 | - | |
450 | -/* PTA Periodic Timer A */ | |
451 | - | |
452 | -#if defined(CONFIG_CLOCK_80MHZ) | |
453 | -#define vMAMR_PTA (19 << 24) | |
454 | -#endif | |
455 | - | |
456 | -#if defined(CONFIG_CLOCK_66MHZ) | |
457 | -#define vMAMR_PTA (16 << 24) | |
458 | -#endif | |
459 | - | |
460 | -#if defined(CONFIG_CLOCK_50MHZ) | |
461 | -#define vMAMR_PTA (195 << 24) | |
462 | -#endif | |
463 | - | |
464 | -#if defined(CONFIG_CLOCK_33MHZ) | |
465 | -#define vMAMR_PTA (131 << 24) | |
466 | -#endif | |
467 | - | |
468 | -#if defined(CONFIG_CLOCK_16MHZ) | |
469 | -#define vMAMR_PTA (65 << 24) | |
470 | -#endif | |
471 | - | |
472 | -/* For boards with 16M of SDRAM */ | |
473 | -#define SDRAM_16M_MAX_SIZE 0x01000000 /* max 16MB SDRAM */ | |
474 | -#define CONFIG_SYS_16M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_0 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A11 |\ | |
475 | -MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X) | |
476 | - | |
477 | -/* For boards with 32M of SDRAM */ | |
478 | -#define SDRAM_32M_MAX_SIZE 0x02000000 /* max 32MB SDRAM */ | |
479 | -#define CONFIG_SYS_32M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_1 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A10 |\ | |
480 | -MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X) | |
481 | - | |
482 | - | |
483 | -/* Memory Periodic Timer Prescaler Register */ | |
484 | - | |
485 | -#if defined(CONFIG_CLOCK_66MHZ) || defined(CONFIG_CLOCK_80MHZ) | |
486 | -/* Divide by 32 */ | |
487 | -#define CONFIG_SYS_MPTPR 0x02 | |
488 | -#endif | |
489 | - | |
490 | -#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ) | |
491 | -/* Divide by 16 */ | |
492 | -#define CONFIG_SYS_MPTPR 0x04 | |
493 | -#endif | |
494 | - | |
495 | -/* | |
496 | - * BR2 and OR2 (Unused) | |
497 | - * Base address = 0xF020_0000 - 0xF020_0FFF | |
498 | - * | |
499 | - */ | |
500 | -#define CONFIG_SYS_OR2_PRELIM 0xFFF00000 | |
501 | -#define CONFIG_SYS_BR2_PRELIM 0xF0200000 | |
502 | - | |
503 | -/* | |
504 | - * BR3 and OR3 (External Bus CS3) | |
505 | - * Base address = 0xF030_0000 - 0xF030_0FFF | |
506 | - * | |
507 | - */ | |
508 | -#define CONFIG_SYS_OR3_PRELIM 0xFFF00000 | |
509 | -#define CONFIG_SYS_BR3_PRELIM 0xF0300000 | |
510 | - | |
511 | -/* | |
512 | - * BR4 and OR4 (External Bus CS3) | |
513 | - * Base address = 0xF040_0000 - 0xF040_0FFF | |
514 | - * | |
515 | - */ | |
516 | -#define CONFIG_SYS_OR4_PRELIM 0xFFF00000 | |
517 | -#define CONFIG_SYS_BR4_PRELIM 0xF0400000 | |
518 | - | |
519 | - | |
520 | -/* | |
521 | - * BR4 and OR4 (External Bus CS3) | |
522 | - * Base address = 0xF050_0000 - 0xF050_0FFF | |
523 | - * | |
524 | - */ | |
525 | -#define CONFIG_SYS_OR5_PRELIM 0xFFF00000 | |
526 | -#define CONFIG_SYS_BR5_PRELIM 0xF0500000 | |
527 | - | |
528 | -/* | |
529 | - * BR6 and OR6 (Unused) | |
530 | - * Base address = 0xF060_0000 - 0xF060_0FFF | |
531 | - * | |
532 | - */ | |
533 | -#define CONFIG_SYS_OR6_PRELIM 0xFFF00000 | |
534 | -#define CONFIG_SYS_BR6_PRELIM 0xF0600000 | |
535 | - | |
536 | -/* | |
537 | - * BR7 and OR7 (Unused) | |
538 | - * Base address = 0xF070_0000 - 0xF070_0FFF | |
539 | - * | |
540 | - */ | |
541 | -#define CONFIG_SYS_OR7_PRELIM 0xFFF00000 | |
542 | -#define CONFIG_SYS_BR7_PRELIM 0xF0700000 | |
543 | - | |
544 | -/* | |
545 | - * Sanity checks | |
546 | - */ | |
547 | -#if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET) | |
548 | -#error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured | |
549 | -#endif | |
550 | - | |
551 | -#endif /* __CONFIG_H */ |
include/configs/QS860T.h
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * MuLogic B.V. | |
4 | - * | |
5 | - * (C) Copyright 2002 | |
6 | - * Simple Network Magic Corporation | |
7 | - * | |
8 | - * (C) Copyright 2000 | |
9 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
10 | - * | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -/* | |
15 | - * board/config.h - configuration options, board specific | |
16 | - */ | |
17 | - | |
18 | -#ifndef __CONFIG_H | |
19 | -#define __CONFIG_H | |
20 | - | |
21 | -/* various debug settings */ | |
22 | -#undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ | |
23 | -#undef CONFIG_SILENT_CONSOLE /* silent console */ | |
24 | -#undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ | |
25 | -#undef DEBUG_FLASH /* debug flash code */ | |
26 | -#undef FLASH_DEBUG /* debug fash code */ | |
27 | -#undef DEBUG_ENV /* debug environment code */ | |
28 | - | |
29 | -#define CONFIG_SYS_DIRECT_FLASH_TFTP 1 /* allow direct tftp to flash */ | |
30 | -#define CONFIG_ENV_OVERWRITE 1 /* allow overwrite MAC address */ | |
31 | - | |
32 | - | |
33 | -/* | |
34 | - * High Level Configuration Options | |
35 | - * (easy to change) | |
36 | - */ | |
37 | - | |
38 | -#define CONFIG_MPC860 1 /* This is a MPC860 CPU */ | |
39 | -#define CONFIG_QS860T 1 /* ...on a QS860T module */ | |
40 | - | |
41 | -/* Start address of 512K Socketed Flash */ | |
42 | -#define CONFIG_SYS_TEXT_BASE 0xFFF00000 | |
43 | - | |
44 | -#define CONFIG_FEC_ENET 1 /* FEC 10/100BaseT ethernet */ | |
45 | -#define CONFIG_MII | |
46 | -#define FEC_INTERRUPT SIU_LEVEL1 | |
47 | -#undef CONFIG_SCC1_ENET /* SCC1 10BaseT ethernet */ | |
48 | -#define CONFIG_SYS_DISCOVER_PHY | |
49 | - | |
50 | -#undef CONFIG_8xx_CONS_SMC1 | |
51 | -#define CONFIG_8xx_CONS_SMC2 1 /* Console is on SMC */ | |
52 | -#undef CONFIG_8xx_CONS_NONE | |
53 | - | |
54 | -#define CONFIG_BAUDRATE 38400 /* console baudrate = 38.4kbps */ | |
55 | - | |
56 | -#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ | |
57 | - | |
58 | -/* Pass clocks to Linux 2.4.18 in Hz */ | |
59 | -#undef CONFIG_CLOCKS_IN_MHZ /* clocks passsed to Linux in MHz */ | |
60 | - | |
61 | -#define CONFIG_PREBOOT "echo;" \ | |
62 | - "echo 'Type \\\"run flash_nfs\\\" to mount root filesystem over NFS';" \ | |
63 | - "echo" | |
64 | - | |
65 | -#undef CONFIG_BOOTARGS | |
66 | -/* TODO compare against CADM860 */ | |
67 | -#define CONFIG_BOOTCOMMAND "bootp; " \ | |
68 | - "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} " \ | |
69 | - "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \ | |
70 | - "bootm" | |
71 | - | |
72 | -#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ | |
73 | -#undef CONFIG_SYS_LOADS_BAUD_CHANGE /* don't allow baudrate change */ | |
74 | - | |
75 | -#undef CONFIG_WATCHDOG /* watchdog disabled */ | |
76 | - | |
77 | -#undef CONFIG_STATUS_LED /* Status LED disabled */ | |
78 | - | |
79 | -#undef CONFIG_CAN_DRIVER /* CAN Driver support disabled */ | |
80 | - | |
81 | -/* | |
82 | - * BOOTP options | |
83 | - */ | |
84 | -#define CONFIG_BOOTP_SUBNETMASK | |
85 | -#define CONFIG_BOOTP_GATEWAY | |
86 | -#define CONFIG_BOOTP_HOSTNAME | |
87 | -#define CONFIG_BOOTP_BOOTPATH | |
88 | -#define CONFIG_BOOTP_BOOTFILESIZE | |
89 | - | |
90 | - | |
91 | -#define CONFIG_MAC_PARTITION | |
92 | -#define CONFIG_DOS_PARTITION | |
93 | - | |
94 | -#define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ | |
95 | - | |
96 | - | |
97 | -/* | |
98 | - * Command line configuration. | |
99 | - */ | |
100 | -#include <config_cmd_default.h> | |
101 | - | |
102 | -#define CONFIG_CMD_REGINFO | |
103 | -#define CONFIG_CMD_IMMAP | |
104 | -#define CONFIG_CMD_ASKENV | |
105 | -#define CONFIG_CMD_NET | |
106 | -#define CONFIG_CMD_DHCP | |
107 | -#define CONFIG_CMD_DATE | |
108 | - | |
109 | - | |
110 | -/* TODO */ | |
111 | -#if 0 | |
112 | -/* Look at these */ | |
113 | -CONFIG_IPADDR | |
114 | -CONFIG_SERVERIP | |
115 | -CONFIG_I2C | |
116 | -CONFIG_SPI | |
117 | -#endif | |
118 | - | |
119 | -/* | |
120 | - * Environment variable storage is in NVRAM | |
121 | - */ | |
122 | -#define CONFIG_ENV_IS_IN_NVRAM 1 | |
123 | -#define CONFIG_ENV_SIZE 0x00001000 /* We use only the last 4K for PPCBoot */ | |
124 | -#define CONFIG_ENV_ADDR 0xD100E000 | |
125 | - | |
126 | -/* | |
127 | - * Miscellaneous configurable options | |
128 | - */ | |
129 | -#define CONFIG_SYS_LONGHELP /* undef to save memory */ | |
130 | - | |
131 | -#define CONFIG_SYS_HUSH_PARSER 1 /* use "hush" command parser */ | |
132 | - | |
133 | -#if defined(CONFIG_CMD_KGDB) | |
134 | -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ | |
135 | -#else | |
136 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
137 | -#endif | |
138 | -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */ | |
139 | -#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ | |
140 | -#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ | |
141 | - | |
142 | -/* TODO - size? */ | |
143 | -#define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works */ | |
144 | -#define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */ | |
145 | - | |
146 | -#define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */ | |
147 | - | |
148 | -/*----------------------------------------------------------------------- | |
149 | - * Low Level Configuration Settings | |
150 | - * (address mappings, register initial values, etc.) | |
151 | - * You should know what you are doing if you make changes here. | |
152 | - */ | |
153 | -/*----------------------------------------------------------------------- | |
154 | - * Internal Memory Mapped Register | |
155 | - */ | |
156 | -#define CONFIG_SYS_IMMR 0xF0000000 | |
157 | - | |
158 | -/*----------------------------------------------------------------------- | |
159 | - * Definitions for initial stack pointer and data area (in DPRAM) | |
160 | - */ | |
161 | -#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR | |
162 | -#define CONFIG_SYS_INIT_RAM_SIZE 0x2F00 /* Size of used area in DPRAM */ | |
163 | -#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
164 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET | |
165 | - | |
166 | -/*----------------------------------------------------------------------- | |
167 | - * Start addresses for the final memory configuration | |
168 | - * (Set up by the startup code) | |
169 | - * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 | |
170 | - */ | |
171 | -#define CONFIG_SYS_SDRAM_BASE 0x00000000 | |
172 | -#define CONFIG_SYS_FLASH_BASE 0xFFF00000 | |
173 | - | |
174 | -#define CONFIG_SYS_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ | |
175 | -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE | |
176 | -#define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ | |
177 | - | |
178 | -/* | |
179 | - * For booting Linux, the board info and command line data | |
180 | - * have to be in the first 8 MB of memory, since this is | |
181 | - * the maximum mapped by the Linux kernel during initialization. | |
182 | - */ | |
183 | -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ | |
184 | - | |
185 | -/* TODO flash parameters */ | |
186 | -/*----------------------------------------------------------------------- | |
187 | - * FLASH organization for Intel Strataflash | |
188 | - */ | |
189 | -#define CONFIG_SYS_FLASH_16BIT 1 /* 16-bit wide flash memory */ | |
190 | -#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */ | |
191 | -#define CONFIG_SYS_MAX_FLASH_SECT 64 /* max number of sectors on one chip */ | |
192 | - | |
193 | -#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */ | |
194 | -#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */ | |
195 | - | |
196 | -#undef CONFIG_ENV_IS_IN_FLASH | |
197 | - | |
198 | -/*----------------------------------------------------------------------- | |
199 | - * Cache Configuration | |
200 | - */ | |
201 | -#define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */ | |
202 | -#if defined(CONFIG_CMD_KGDB) | |
203 | -#define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of the above value */ | |
204 | -#endif | |
205 | - | |
206 | -/*----------------------------------------------------------------------- | |
207 | - * SYPCR - System Protection Control 11-9 | |
208 | - * SYPCR can only be written once after reset! | |
209 | - *----------------------------------------------------------------------- | |
210 | - * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze | |
211 | - */ | |
212 | -#if defined(CONFIG_WATCHDOG) | |
213 | -#define CONFIG_SYS_SYPCR (0xFFFFFF88 | SYPCR_SWE | SYPCR_SWRI) | |
214 | -#else | |
215 | -#define CONFIG_SYS_SYPCR 0xFFFFFF88 | |
216 | -#endif | |
217 | - | |
218 | -/*----------------------------------------------------------------------- | |
219 | - * SIUMCR - SIU Module Configuration 11-6 | |
220 | - *----------------------------------------------------------------------- | |
221 | - */ | |
222 | -#define CONFIG_SYS_SIUMCR 0x00620000 | |
223 | - | |
224 | -/*----------------------------------------------------------------------- | |
225 | - * TBSCR - Time Base Status and Control 11-26 | |
226 | - *----------------------------------------------------------------------- | |
227 | - */ | |
228 | -#define CONFIG_SYS_TBSCR 0x00C3 | |
229 | - | |
230 | -/*----------------------------------------------------------------------- | |
231 | - * RTCSC - Real-Time Clock Status and Control Register 11-27 | |
232 | - *----------------------------------------------------------------------- | |
233 | - */ | |
234 | -#define CONFIG_SYS_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE) | |
235 | - | |
236 | -/*----------------------------------------------------------------------- | |
237 | - * PISCR - Periodic Interrupt Status and Control 11-31 | |
238 | - *----------------------------------------------------------------------- | |
239 | - */ | |
240 | -#define CONFIG_SYS_PISCR 0x0082 | |
241 | - | |
242 | -/*----------------------------------------------------------------------- | |
243 | - * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30 | |
244 | - *----------------------------------------------------------------------- | |
245 | - */ | |
246 | -#define CONFIG_SYS_PLPRCR 0x0090D000 | |
247 | - | |
248 | -/*----------------------------------------------------------------------- | |
249 | - * SCCR - System Clock and reset Control Register 15-27 | |
250 | - *----------------------------------------------------------------------- | |
251 | - */ | |
252 | -#define SCCR_MASK SCCR_EBDF11 | |
253 | -#define CONFIG_SYS_SCCR 0x02000000 | |
254 | - | |
255 | - | |
256 | -/*----------------------------------------------------------------------- | |
257 | - * Debug Enable Register | |
258 | - * 0x73E67C0F - All interrupts handled by BDM | |
259 | - * 0x00824001 - Only interrupts needed by MWDebug.exe handled by BDM | |
260 | - *----------------------------------------------------------------------- | |
261 | -#define CONFIG_SYS_DER 0x73E67C0F | |
262 | -*/ | |
263 | -#define CONFIG_SYS_DER 0x0082400F | |
264 | - | |
265 | - | |
266 | -/*----------------------------------------------------------------------- | |
267 | - * Memory Controller Initialization Constants | |
268 | - *----------------------------------------------------------------------- | |
269 | - */ | |
270 | - | |
271 | -/* | |
272 | - * BR0 and OR0 (AMD 512K Socketed FLASH) | |
273 | - * Base address = 0xFFF0_0000 - 0xFFF7_FFFF (After relocation) | |
274 | - */ | |
275 | -#define CONFIG_SYS_PRELIM_OR_AM | |
276 | -#define CONFIG_SYS_OR_TIMING_FLASH | |
277 | - | |
278 | -#define FLASH_BASE0_PRELIM 0xFFF00001 | |
279 | -#define CONFIG_SYS_OR0_PRELIM 0xFFF80D42 | |
280 | -#define CONFIG_SYS_BR0_PRELIM 0xFFF00401 | |
281 | - | |
282 | - | |
283 | -/* | |
284 | - * BR1 and OR1 (Intel 8M StrataFLASH) | |
285 | - * Base address = 0xD000_0000 - 0xD07F_FFFF | |
286 | - */ | |
287 | - | |
288 | -#define FLASH_BASE1_PRELIM 0xD0000000 | |
289 | -#define CONFIG_SYS_OR1_PRELIM 0xFF800D42 | |
290 | -#define CONFIG_SYS_BR1_PRELIM 0xD0000801 | |
291 | -/* #define CONFIG_SYS_OR1 0xFF800D42 */ | |
292 | -/* #define CONFIG_SYS_BR1 0xD0000801 */ | |
293 | - | |
294 | - | |
295 | -/* | |
296 | - * BR2 and OR2 (SDRAM) | |
297 | - * Base Address = 0x00000000 - 0x00FF_FFFF (16M After relocation) | |
298 | - * Base Address = 0x00000000 - 0x03FF_FFFF (64M After relocation) | |
299 | - * Base Address = 0x00000000 - 0x07FF_FFFF (128M After relocation) | |
300 | - * | |
301 | - */ | |
302 | -#define SDRAM_BASE 0x00000000 /* SDRAM bank */ | |
303 | -#define SDRAM_PRELIM_OR_AM 0xF8000000 /* map max. 128 MB */ | |
304 | - | |
305 | -/* SDRAM timing */ | |
306 | -#define SDRAM_TIMING 0x00000A00 | |
307 | - | |
308 | -/* For boards with 16M of SDRAM */ | |
309 | -#define SDRAM_16M_MAX_SIZE 0x01000000 /* max 16MB SDRAM */ | |
310 | -#define CONFIG_SYS_16M_MBMR 0x18802114 /* Mem Periodic Timer Prescaler */ | |
311 | - | |
312 | -/* For boards with 64M of SDRAM */ | |
313 | -#define SDRAM_64M_MAX_SIZE 0x04000000 /* max 64MB SDRAM */ | |
314 | -/* TODO - determine real value */ | |
315 | -#define CONFIG_SYS_64M_MBMR 0x18802114 /* Mem Period Timer Prescaler */ | |
316 | - | |
317 | -#define CONFIG_SYS_OR2 (SDRAM_PRELIM_OR_AM | SDRAM_TIMING) | |
318 | -#define CONFIG_SYS_BR2 (SDRAM_BASE | 0x000000C1) | |
319 | - | |
320 | - | |
321 | -/* | |
322 | - * BR3 and OR3 (NVRAM, Sipex, NAND Flash) | |
323 | - * Base address = 0xD100_0000 - 0xD100_FFFF (64K NVRAM) | |
324 | - * Base address = 0xD108_0000 - 0xD108_0000 (Sipex chip ctl register) | |
325 | - * Base address = 0xD110_0000 - 0xD110_0000 (NAND ctl register) | |
326 | - * Base address = 0xD138_0000 - 0xD138_0000 (LED ctl register) | |
327 | - * | |
328 | - */ | |
329 | - | |
330 | -#define CONFIG_SYS_OR3_PRELIM 0xFFC00DF6 | |
331 | -#define CONFIG_SYS_BR3_PRELIM 0xD1000401 | |
332 | -/* #define CONFIG_SYS_OR3 0xFFC00DF6 */ | |
333 | -/* #define CONFIG_SYS_BR3 0xD1000401 */ | |
334 | - | |
335 | - | |
336 | -/* | |
337 | - * BR4 and OR4 (Unused) | |
338 | - * Base address = 0xE000_0000 - 0xE3FF_FFFF | |
339 | - * | |
340 | - */ | |
341 | - | |
342 | -#define CONFIG_SYS_OR4_PRELIM 0xFF000000 | |
343 | -#define CONFIG_SYS_BR4_PRELIM 0xE0000000 | |
344 | -/* #define CONFIG_SYS_OR4 0xFF000000 */ | |
345 | -/* #define CONFIG_SYS_BR4 0xE0000000 */ | |
346 | - | |
347 | - | |
348 | -/* | |
349 | - * BR5 and OR5 (Expansion bus) | |
350 | - * Base address = 0xE400_0000 - 0xE7FF_FFFF | |
351 | - * | |
352 | - */ | |
353 | - | |
354 | -#define CONFIG_SYS_OR5_PRELIM 0xFF000000 | |
355 | -#define CONFIG_SYS_BR5_PRELIM 0xE4000000 | |
356 | -/* #define CONFIG_SYS_OR5 0xFF000000 */ | |
357 | -/* #define CONFIG_SYS_BR5 0xE4000000 */ | |
358 | - | |
359 | - | |
360 | -/* | |
361 | - * BR6 and OR6 (Expansion bus) | |
362 | - * Base address = 0xE800_0000 - 0xEBFF_FFFF | |
363 | - * | |
364 | - */ | |
365 | - | |
366 | -#define CONFIG_SYS_OR6_PRELIM 0xFF000000 | |
367 | -#define CONFIG_SYS_BR6_PRELIM 0xE8000000 | |
368 | -/* #define CONFIG_SYS_OR6 0xFF000000 */ | |
369 | -/* #define CONFIG_SYS_BR6 0xE8000000 */ | |
370 | - | |
371 | - | |
372 | -/* | |
373 | - * BR7 and OR7 (Expansion bus) | |
374 | - * Base address = 0xEC00_0000 - 0xEFFF_FFFF | |
375 | - * | |
376 | - */ | |
377 | - | |
378 | -#define CONFIG_SYS_OR7_PRELIM 0xFF000000 | |
379 | -#define CONFIG_SYS_BR7_PRELIM 0xE8000000 | |
380 | -/* #define CONFIG_SYS_OR7 0xFF000000 */ | |
381 | -/* #define CONFIG_SYS_BR7 0xE8000000 */ | |
382 | - | |
383 | -/* | |
384 | - * Sanity checks | |
385 | - */ | |
386 | -#if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET) | |
387 | -#error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured | |
388 | -#endif | |
389 | - | |
390 | -#endif /* __CONFIG_H */ |