blob: 2962c915aa0d548d0e002aa3c8ba7e38ca76b185 [file] [log] [blame]
wdenk5b1d7132002-11-03 00:07:02 +00001/*
2 * (C) Copyright 2000
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 * Keith Outwater, keith_outwater@mvis.com
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
wdenk5b1d7132002-11-03 00:07:02 +00007 */
8
9/*
10 * board/config_GEN860T.h - board specific configuration options
11 */
12
13#ifndef __CONFIG_GEN860T_H
14#define __CONFIG_H
15
16/*
17 * High Level Configuration Options
18 */
19#define CONFIG_MPC860
20#define CONFIG_GEN860T
21
Wolfgang Denk2ae18242010-10-06 09:05:45 +020022#define CONFIG_SYS_TEXT_BASE 0x40000000
23
wdenk5b1d7132002-11-03 00:07:02 +000024/*
25 * Identify the board
26 */
wdenk7aa78612003-05-03 15:50:43 +000027#if !defined(CONFIG_SC)
Wolfgang Denk53677ef2008-05-20 16:00:29 +020028#define CONFIG_IDENT_STRING " B2"
wdenk7aa78612003-05-03 15:50:43 +000029#else
Wolfgang Denk53677ef2008-05-20 16:00:29 +020030#define CONFIG_IDENT_STRING " SC"
wdenk7aa78612003-05-03 15:50:43 +000031#endif
wdenk5b1d7132002-11-03 00:07:02 +000032
33/*
34 * Don't depend on the RTC clock to determine clock frequency -
35 * the 860's internal rtc uses a 32.768 KHz clock which is
36 * generated by the DS1337 - and the DS1337 clock can be turned off.
37 */
wdenk7aa78612003-05-03 15:50:43 +000038#if !defined(CONFIG_SC)
Wolfgang Denk53677ef2008-05-20 16:00:29 +020039#define CONFIG_8xx_GCLK_FREQ 66600000
wdenk7aa78612003-05-03 15:50:43 +000040#else
Wolfgang Denk53677ef2008-05-20 16:00:29 +020041#define CONFIG_8xx_GCLK_FREQ 48000000
wdenk7aa78612003-05-03 15:50:43 +000042#endif
wdenk5b1d7132002-11-03 00:07:02 +000043
44/*
45 * The RS-232 console port is on SMC1
46 */
47#define CONFIG_8xx_CONS_SMC1
Wolfgang Denk53677ef2008-05-20 16:00:29 +020048#define CONFIG_BAUDRATE 38400
wdenk5b1d7132002-11-03 00:07:02 +000049
50/*
wdenk5b1d7132002-11-03 00:07:02 +000051 * Print console information
52 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020053#undef CONFIG_SYS_CONSOLE_INFO_QUIET
wdenk5b1d7132002-11-03 00:07:02 +000054
55/*
56 * Set the autoboot delay in seconds. A delay of -1 disables autoboot
57 */
58#define CONFIG_BOOTDELAY 5
59
60/*
61 * Pass the clock frequency to the Linux kernel in units of MHz
62 */
63#define CONFIG_CLOCKS_IN_MHZ
64
65#define CONFIG_PREBOOT \
66 "echo;echo"
67
68#undef CONFIG_BOOTARGS
69#define CONFIG_BOOTCOMMAND \
70 "bootp;" \
Wolfgang Denkfe126d82005-11-20 21:40:11 +010071 "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} " \
72 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
wdenk5b1d7132002-11-03 00:07:02 +000073 "bootm"
74
75/*
76 * Turn off echo for serial download by default. Allow baud rate to be changed
77 * for downloads
78 */
79#undef CONFIG_LOADS_ECHO
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020080#define CONFIG_SYS_LOADS_BAUD_CHANGE
wdenk5b1d7132002-11-03 00:07:02 +000081
82/*
wdenk5b1d7132002-11-03 00:07:02 +000083 * Turn off the watchdog timer
84 */
85#undef CONFIG_WATCHDOG
86
87/*
88 * Do not reboot if a panic occurs
89 */
90#define CONFIG_PANIC_HANG
91
92/*
93 * Enable the status LED
94 */
95#define CONFIG_STATUS_LED
96
97/*
98 * Reset address. We pick an address such that when an instruction
99 * is executed at that address, a machine check exception occurs
100 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200101#define CONFIG_SYS_RESET_ADDRESS ((ulong) -1)
wdenk5b1d7132002-11-03 00:07:02 +0000102
103/*
104 * BOOTP options
105 */
Jon Loeliger5d2ebe12007-07-09 21:16:53 -0500106#define CONFIG_BOOTP_SUBNETMASK
107#define CONFIG_BOOTP_GATEWAY
108#define CONFIG_BOOTP_HOSTNAME
109#define CONFIG_BOOTP_BOOTPATH
110#define CONFIG_BOOTP_BOOTFILESIZE
111
wdenk5b1d7132002-11-03 00:07:02 +0000112
113/*
114 * The GEN860T network interface uses the on-chip 10/100 FEC with
115 * an Intel LXT971A PHY connected to the 860T's MII. The PHY's
116 * MII address is hardwired on the board to zero.
117 */
118#define CONFIG_FEC_ENET
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200119#define CONFIG_SYS_DISCOVER_PHY
wdenk5b1d7132002-11-03 00:07:02 +0000120#define CONFIG_MII
TsiChung Liew0f3ba7e2008-03-30 01:22:13 -0500121#define CONFIG_MII_INIT 1
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200122#define CONFIG_PHY_ADDR 0
wdenk5b1d7132002-11-03 00:07:02 +0000123
124/*
125 * Set default IP stuff just to get bootstrap entries into the
Wolfgang Denk74de7ae2009-04-01 23:34:12 +0200126 * environment so that we can source the full default environment.
wdenk5b1d7132002-11-03 00:07:02 +0000127 */
128#define CONFIG_ETHADDR 9a:52:63:15:85:25
wdenk7aa78612003-05-03 15:50:43 +0000129#define CONFIG_SERVERIP 10.0.4.201
wdenk5b1d7132002-11-03 00:07:02 +0000130#define CONFIG_IPADDR 10.0.4.111
131
132/*
133 * This board has a 32 kibibyte EEPROM (Atmel AT24C256) connected to
134 * the MPC860T I2C interface.
135 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200136#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
137#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6 /* 64 byte pages */
138#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 12 /* 10 mS w/ 20% margin */
139#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 /* need 16 bit address */
Jean-Christophe PLAGNIOL-VILLARD0e8d1582008-09-10 22:48:06 +0200140#define CONFIG_ENV_EEPROM_SIZE (32 * 1024)
wdenk5b1d7132002-11-03 00:07:02 +0000141
wdenk5b1d7132002-11-03 00:07:02 +0000142/*
wdenk7aa78612003-05-03 15:50:43 +0000143 * Enable I2C and select the hardware/software driver
wdenk5b1d7132002-11-03 00:07:02 +0000144 */
wdenk7aa78612003-05-03 15:50:43 +0000145#define CONFIG_HARD_I2C 1 /* CPM based I2C */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200146#undef CONFIG_SOFT_I2C /* Bit-banged I2C */
wdenk7aa78612003-05-03 15:50:43 +0000147
148#ifdef CONFIG_HARD_I2C
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200149#define CONFIG_SYS_I2C_SPEED 100000 /* clock speed in Hz */
150#define CONFIG_SYS_I2C_SLAVE 0xFE /* I2C slave address */
wdenk7aa78612003-05-03 15:50:43 +0000151#endif
152
153#ifdef CONFIG_SOFT_I2C
wdenk5b1d7132002-11-03 00:07:02 +0000154#define PB_SCL 0x00000020 /* PB 26 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200155#define PB_SDA 0x00000010 /* PB 27 */
wdenk5b1d7132002-11-03 00:07:02 +0000156#define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
157#define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
158#define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
159#define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
160#define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
161 else immr->im_cpm.cp_pbdat &= ~PB_SDA
162#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
163 else immr->im_cpm.cp_pbdat &= ~PB_SCL
164#define I2C_DELAY udelay(5) /* 1/4 I2C clock duration */
wdenk7aa78612003-05-03 15:50:43 +0000165#endif
wdenk5b1d7132002-11-03 00:07:02 +0000166
167/*
168 * Allow environment overwrites by anyone
169 */
170#define CONFIG_ENV_OVERWRITE
171
wdenk7aa78612003-05-03 15:50:43 +0000172#if !defined(CONFIG_SC)
wdenk5b1d7132002-11-03 00:07:02 +0000173/*
174 * The MPC860's internal RTC is horribly broken in rev D masks. Three
175 * internal MPC860T circuit nodes were inadvertently left floating; this
176 * causes KAPWR current in power down mode to be three orders of magnitude
177 * higher than specified in the datasheet (from 10 uA to 10 mA). No
178 * reasonable battery can keep that kind RTC running during powerdown for any
179 * length of time, so we use an external RTC on the I2C bus instead.
180 */
wdenk5b1d7132002-11-03 00:07:02 +0000181#define CONFIG_RTC_DS1337
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200182#define CONFIG_SYS_I2C_RTC_ADDR 0x68
wdenk7aa78612003-05-03 15:50:43 +0000183
184#else
185/*
186 * No external RTC on SC variant, so we're stuck with the internal one.
187 */
188#define CONFIG_RTC_MPC8xx
189#endif
wdenk5b1d7132002-11-03 00:07:02 +0000190
191/*
wdenk7aa78612003-05-03 15:50:43 +0000192 * Power On Self Test support
wdenk5b1d7132002-11-03 00:07:02 +0000193 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200194#define CONFIG_POST ( CONFIG_SYS_POST_CACHE | \
195 CONFIG_SYS_POST_MEMORY | \
196 CONFIG_SYS_POST_CPU | \
197 CONFIG_SYS_POST_UART | \
198 CONFIG_SYS_POST_SPR )
wdenk7aa78612003-05-03 15:50:43 +0000199
Jon Loeliger60a08762007-07-07 21:04:26 -0500200
wdenk5b1d7132002-11-03 00:07:02 +0000201/*
Jon Loeliger60a08762007-07-07 21:04:26 -0500202 * Command line configuration.
wdenk5b1d7132002-11-03 00:07:02 +0000203 */
Jon Loeliger60a08762007-07-07 21:04:26 -0500204#include <config_cmd_default.h>
205
206#define CONFIG_CMD_ASKENV
207#define CONFIG_CMD_DHCP
208#define CONFIG_CMD_I2C
209#define CONFIG_CMD_EEPROM
210#define CONFIG_CMD_REGINFO
211#define CONFIG_CMD_IMMAP
212#define CONFIG_CMD_ELF
213#define CONFIG_CMD_DATE
214#define CONFIG_CMD_FPGA
215#define CONFIG_CMD_MII
216#define CONFIG_CMD_BEDBUG
wdenk7aa78612003-05-03 15:50:43 +0000217
Jon Loeligeraf075ee2007-07-08 17:02:01 -0500218#ifdef CONFIG_POST
Wolfgang Denkcdd917a2007-08-02 00:48:45 +0200219#define CONFIG_CMD_DIAG
Jon Loeligeraf075ee2007-07-08 17:02:01 -0500220#endif
Jon Loeliger60a08762007-07-07 21:04:26 -0500221
wdenk5b1d7132002-11-03 00:07:02 +0000222/*
223 * There is no IDE/PCMCIA hardware support on the board.
224 */
225#undef CONFIG_IDE_PCMCIA
226#undef CONFIG_IDE_LED
227#undef CONFIG_IDE_RESET
228
229/*
230 * Enable the call to misc_init_r() for miscellaneous platform
231 * dependent initialization.
232 */
233#define CONFIG_MISC_INIT_R
234
235/*
236 * Enable call to last_stage_init() so we can twiddle some LEDS :)
237 */
238#define CONFIG_LAST_STAGE_INIT
239
240/*
241 * Virtex2 FPGA configuration support
242 */
243#define CONFIG_FPGA_COUNT 1
Matthias Fuchs01335022007-12-27 17:12:34 +0100244#define CONFIG_FPGA
245#define CONFIG_FPGA_XILINX
246#define CONFIG_FPGA_VIRTEX2
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200247#define CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenk5b1d7132002-11-03 00:07:02 +0000248
wdenk5b1d7132002-11-03 00:07:02 +0000249/*
250 * Verbose help from command monitor.
251 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200252#define CONFIG_SYS_LONGHELP
wdenk7aa78612003-05-03 15:50:43 +0000253#if !defined(CONFIG_SC)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200254#define CONFIG_SYS_PROMPT "B2> "
wdenk7aa78612003-05-03 15:50:43 +0000255#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200256#define CONFIG_SYS_PROMPT "SC> "
wdenk7aa78612003-05-03 15:50:43 +0000257#endif
258
wdenk5b1d7132002-11-03 00:07:02 +0000259
260/*
261 * Use the "hush" command parser
262 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200263#define CONFIG_SYS_HUSH_PARSER
wdenk5b1d7132002-11-03 00:07:02 +0000264
265/*
266 * Set buffer size for console I/O
267 */
Jon Loeliger60a08762007-07-07 21:04:26 -0500268#if defined(CONFIG_CMD_KGDB)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200269#define CONFIG_SYS_CBSIZE 1024
wdenk5b1d7132002-11-03 00:07:02 +0000270#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200271#define CONFIG_SYS_CBSIZE 256
wdenk5b1d7132002-11-03 00:07:02 +0000272#endif
273
274/*
275 * Print buffer size
276 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200277#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
wdenk5b1d7132002-11-03 00:07:02 +0000278
279/*
280 * Maximum number of arguments that a command can accept
281 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200282#define CONFIG_SYS_MAXARGS 16
wdenk5b1d7132002-11-03 00:07:02 +0000283
284/*
285 * Boot argument buffer size
286 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200287#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
wdenk5b1d7132002-11-03 00:07:02 +0000288
289/*
290 * Default memory test range
291 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200292#define CONFIG_SYS_MEMTEST_START 0x0100000
293#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + (128 * 1024))
wdenk5b1d7132002-11-03 00:07:02 +0000294
295/*
296 * Select the more full-featured memory test
297 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200298#define CONFIG_SYS_ALT_MEMTEST
wdenk5b1d7132002-11-03 00:07:02 +0000299
300/*
301 * Default load address
302 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200303#define CONFIG_SYS_LOAD_ADDR 0x01000000
wdenk5b1d7132002-11-03 00:07:02 +0000304
305/*
306 * Set decrementer frequency (1 ms ticks)
307 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200308#define CONFIG_SYS_HZ 1000
wdenk5b1d7132002-11-03 00:07:02 +0000309
310/*
311 * Device memory map (after SDRAM remap to 0x0):
312 *
313 * CS Device Base Addr Size
314 * ----------------------------------------------------
315 * CS0* Flash 0x40000000 64 M
316 * CS1* SDRAM 0x00000000 16 M
317 * CS2* Disk-On-Chip 0x50000000 32 K
318 * CS3* FPGA 0x60000000 64 M
319 * CS4* SelectMap 0x70000000 32 K
320 * CS5* Mil-Std 1553 I/F 0x80000000 32 K
321 * CS6* Unused
322 * CS7* Unused
323 * IMMR 860T Registers 0xfff00000
324 */
325
326/*
327 * Base addresses and block sizes
328 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200329#define CONFIG_SYS_IMMR 0xFF000000
wdenk5b1d7132002-11-03 00:07:02 +0000330
331#define SDRAM_BASE 0x00000000
332#define SDRAM_SIZE (64 * 1024 * 1024)
333
334#define FLASH_BASE 0x40000000
335#define FLASH_SIZE (16 * 1024 * 1024)
336
337#define DOC_BASE 0x50000000
338#define DOC_SIZE (32 * 1024)
339
340#define FPGA_BASE 0x60000000
341#define FPGA_SIZE (64 * 1024 * 1024)
342
343#define SELECTMAP_BASE 0x70000000
344#define SELECTMAP_SIZE (32 * 1024)
345
346#define M1553_BASE 0x80000000
347#define M1553_SIZE (64 * 1024)
348
349/*
350 * Definitions for initial stack pointer and data area (in DPRAM)
351 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200352#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
Wolfgang Denk553f0982010-10-26 13:32:32 +0200353#define CONFIG_SYS_INIT_RAM_SIZE 0x2F00 /* Size of used area in DPRAM */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200354#define CONFIG_SYS_INIT_DATA_SIZE 64 /* # bytes reserved for initial data*/
Wolfgang Denk553f0982010-10-26 13:32:32 +0200355#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - CONFIG_SYS_INIT_DATA_SIZE)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200356#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
wdenk5b1d7132002-11-03 00:07:02 +0000357
358/*
359 * Start addresses for the final memory configuration
360 * (Set up by the startup code)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200361 * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
wdenk5b1d7132002-11-03 00:07:02 +0000362 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200363#define CONFIG_SYS_SDRAM_BASE SDRAM_BASE
wdenk5b1d7132002-11-03 00:07:02 +0000364
365/*
366 * FLASH organization
367 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200368#define CONFIG_SYS_FLASH_BASE FLASH_BASE
369#define CONFIG_SYS_FLASH_SIZE FLASH_SIZE
370#define CONFIG_SYS_FLASH_SECT_SIZE (128 * 1024)
371#define CONFIG_SYS_MAX_FLASH_BANKS 1
372#define CONFIG_SYS_MAX_FLASH_SECT 128
wdenk5b1d7132002-11-03 00:07:02 +0000373
374/*
375 * The timeout values are for an entire chip and are in milliseconds.
376 * Yes I know that the write timeout is huge. Accroding to the
377 * datasheet a single byte takes 630 uS (round to 1 ms) max at worst
378 * case VCC and temp after 100K programming cycles. It works out
379 * to 280 minutes (might as well be forever).
380 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200381#define CONFIG_SYS_FLASH_ERASE_TOUT (CONFIG_SYS_MAX_FLASH_SECT * 5000)
382#define CONFIG_SYS_FLASH_WRITE_TOUT (CONFIG_SYS_MAX_FLASH_SECT * 128 * 1024 * 1)
wdenk5b1d7132002-11-03 00:07:02 +0000383
384/*
385 * Allow direct writes to FLASH from tftp transfers (** dangerous **)
386 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200387#define CONFIG_SYS_DIRECT_FLASH_TFTP
wdenk5b1d7132002-11-03 00:07:02 +0000388
389/*
390 * Reserve memory for U-Boot.
391 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200392#define CONFIG_SYS_MAX_UBOOT_SECTS 4
393#define CONFIG_SYS_MONITOR_LEN (CONFIG_SYS_MAX_UBOOT_SECTS * CONFIG_SYS_FLASH_SECT_SIZE)
394#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
wdenk5b1d7132002-11-03 00:07:02 +0000395
396/*
397 * Select environment placement. NOTE that u-boot.lds must
398 * be edited if this is changed!
399 */
Jean-Christophe PLAGNIOL-VILLARD5a1aceb2008-09-10 22:48:04 +0200400#undef CONFIG_ENV_IS_IN_FLASH
Jean-Christophe PLAGNIOL-VILLARDbb1f8b42008-09-05 09:19:30 +0200401#define CONFIG_ENV_IS_IN_EEPROM
wdenk5b1d7132002-11-03 00:07:02 +0000402
Jean-Christophe PLAGNIOL-VILLARDbb1f8b42008-09-05 09:19:30 +0200403#if defined(CONFIG_ENV_IS_IN_EEPROM)
Jean-Christophe PLAGNIOL-VILLARD0e8d1582008-09-10 22:48:06 +0200404#define CONFIG_ENV_SIZE (2 * 1024)
405#define CONFIG_ENV_OFFSET (CONFIG_ENV_EEPROM_SIZE - (8 * 1024))
wdenk5b1d7132002-11-03 00:07:02 +0000406#else
Jean-Christophe PLAGNIOL-VILLARD0e8d1582008-09-10 22:48:06 +0200407#define CONFIG_ENV_SIZE 0x1000
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200408#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_FLASH_SECT_SIZE
wdenk7aa78612003-05-03 15:50:43 +0000409
410/*
411 * This ultimately gets passed right into the linker script, so we have to
412 * use a number :(
413 */
Jean-Christophe PLAGNIOL-VILLARD0e8d1582008-09-10 22:48:06 +0200414#define CONFIG_ENV_OFFSET 0x060000
wdenk5b1d7132002-11-03 00:07:02 +0000415#endif
416
417/*
418 * Reserve memory for malloc()
419 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200420#define CONFIG_SYS_MALLOC_LEN (128 * 1024)
wdenk5b1d7132002-11-03 00:07:02 +0000421
422/*
423 * For booting Linux, the board info and command line data
424 * have to be in the first 8 MB of memory, since this is
425 * the maximum mapped by the Linux kernel during initialization.
426 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200427#define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024)
wdenk5b1d7132002-11-03 00:07:02 +0000428
429/*
430 * Cache Configuration
431 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200432#define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
Jon Loeliger60a08762007-07-07 21:04:26 -0500433#if defined(CONFIG_CMD_KGDB)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200434#define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of above value */
wdenk5b1d7132002-11-03 00:07:02 +0000435#endif
436
437/*------------------------------------------------------------------------
wdenk7aa78612003-05-03 15:50:43 +0000438 * SYPCR - System Protection Control UM 11-9
wdenk5b1d7132002-11-03 00:07:02 +0000439 * -----------------------------------------------------------------------
440 * SYPCR can only be written once after reset!
441 *
442 * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
443 */
444#if defined(CONFIG_WATCHDOG)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200445#define CONFIG_SYS_SYPCR ( SYPCR_SWTC | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200446 SYPCR_BMT | \
447 SYPCR_BME | \
448 SYPCR_SWF | \
449 SYPCR_SWE | \
wdenk5b1d7132002-11-03 00:07:02 +0000450 SYPCR_SWRI | \
451 SYPCR_SWP \
452 )
453#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200454#define CONFIG_SYS_SYPCR ( SYPCR_SWTC | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200455 SYPCR_BMT | \
456 SYPCR_BME | \
457 SYPCR_SWF | \
wdenk5b1d7132002-11-03 00:07:02 +0000458 SYPCR_SWP \
459 )
460#endif
461
462/*-----------------------------------------------------------------------
463 * SIUMCR - SIU Module Configuration UM 11-6
464 *-----------------------------------------------------------------------
465 * Set debug pin mux, enable SPKROUT and GPLB5*.
466 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200467#define CONFIG_SYS_SIUMCR ( SIUMCR_DBGC11 | \
wdenk5b1d7132002-11-03 00:07:02 +0000468 SIUMCR_DBPC11 | \
469 SIUMCR_MLRC11 | \
470 SIUMCR_GB5E \
471 )
472
473/*-----------------------------------------------------------------------
474 * TBSCR - Time Base Status and Control UM 11-26
475 *-----------------------------------------------------------------------
476 * Clear Reference Interrupt Status, Timebase freeze enabled
477 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200478#define CONFIG_SYS_TBSCR ( TBSCR_REFA | \
wdenk5b1d7132002-11-03 00:07:02 +0000479 TBSCR_REFB | \
480 TBSCR_TBF \
481 )
482
483/*-----------------------------------------------------------------------
484 * RTCSC - Real-Time Clock Status and Control Register UM 11-27
485 *-----------------------------------------------------------------------
486 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200487#define CONFIG_SYS_RTCSC ( RTCSC_SEC | \
wdenk5b1d7132002-11-03 00:07:02 +0000488 RTCSC_ALR | \
489 RTCSC_RTF | \
490 RTCSC_RTE \
491 )
492
493/*-----------------------------------------------------------------------
494 * PISCR - Periodic Interrupt Status and Control UM 11-31
495 *-----------------------------------------------------------------------
496 * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
497 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200498#define CONFIG_SYS_PISCR ( PISCR_PS | \
wdenk5b1d7132002-11-03 00:07:02 +0000499 PISCR_PITF \
500 )
501
502/*-----------------------------------------------------------------------
503 * PLPRCR - PLL, Low-Power, and Reset Control Register UM 15-30
504 *-----------------------------------------------------------------------
505 * Reset PLL lock status sticky bit, timer expired status bit and timer
506 * interrupt status bit. Set MF for 1:2:1 mode.
507 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200508#define CONFIG_SYS_PLPRCR ( ((0x1 << PLPRCR_MF_SHIFT) & PLPRCR_MF_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000509 PLPRCR_SPLSS | \
510 PLPRCR_TEXPS | \
511 PLPRCR_TMIST \
512 )
513
514/*-----------------------------------------------------------------------
515 * SCCR - System Clock and reset Control Register UM 15-27
516 *-----------------------------------------------------------------------
517 * Set clock output, timebase and RTC source and divider,
518 * power management and some other internal clocks
519 */
520#define SCCR_MASK SCCR_EBDF11
521
wdenk7aa78612003-05-03 15:50:43 +0000522#if !defined(CONFIG_SC)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200523#define CONFIG_SYS_SCCR ( SCCR_TBS | /* timebase = GCLK/2 */ \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200524 SCCR_COM00 | /* full strength CLKOUT */ \
525 SCCR_DFSYNC00 | /* SYNCLK / 1 (normal) */ \
526 SCCR_DFBRG00 | /* BRGCLK / 1 (normal) */ \
wdenk5b1d7132002-11-03 00:07:02 +0000527 SCCR_DFNL000 | \
528 SCCR_DFNH000 \
529 )
wdenk7aa78612003-05-03 15:50:43 +0000530#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200531#define CONFIG_SYS_SCCR ( SCCR_TBS | /* timebase = GCLK/2 */ \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200532 SCCR_COM00 | /* full strength CLKOUT */ \
533 SCCR_DFSYNC00 | /* SYNCLK / 1 (normal) */ \
534 SCCR_DFBRG00 | /* BRGCLK / 1 (normal) */ \
wdenk7aa78612003-05-03 15:50:43 +0000535 SCCR_DFNL000 | \
536 SCCR_DFNH000 | \
537 SCCR_RTDIV | \
538 SCCR_RTSEL \
539 )
540#endif
wdenk5b1d7132002-11-03 00:07:02 +0000541
542/*-----------------------------------------------------------------------
543 * DER - Debug Enable Register UM 37-46
544 *-----------------------------------------------------------------------
545 * Mask all events that can cause entry into debug mode
546 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200547#define CONFIG_SYS_DER 0
wdenk5b1d7132002-11-03 00:07:02 +0000548
549/*
550 * Initialize Memory Controller:
551 *
552 * BR0 and OR0 (FLASH memory)
553 */
554#define FLASH_BASE0_PRELIM FLASH_BASE
555
556/*
557 * Flash address mask
558 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200559#define CONFIG_SYS_PRELIM_OR_AM 0xfe000000
wdenk5b1d7132002-11-03 00:07:02 +0000560
561/*
562 * FLASH timing:
563 * 33 Mhz bus with ACS = 11, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 1
564 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200565#define CONFIG_SYS_OR_TIMING_FLASH ( OR_CSNT_SAM | \
wdenk5b1d7132002-11-03 00:07:02 +0000566 OR_ACS_DIV2 | \
567 OR_BI | \
568 OR_SCY_2_CLK | \
569 OR_TRLX | \
570 OR_EHTR \
571 )
572
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200573#define CONFIG_SYS_OR0_PRELIM ( CONFIG_SYS_PRELIM_OR_AM | \
574 CONFIG_SYS_OR_TIMING_FLASH \
wdenk5b1d7132002-11-03 00:07:02 +0000575 )
576
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200577#define CONFIG_SYS_BR0_PRELIM ( (FLASH_BASE0_PRELIM & BR_BA_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000578 BR_MS_GPCM | \
579 BR_PS_8 | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200580 BR_V \
wdenk5b1d7132002-11-03 00:07:02 +0000581 )
582
583/*
584 * SDRAM configuration
585 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200586#define CONFIG_SYS_OR1_AM 0xfc000000
587#define CONFIG_SYS_OR1 ( (CONFIG_SYS_OR1_AM & OR_AM_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000588 OR_CSNT_SAM \
589 )
590
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200591#define CONFIG_SYS_BR1 ( (SDRAM_BASE & BR_BA_MSK) | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200592 BR_MS_UPMA | \
593 BR_PS_32 | \
594 BR_V \
wdenk5b1d7132002-11-03 00:07:02 +0000595 )
596
597/*
598 * Refresh rate 7.8 us (= 64 ms / 8K = 31.2 uS quad bursts) for one bank
599 * of 256 MBit SDRAM
600 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200601#define CONFIG_SYS_MPTPR_1BK_8K MPTPR_PTP_DIV16
wdenk5b1d7132002-11-03 00:07:02 +0000602
603/*
604 * Periodic timer for refresh @ 33 MHz system clock
605 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200606#define CONFIG_SYS_MAMR_PTA 64
wdenk5b1d7132002-11-03 00:07:02 +0000607
608/*
609 * MAMR settings for SDRAM
610 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200611#define CONFIG_SYS_MAMR_8COL ( (CONFIG_SYS_MAMR_PTA << MAMR_PTA_SHIFT) | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200612 MAMR_PTAE | \
wdenk5b1d7132002-11-03 00:07:02 +0000613 MAMR_AMA_TYPE_1 | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200614 MAMR_DSA_1_CYCL | \
wdenk5b1d7132002-11-03 00:07:02 +0000615 MAMR_G0CLA_A10 | \
616 MAMR_RLFA_1X | \
617 MAMR_WLFA_1X | \
618 MAMR_TLFA_4X \
619 )
620
621/*
622 * CS2* configuration for Disk On Chip:
623 * 33 MHz bus with TRLX=1, ACS=11, CSNT=1, EBDF=1, SCY=2, EHTR=1,
624 * no burst.
625 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200626#define CONFIG_SYS_OR2_PRELIM ( (0xffff0000 & OR_AM_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000627 OR_CSNT_SAM | \
628 OR_ACS_DIV2 | \
629 OR_BI | \
630 OR_SCY_2_CLK | \
631 OR_TRLX | \
632 OR_EHTR \
633 )
634
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200635#define CONFIG_SYS_BR2_PRELIM ( (DOC_BASE & BR_BA_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000636 BR_PS_8 | \
637 BR_MS_GPCM | \
638 BR_V \
639 )
640
641/*
642 * CS3* configuration for FPGA:
643 * 33 MHz bus with SCY=15, no burst.
644 * The FPGA uses TA and TEA to terminate bus cycles, but we
645 * clear SETA and set the cycle length to a large number so that
646 * the cycle will still complete even if there is a configuration
647 * error that prevents TA from asserting on FPGA accesss.
648 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200649#define CONFIG_SYS_OR3_PRELIM ( (0xfc000000 & OR_AM_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000650 OR_SCY_15_CLK | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200651 OR_BI \
wdenk5b1d7132002-11-03 00:07:02 +0000652 )
653
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200654#define CONFIG_SYS_BR3_PRELIM ( (FPGA_BASE & BR_BA_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000655 BR_PS_32 | \
656 BR_MS_GPCM | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200657 BR_V \
wdenk5b1d7132002-11-03 00:07:02 +0000658 )
659/*
660 * CS4* configuration for FPGA SelectMap configuration interface.
661 * 33 MHz bus, UPMB, no burst. Do not assert GPLB5 on falling edge
662 * of GCLK1_50
663 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200664#define CONFIG_SYS_OR4_PRELIM ( (0xffff0000 & OR_AM_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000665 OR_G5LS | \
666 OR_BI \
667 )
668
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200669#define CONFIG_SYS_BR4_PRELIM ( (SELECTMAP_BASE & BR_BA_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000670 BR_PS_8 | \
671 BR_MS_UPMB | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200672 BR_V \
wdenk5b1d7132002-11-03 00:07:02 +0000673 )
674
675/*
676 * CS5* configuration for Mil-Std 1553 databus interface.
677 * 33 MHz bus, GPCM, no burst.
678 * The 1553 interface uses TA and TEA to terminate bus cycles,
679 * but we clear SETA and set the cycle length to a large number so that
680 * the cycle will still complete even if there is a configuration
681 * error that prevents TA from asserting on FPGA accesss.
682 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200683#define CONFIG_SYS_OR5_PRELIM ( (0xffff0000 & OR_AM_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000684 OR_SCY_15_CLK | \
685 OR_EHTR | \
686 OR_TRLX | \
687 OR_CSNT_SAM | \
688 OR_BI \
689 )
690
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200691#define CONFIG_SYS_BR5_PRELIM ( (M1553_BASE & BR_BA_MSK) | \
wdenk5b1d7132002-11-03 00:07:02 +0000692 BR_PS_16 | \
693 BR_MS_GPCM | \
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200694 BR_V \
wdenk5b1d7132002-11-03 00:07:02 +0000695 )
696
697/*
wdenk5b1d7132002-11-03 00:07:02 +0000698 * FEC interrupt assignment
699 */
700#define FEC_INTERRUPT SIU_LEVEL1
701
702/*
703 * Sanity checks
704 */
705#if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET)
706#error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured
707#endif
708
709#endif /* __CONFIG_GEN860T_H */