1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#ifndef __CONFIG_H
35#define __CONFIG_H
36
37
38#undef CONFIG_SYS_DEVICE_NULLDEV
39#undef CONFIG_SILENT_CONSOLE
40#undef CONFIG_SYS_CONSOLE_INFO_QUIET
41#undef DEBUG_FLASH
42#undef FLASH_DEBUG
43#undef DEBUG_ENV
44
45#define CONFIG_SYS_DIRECT_FLASH_TFTP 1
46#define CONFIG_ENV_OVERWRITE 1
47
48
49
50
51
52#define CONFIG_MPC823 1
53#define CONFIG_QS823 1
54#define CONFIG_SCC2_ENET 1
55
56#define CONFIG_SYS_TEXT_BASE 0xFFF00000
57
58
59#undef CONFIG_CLOCK_16MHZ
60#undef CONFIG_CLOCK_33MHZ
61#undef CONFIG_CLOCK_50MHZ
62#define CONFIG_CLOCK_66MHZ 1
63#undef CONFIG_CLOCK_80MHZ
64
65#ifdef CONFIG_CLOCK_16MHZ
66#define CONFIG_CLOCK_MULT 512
67#endif
68
69#ifdef CONFIG_CLOCK_33MHZ
70#define CONFIG_CLOCK_MULT 1024
71#endif
72
73#ifdef CONFIG_CLOCK_50MHZ
74#define CONFIG_CLOCK_MULT 1525
75#endif
76
77#ifdef CONFIG_CLOCK_66MHZ
78#define CONFIG_CLOCK_MULT 2048
79#endif
80
81#ifdef CONFIG_CLOCK_80MHZ
82#define CONFIG_CLOCK_MULT 2441
83#endif
84
85
86#define CONFIG_FLASH_4MB 1
87#undef CONFIG_FLASH_8MB
88
89#define CONFIG_CLOCK_BASE 32768
90
91#undef CONFIG_8xx_CONS_SMC1
92#define CONFIG_8xx_CONS_SMC2 1
93#undef CONFIG_8xx_CONS_NONE
94
95#define CONFIG_BAUDRATE 38400
96
97#undef CONFIG_CLOCKS_IN_MHZ
98
99
100#define CONFIG_IPADDR 192.168.1.99
101#define CONFIG_SERVERIP 192.168.1.19
102
103
104#define CONFIG_PREBOOT "echo '';" \
105 "echo 'type:';" \
106 "echo 'run boot_nfs to boot to NFS';" \
107 "echo 'run boot_flash to boot to flash';" \
108 "echo '';" \
109 "echo 'run flash_rootfs to install a new rootfs';" \
110 "echo 'run flash_env to clear the env sector';" \
111 "echo 'run flash_rw to clear the rw fs';" \
112 "echo 'run flash_uboot to install a new u-boot';" \
113 "echo 'run flash_kernel to install a new kernel';"
114
115
116#define CONFIG_BOOTDELAY 5
117#define CONFIG_BOOTCOMMAND "run boot_nfs"
118
119#undef CONFIG_BOOTARGS
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140#ifdef CONFIG_FLASH_4MB
141#define CONFIG_EXTRA_ENV_SETTINGS \
142 "serial#=QS823\0" \
143 "hostname=qs823\0" \
144 "netdev=eth0\0" \
145 "ethaddr=00:01:02:B4:36:56\0" \
146 "rootpath=/exports/rootfs\0" \
147 "mtdparts=mtdparts=phys:2816k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \
148 \
149 "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \
150 "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \
151 "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \
152 \
153 "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \
154 "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \
155 \
156 "flash_rootfs=protect off ffc00000 ffebffff; era ffc00000 ffebffff; tftp ffc00000 /tftpboot/rootfs.jffs2\0" \
157 "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \
158 "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \
159 "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.4mb.bin\0" \
160 "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0"
161#endif
162
163
164#ifdef CONFIG_FLASH_8MB
165#define CONFIG_EXTRA_ENV_SETTINGS \
166 "serial#=QS823\0" \
167 "hostname=qs823\0" \
168 "netdev=eth0\0" \
169 "ethaddr=00:01:02:B4:36:56\0" \
170 "rootpath=/exports/rootfs\0" \
171 "mtdparts=mtdparts=phys:6912k(root),128k(rw),128k(env),128k(u-boot),-(kernel)\0" \
172 \
173 "set_ip=setenv ip ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off\0" \
174 "set_nfs=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath $ip init=/sbin/init $mtdparts\0" \
175 "set_flash=setenv bootargs root=/dev/mtdblock1 ro $ip init=/sbin/init $mtdparts\0" \
176 \
177 "boot_nfs=run set_ip; run set_nfs; tftp 0x400000 /tftpboot/vmlinux.UBoot; bootm 0x400000\0" \
178 "boot_flash=run set_ip; run set_flash; bootm fff20000\0" \
179 \
180 "flash_rootfs=protect off ff800000 ffebffff; era ff800000 ffebffff; tftp ff800000 /tftpboot/rootfs.jffs2\0" \
181 "flash_rw=protect off ffec0000 ffedffff; era ffec0000 ffedffff\0" \
182 "flash_env=protect off ffee0000 ffefffff; era ffee0000 ffefffff\0" \
183 "flash_uboot=protect off fff00000 fff1ffff; era fff00000 fff1ffff; tftp fff00000 /tftpboot/u-boot.8mb.bin\0" \
184 "flash_kernel=protect off fff20000 ffffffff; era fff20000 ffffffff; tftp fff20000 /tftpboot/vmlinux.UBoot\0"
185#endif
186
187#define CONFIG_LOADS_ECHO 1
188#undef CONFIG_SYS_LOADS_BAUD_CHANGE
189#undef CONFIG_WATCHDOG
190#undef CONFIG_STATUS_LED
191#undef CONFIG_CAN_DRIVER
192
193
194
195
196#define CONFIG_BOOTP_SUBNETMASK
197#define CONFIG_BOOTP_GATEWAY
198#define CONFIG_BOOTP_HOSTNAME
199#define CONFIG_BOOTP_BOOTPATH
200#define CONFIG_BOOTP_BOOTFILESIZE
201
202
203#undef CONFIG_MAC_PARTITION
204#undef CONFIG_DOS_PARTITION
205
206#define CONFIG_RTC_MPC8xx
207
208
209
210
211
212#define CONFIG_CMD_BDI
213#define CONFIG_CMD_BOOTD
214#define CONFIG_CMD_CONSOLE
215#define CONFIG_CMD_DATE
216#define CONFIG_CMD_SAVEENV
217#define CONFIG_CMD_FLASH
218#define CONFIG_CMD_IMI
219#define CONFIG_CMD_IMMAP
220#define CONFIG_CMD_MEMORY
221#define CONFIG_CMD_NET
222#define CONFIG_CMD_RUN
223
224
225
226
227
228#define CONFIG_ENV_IS_IN_FLASH 1
229#define CONFIG_ENV_SECT_SIZE 0x20000
230#define CONFIG_ENV_SIZE 0x2000
231#define CONFIG_ENV_ADDR 0xffee0000
232
233
234
235
236#define CONFIG_SYS_LONGHELP
237#define CONFIG_SYS_PROMPT "=> "
238
239#define CONFIG_SYS_HUSH_PARSER 1
240#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
241
242#if defined(CONFIG_CMD_KGDB)
243#define CONFIG_SYS_CBSIZE 1024
244#else
245#define CONFIG_SYS_CBSIZE 256
246#endif
247#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
248#define CONFIG_SYS_MAXARGS 16
249#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
250
251#define CONFIG_SYS_MEMTEST_START 0x0400000
252#define CONFIG_SYS_MEMTEST_END 0x0C00000
253
254#define CONFIG_SYS_LOAD_ADDR 0x400000
255
256#define CONFIG_SYS_HZ 1000
257
258#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
259
260
261
262
263
264
265
266
267
268
269#define CONFIG_SYS_IMMR 0xFF000000
270
271
272
273
274#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
275#define CONFIG_SYS_INIT_RAM_SIZE 0x2F00
276#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
277#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
278
279
280
281
282
283
284#define CONFIG_SYS_SDRAM_BASE 0x00000000
285#define CONFIG_SYS_FLASH_BASE 0xFF800000
286
287#define FLASH_BASE0_4M_PRELIM 0xFFC00000
288#define FLASH_BASE0_8M_PRELIM 0xFF800000
289
290#define CONFIG_SYS_MONITOR_LEN (192 << 10)
291#define CONFIG_SYS_MONITOR_BASE 0xFFF00000
292#define CONFIG_SYS_MALLOC_LEN (128 << 10)
293
294
295
296
297
298
299#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
300
301
302
303
304
305#undef CONFIG_SYS_FLASH_16BIT
306#define CONFIG_SYS_MAX_FLASH_BANKS 1
307#define CONFIG_SYS_MAX_FLASH_SECT 71
308
309#define CONFIG_SYS_FLASH_ERASE_TOUT 120000
310#define CONFIG_SYS_FLASH_WRITE_TOUT 500
311
312
313
314
315#define CONFIG_SYS_CACHELINE_SIZE 16
316#if defined(CONFIG_CMD_KGDB)
317#define CONFIG_SYS_CACHELINE_SHIFT 4
318#endif
319
320
321
322
323
324
325
326
327#ifdef CONFIG_WATCHDOG
328#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWE | SYPCR_SWRI | SYPCR_SWP)
329#else
330#define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWRI | SYPCR_SWP)
331#endif
332
333
334
335
336
337#define CONFIG_SYS_SIUMCR (SIUMCR_DLK | SIUMCR_DPC | SIUMCR_MPRE | SIUMCR_MLRC01 | SIUMCR_GB5E)
338
339
340
341
342
343#define CONFIG_SYS_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
344
345
346
347
348
349#define CONFIG_SYS_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)
350
351
352
353
354
355#define CONFIG_SYS_PISCR (PISCR_PS | PISCR_PITF)
356
357
358
359
360
361
362
363
364#define vPLPRCR_MF ((CONFIG_CLOCK_MULT+1) << 20)
365#define CONFIG_SYS_PLPRCR (vPLPRCR_MF | PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST | PLPRCR_LOLRE)
366
367
368
369
370
371#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ)
372#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG00)
373#define CONFIG_SYS_BRGCLK_PRESCALE 1
374#endif
375
376#if defined(CONFIG_CLOCK_66MHZ)
377#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF00 | SCCR_DFBRG01)
378#define CONFIG_SYS_BRGCLK_PRESCALE 4
379#endif
380
381#if defined(CONFIG_CLOCK_80MHZ)
382#define CONFIG_SYS_SCCR (SCCR_TBS | SCCR_EBDF01 | SCCR_DFBRG01)
383#define CONFIG_SYS_BRGCLK_PRESCALE 4
384#endif
385
386#define SCCR_MASK CONFIG_SYS_SCCR
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404#define CONFIG_SYS_DER 0
405
406
407
408
409
410
411
412
413
414
415#define CONFIG_SYS_PRELIM_OR_AM
416#define CONFIG_SYS_OR_TIMING_FLASH
417
418
419
420
421
422
423
424
425
426
427#define vBR0_BA ((0xFF80 << 16) + (0 << 15))
428#define CONFIG_SYS_BR0_PRELIM (vBR0_BA | BR_V)
429
430
431
432#define vOR0_AM ((0xFF80 << 16) + (0 << 15))
433
434#if defined(CONFIG_CLOCK_50MHZ) || defined(CONFIG_CLOCK_80MHZ)
435
436#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | 0R_ACS_DIV4 | OR_BI | OR_SCY_5_CLK)
437#endif
438
439#if defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_66MHZ)
440
441
442#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK)
443#endif
444
445#if defined(CONFIG_CLOCK_16MHZ)
446
447#define CONFIG_SYS_OR0_PRELIM (vOR0_AM | OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_2_CLK)
448#endif
449
450
451
452
453
454
455
456
457
458#define SDRAM_BASE 0x00000000
459#define SDRAM_PRELIM_OR_AM 0xF8000000
460
461
462
463
464
465#define vOR1_AM ((0xF800 << 16) + (0 << 15))
466#define vBR1_BA ((0x0000 << 16) + (0 << 15))
467#define CONFIG_SYS_OR1 (vOR1_AM | OR_CSNT_SAM | OR_BI)
468#define CONFIG_SYS_BR1 (vBR1_BA | BR_MS_UPMA | BR_V)
469
470
471
472
473
474#if defined(CONFIG_CLOCK_80MHZ)
475#define vMAMR_PTA (19 << 24)
476#endif
477
478#if defined(CONFIG_CLOCK_66MHZ)
479#define vMAMR_PTA (16 << 24)
480#endif
481
482#if defined(CONFIG_CLOCK_50MHZ)
483#define vMAMR_PTA (195 << 24)
484#endif
485
486#if defined(CONFIG_CLOCK_33MHZ)
487#define vMAMR_PTA (131 << 24)
488#endif
489
490#if defined(CONFIG_CLOCK_16MHZ)
491#define vMAMR_PTA (65 << 24)
492#endif
493
494
495#define SDRAM_16M_MAX_SIZE 0x01000000
496#define CONFIG_SYS_16M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_0 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A11 |\
497MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
498
499
500#define SDRAM_32M_MAX_SIZE 0x02000000
501#define CONFIG_SYS_32M_MAMR (vMAMR_PTA | MAMR_AMA_TYPE_1 | MAMR_DSA_2_CYCL | MAMR_G0CLA_A10 |\
502MAMR_RLFA_1X | MAMR_WLFA_1X | MAMR_TLFA_4X)
503
504
505
506
507#if defined(CONFIG_CLOCK_66MHZ) || defined(CONFIG_CLOCK_80MHZ)
508
509#define CONFIG_SYS_MPTPR 0x02
510#endif
511
512#if defined(CONFIG_CLOCK_16MHZ) || defined(CONFIG_CLOCK_33MHZ) || defined(CONFIG_CLOCK_50MHZ)
513
514#define CONFIG_SYS_MPTPR 0x04
515#endif
516
517
518
519
520
521
522#define CONFIG_SYS_OR2_PRELIM 0xFFF00000
523#define CONFIG_SYS_BR2_PRELIM 0xF0200000
524
525
526
527
528
529
530#define CONFIG_SYS_OR3_PRELIM 0xFFF00000
531#define CONFIG_SYS_BR3_PRELIM 0xF0300000
532
533
534
535
536
537
538#define CONFIG_SYS_OR4_PRELIM 0xFFF00000
539#define CONFIG_SYS_BR4_PRELIM 0xF0400000
540
541
542
543
544
545
546
547#define CONFIG_SYS_OR5_PRELIM 0xFFF00000
548#define CONFIG_SYS_BR5_PRELIM 0xF0500000
549
550
551
552
553
554
555#define CONFIG_SYS_OR6_PRELIM 0xFFF00000
556#define CONFIG_SYS_BR6_PRELIM 0xF0600000
557
558
559
560
561
562
563#define CONFIG_SYS_OR7_PRELIM 0xFFF00000
564#define CONFIG_SYS_BR7_PRELIM 0xF0700000
565
566
567
568
569#if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET)
570#error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured
571#endif
572
573#endif
574