729a48597bce4e82238c61998b4cb83d93726313
[kernel/u-boot.git] / include / configs / XPEDITE5170.h
1 /*
2  * Copyright 2009 Extreme Engineering Solutions, Inc.
3  * Copyright 2007-2008 Freescale Semiconductor, Inc.
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23
24 /*
25  * xpedite5170 board configuration file
26  */
27 #ifndef __CONFIG_H
28 #define __CONFIG_H
29
30 /*
31  * High Level Configuration Options
32  */
33 #define CONFIG_MPC86xx          1       /* MPC86xx */
34 #define CONFIG_MPC8641          1       /* MPC8641 specific */
35 #define CONFIG_XPEDITE5140      1       /* MPC8641HPCN board specific */
36 #define CONFIG_SYS_BOARD_NAME   "XPedite5170"
37 #define CONFIG_LINUX_RESET_VEC  0x100   /* Reset vector used by Linux */
38 #define CONFIG_BOARD_EARLY_INIT_R       /* Call board_pre_init */
39 #define CONFIG_BAT_RW           1       /* Use common BAT rw code */
40 #define CONFIG_HIGH_BATS        1       /* High BATs supported and enabled */
41 #define CONFIG_ALTIVEC          1
42
43 #define CONFIG_PCI              1       /* Enable PCI/PCIE */
44 #define CONFIG_PCI_PNP          1       /* do pci plug-and-play */
45 #define CONFIG_PCI_SCAN_SHOW    1       /* show pci devices on startup */
46 #define CONFIG_PCIE1            1       /* PCIE controler 1 */
47 #define CONFIG_PCIE2            1       /* PCIE controler 2 */
48 #define CONFIG_FSL_PCI_INIT     1       /* Use common FSL init code */
49 #define CONFIG_SYS_PCI_64BIT    1       /* enable 64-bit PCI resources */
50 #define CONFIG_FSL_LAW          1       /* Use common FSL init code */
51
52 /*
53  * DDR config
54  */
55 #define CONFIG_FSL_DDR2
56 #define CONFIG_SPD_EEPROM               /* Use SPD EEPROM for DDR setup */
57 #define CONFIG_DDR_SPD
58 #define CONFIG_MEM_INIT_VALUE           0xdeadbeef
59 #define SPD_EEPROM_ADDRESS1             0x54    /* Both channels use the */
60 #define SPD_EEPROM_ADDRESS2             0x54    /* same SPD data         */
61 #define SPD_EEPROM_OFFSET               0x200   /* OFFSET of SPD in EEPROM */
62 #define CONFIG_NUM_DDR_CONTROLLERS      2
63 #define CONFIG_DIMM_SLOTS_PER_CTLR      1
64 #define CONFIG_CHIP_SELECTS_PER_CTRL    1
65 #define CONFIG_DDR_ECC
66 #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
67 #define CONFIG_SYS_DDR_SDRAM_BASE       0x00000000      /* DDR is system memory*/
68 #define CONFIG_SYS_SDRAM_BASE           CONFIG_SYS_DDR_SDRAM_BASE
69 #define CONFIG_VERY_BIG_RAM
70 #define CONFIG_SYS_MAX_DDR_BAT_SIZE     0x80000000      /* BAT mapping size */
71
72 /*
73  * virtual address to be used for temporary mappings.  There
74  * should be 128k free at this VA.
75  */
76 #define CONFIG_SYS_SCRATCH_VA   0xe0000000
77
78 #ifndef __ASSEMBLY__
79 extern unsigned long get_board_sys_clk(unsigned long dummy);
80 #endif
81
82 #define CONFIG_SYS_CLK_FREQ     get_board_sys_clk(0) /* sysclk for MPC86xx */
83
84 /*
85  * L2CR setup
86  */
87 #define CONFIG_SYS_L2
88 #define L2_INIT         0
89 #define L2_ENABLE       (L2CR_L2E)
90
91 /*
92  * Base addresses -- Note these are effective addresses where the
93  * actual resources get mapped (not physical addresses)
94  */
95 #define CONFIG_SYS_CCSRBAR_DEFAULT      0xff700000      /* CCSRBAR Default */
96 #define CONFIG_SYS_CCSRBAR              0xef000000      /* relocated CCSRBAR */
97 #define CONFIG_SYS_CCSRBAR_PHYS         CONFIG_SYS_CCSRBAR
98 #define CONFIG_SYS_CCSRBAR_PHYS_LOW     CONFIG_SYS_CCSRBAR
99 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH    0x0
100 #define CONFIG_SYS_IMMR                 CONFIG_SYS_CCSRBAR
101
102 /*
103  * Diagnostics
104  */
105 #define CONFIG_SYS_ALT_MEMTEST
106 #define CONFIG_SYS_MEMTEST_START        0x10000000
107 #define CONFIG_SYS_MEMTEST_END          0x20000000
108
109 /*
110  * Memory map
111  * 0x0000_0000  0x7fff_ffff     DDR                     2G Cacheable
112  * 0x8000_0000  0xbfff_ffff     PCIe1 Mem               1G non-cacheable
113  * 0xc000_0000  0xcfff_ffff     PCIe2 Mem               256M non-cacheable
114  * 0xe000_0000  0xe7ff_ffff     SRAM/SSRAM/L1 Cache     128M non-cacheable
115  * 0xe800_0000  0xe87f_ffff     PCIe1 IO                8M non-cacheable
116  * 0xe880_0000  0xe8ff_ffff     PCIe2 IO                8M non-cacheable
117  * 0xef00_0000  0xef0f_ffff     CCSR/IMMR               1M non-cacheable
118  * 0xef80_0000  0xef8f_ffff     NAND Flash              1M non-cacheable
119  * 0xf000_0000  0xf7ff_ffff     NOR Flash 2             128M non-cacheable
120  * 0xf800_0000  0xffff_ffff     NOR Flash 1             128M non-cacheable
121  */
122
123 #define CONFIG_SYS_LBC_LCRR             (LCRR_CLKDIV_4 | LCRR_EADC_3)
124
125 /*
126  * NAND flash configuration
127  */
128 #define CONFIG_SYS_NAND_BASE            0xef800000
129 #define CONFIG_SYS_NAND_BASE2           0xef840000      /* Unused at this time */
130 #define CONFIG_SYS_NAND_BASE_LIST       {CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE2}
131 #define CONFIG_SYS_MAX_NAND_DEVICE      2
132 #define CONFIG_NAND_ACTL
133 #define CONFIG_SYS_NAND_ACTL_ALE        (1 << 14)       /* C_LA14 */
134 #define CONFIG_SYS_NAND_ACTL_CLE        (1 << 15)       /* C_LA15 */
135 #define CONFIG_SYS_NAND_ACTL_NCE        0               /* NCE not controlled by ADDR */
136 #define CONFIG_SYS_NAND_ACTL_DELAY      25
137 #define CONFIG_SYS_NAND_QUIET_TEST
138 #define CONFIG_JFFS2_NAND
139
140 /*
141  * NOR flash configuration
142  */
143 #define CONFIG_SYS_FLASH_BASE           0xf8000000
144 #define CONFIG_SYS_FLASH_BASE2          0xf0000000
145 #define CONFIG_SYS_FLASH_BANKS_LIST     {CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE2}
146 #define CONFIG_SYS_MAX_FLASH_BANKS      2               /* number of banks */
147 #define CONFIG_SYS_MAX_FLASH_SECT       1024            /* sectors per device */
148 #define CONFIG_SYS_FLASH_ERASE_TOUT     60000           /* Flash Erase Timeout (ms) */
149 #define CONFIG_SYS_FLASH_WRITE_TOUT     500             /* Flash Write Timeout (ms) */
150 #define CONFIG_FLASH_CFI_DRIVER
151 #define CONFIG_SYS_FLASH_CFI
152 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
153 #define CONFIG_SYS_FLASH_AUTOPROTECT_LIST       { {0xfff00000, 0xc0000}, \
154                                                   {0xf7f00000, 0xc0000} }
155 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE    /* start of monitor */
156 #define CONFIG_SYS_MONITOR_BASE_EARLY   0xfff00000      /* early monitor loc */
157
158 /*
159  * Chip select configuration
160  */
161 /* NOR Flash 0 on CS0 */
162 #define CONFIG_SYS_BR0_PRELIM   (CONFIG_SYS_FLASH_BASE  |\
163                                  BR_PS_16               |\
164                                  BR_V)
165 #define CONFIG_SYS_OR0_PRELIM   (OR_AM_128MB            |\
166                                  OR_GPCM_CSNT           |\
167                                  OR_GPCM_XACS           |\
168                                  OR_GPCM_ACS_DIV2       |\
169                                  OR_GPCM_SCY_8          |\
170                                  OR_GPCM_TRLX           |\
171                                  OR_GPCM_EHTR           |\
172                                  OR_GPCM_EAD)
173
174 /* NOR Flash 1 on CS1 */
175 #define CONFIG_SYS_BR1_PRELIM   (CONFIG_SYS_FLASH_BASE2 |\
176                                  BR_PS_16               |\
177                                  BR_V)
178 #define CONFIG_SYS_OR1_PRELIM   CONFIG_SYS_OR0_PRELIM
179
180 /* NAND flash on CS2 */
181 #define CONFIG_SYS_BR2_PRELIM   (CONFIG_SYS_NAND_BASE   |\
182                                  BR_PS_8                |\
183                                  BR_V)
184 #define CONFIG_SYS_OR2_PRELIM   (OR_AM_256KB            |\
185                                  OR_GPCM_BCTLD          |\
186                                  OR_GPCM_CSNT           |\
187                                  OR_GPCM_ACS_DIV4       |\
188                                  OR_GPCM_SCY_4          |\
189                                  OR_GPCM_TRLX           |\
190                                  OR_GPCM_EHTR)
191
192 /* Optional NAND flash on CS3 */
193 #define CONFIG_SYS_BR3_PRELIM   (CONFIG_SYS_NAND_BASE2  |\
194                                  BR_PS_8                |\
195                                  BR_V)
196 #define CONFIG_SYS_OR3_PRELIM   CONFIG_SYS_OR2_PRELIM
197
198 /*
199  * Use L1 as initial stack
200  */
201 #define CONFIG_SYS_INIT_RAM_LOCK        1
202 #define CONFIG_SYS_INIT_RAM_ADDR        0xe0000000
203 #define CONFIG_SYS_INIT_RAM_END         0x00004000
204
205 #define CONFIG_SYS_GBL_DATA_SIZE        128     /* num bytes initial data */
206 #define CONFIG_SYS_GBL_DATA_OFFSET      (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
207 #define CONFIG_SYS_INIT_SP_OFFSET       CONFIG_SYS_GBL_DATA_OFFSET
208
209 #define CONFIG_SYS_MONITOR_LEN          (512 * 1024)    /* Reserve 512 KB for Mon */
210 #define CONFIG_SYS_MALLOC_LEN           (1024 * 1024)   /* Reserved for malloc */
211
212 /*
213  * Serial Port
214  */
215 #define CONFIG_CONS_INDEX               1
216 #define CONFIG_SYS_NS16550
217 #define CONFIG_SYS_NS16550_SERIAL
218 #define CONFIG_SYS_NS16550_REG_SIZE     1
219 #define CONFIG_SYS_NS16550_CLK          get_bus_freq(0)
220 #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR+0x4500)
221 #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x4600)
222 #define CONFIG_SYS_BAUDRATE_TABLE       \
223         {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
224 #define CONFIG_BAUDRATE                 115200
225 #define CONFIG_LOADS_ECHO               1       /* echo on for serial download */
226 #define CONFIG_SYS_LOADS_BAUD_CHANGE    1       /* allow baudrate change */
227
228 /*
229  * Use the HUSH parser
230  */
231 #define CONFIG_SYS_HUSH_PARSER
232 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
233
234 /*
235  * Pass open firmware flat tree
236  */
237 #define CONFIG_OF_LIBFDT                1
238 #define CONFIG_OF_BOARD_SETUP           1
239 #define CONFIG_OF_STDOUT_VIA_ALIAS      1
240
241 /*
242  * I2C
243  */
244 #define CONFIG_FSL_I2C                          /* Use FSL common I2C driver */
245 #define CONFIG_HARD_I2C                         /* I2C with hardware support */
246 #define CONFIG_SYS_I2C_SPEED            100000  /* M41T00 only supports 100 KHz */
247 #define CONFIG_SYS_I2C_SLAVE            0x7F
248 #define CONFIG_SYS_I2C_OFFSET           0x3000
249 #define CONFIG_SYS_I2C2_OFFSET          0x3100
250 #define CONFIG_I2C_MULTI_BUS
251
252 /* PEX8518 slave I2C interface */
253 #define CONFIG_SYS_I2C_PEX8518_ADDR     0x70
254
255 /* I2C DS1631 temperature sensor */
256 #define CONFIG_SYS_I2C_DS1621_ADDR      0x48
257 #define CONFIG_DTT_DS1621
258 #define CONFIG_DTT_SENSORS              { 0 }
259
260 /* I2C EEPROM - AT24C128B */
261 #define CONFIG_SYS_I2C_EEPROM_ADDR              0x54
262 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN          2
263 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS       6       /* 64 byte pages */
264 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS   10      /* take up to 10 msec */
265
266 /* I2C RTC */
267 #define CONFIG_RTC_M41T11               1
268 #define CONFIG_SYS_I2C_RTC_ADDR         0x68
269 #define CONFIG_SYS_M41T11_BASE_YEAR     2000
270
271 /* GPIO/EEPROM/SRAM */
272 #define CONFIG_DS4510
273 #define CONFIG_SYS_I2C_DS4510_ADDR      0x51
274
275 /* GPIO */
276 #define CONFIG_PCA953X
277 #define CONFIG_SYS_I2C_PCA953X_ADDR0    0x18
278 #define CONFIG_SYS_I2C_PCA953X_ADDR1    0x1c
279 #define CONFIG_SYS_I2C_PCA953X_ADDR2    0x1e
280 #define CONFIG_SYS_I2C_PCA953X_ADDR3    0x1f
281 #define CONFIG_SYS_I2C_PCA953X_ADDR     CONFIG_SYS_I2C_PCA953X_ADDR0
282
283 /*
284  * PU = pulled high, PD = pulled low
285  * I = input, O = output, IO = input/output
286  */
287 /* PCA9557 @ 0x18*/
288 #define CONFIG_SYS_PCA953X_C0_SER0_EN           0x01 /* PU; UART0 enable (1: enabled) */
289 #define CONFIG_SYS_PCA953X_C0_SER0_MODE         0x02 /* PU; UART0 serial mode select */
290 #define CONFIG_SYS_PCA953X_C0_SER1_EN           0x04 /* PU; UART1 enable (1: enabled) */
291 #define CONFIG_SYS_PCA953X_C0_SER1_MODE         0x08 /* PU; UART1 serial mode select */
292 #define CONFIG_SYS_PCA953X_C0_FLASH_PASS_CS     0x10 /* PU; Boot flash CS select */
293 #define CONFIG_SYS_PCA953X_NVM_WP               0x20 /* PU; Set to 0 to enable NVM writing */
294
295 /* PCA9557 @ 0x1c*/
296 #define CONFIG_SYS_PCA953X_XMC0_ROOT0           0x01 /* PU; Low if XMC is RC */
297 #define CONFIG_SYS_PCA953X_PLUG_GPIO0           0x02 /* Samtec connector GPIO */
298 #define CONFIG_SYS_PCA953X_XMC0_WAKE            0x04 /* PU; XMC wake */
299 #define CONFIG_SYS_PCA953X_XMC0_BIST            0x08 /* PU; XMC built in self test */
300 #define CONFIG_SYS_PCA953X_XMC_PRESENT          0x10 /* PU; Low if XMC module installed */
301 #define CONFIG_SYS_PCA953X_PMC_PRESENT          0x20 /* PU; Low if PMC module installed */
302 #define CONFIG_SYS_PCA953X_PMC0_MONARCH         0x40 /* PMC monarch mode enable */
303 #define CONFIG_SYS_PCA953X_PMC0_EREADY          0x80 /* PU; PMC PCI eready */
304
305 /* PCA9557 @ 0x1e*/
306 #define CONFIG_SYS_PCA953X_P0_GA0               0x01 /* PU; VPX Geographical address */
307 #define CONFIG_SYS_PCA953X_P0_GA1               0x02 /* PU; VPX Geographical address */
308 #define CONFIG_SYS_PCA953X_P0_GA2               0x04 /* PU; VPX Geographical address */
309 #define CONFIG_SYS_PCA953X_P0_GA3               0x08 /* PU; VPX Geographical address */
310 #define CONFIG_SYS_PCA953X_P0_GA4               0x10 /* PU; VPX Geographical address */
311 #define CONFIG_SYS_PCA953X_P0_GAP               0x20 /* PU; VPX Geographical address parity */
312 #define CONFIG_SYS_PCA953X_P1_SYSEN             0x80 /* PU; VPX P1 SYSCON */
313
314 /* PCA9557 @ 0x1f */
315 #define CONFIG_SYS_PCA953X_VPX_GPIO0            0x01 /* PU; VPX P15 GPIO */
316 #define CONFIG_SYS_PCA953X_VPX_GPIO1            0x02 /* PU; VPX P15 GPIO */
317 #define CONFIG_SYS_PCA953X_VPX_GPIO2            0x04 /* PU; VPX P15 GPIO */
318 #define CONFIG_SYS_PCA953X_VPX_GPIO3            0x08 /* PU; VPX P15 GPIO */
319
320 /*
321  * General PCI
322  * Memory space is mapped 1-1, but I/O space must start from 0.
323  */
324 /* PCIE1 - PEX8518 */
325 #define CONFIG_SYS_PCIE1_MEM_BASE       0x80000000
326 #define CONFIG_SYS_PCIE1_MEM_PHYS       CONFIG_SYS_PCIE1_MEM_BASE
327 #define CONFIG_SYS_PCIE1_MEM_SIZE       0x40000000      /* 1G */
328 #define CONFIG_SYS_PCIE1_IO_BASE        0x00000000
329 #define CONFIG_SYS_PCIE1_IO_PHYS        0xe8000000
330 #define CONFIG_SYS_PCIE1_IO_SIZE        0x00800000      /* 8M */
331
332 /* PCIE2 - VPX P1 */
333 #define CONFIG_SYS_PCIE2_MEM_BASE       0xc0000000
334 #define CONFIG_SYS_PCIE2_MEM_PHYS       CONFIG_SYS_PCIE2_MEM_BASE
335 #define CONFIG_SYS_PCIE2_MEM_SIZE       0x10000000      /* 256M */
336 #define CONFIG_SYS_PCIE2_IO_BASE        0x00000000
337 #define CONFIG_SYS_PCIE2_IO_PHYS        0xe8800000
338 #define CONFIG_SYS_PCIE2_IO_SIZE        0x00800000      /* 8M */
339
340 /*
341  * Networking options
342  */
343 #define CONFIG_TSEC_ENET                /* tsec ethernet support */
344 #define CONFIG_PHY_GIGE         1       /* Include GbE speed/duplex detection */
345 #define CONFIG_NET_MULTI        1
346 #define CONFIG_MII              1       /* MII PHY management */
347 #define CONFIG_ETHPRIME         "eTSEC1"
348
349 #define CONFIG_TSEC1            1
350 #define CONFIG_TSEC1_NAME       "eTSEC1"
351 #define TSEC1_FLAGS             (TSEC_GIGABIT | TSEC_REDUCED)
352 #define TSEC1_PHY_ADDR          1
353 #define TSEC1_PHYIDX            0
354 #define CONFIG_HAS_ETH0
355
356 #define CONFIG_TSEC2            1
357 #define CONFIG_TSEC2_NAME       "eTSEC2"
358 #define TSEC2_FLAGS             (TSEC_GIGABIT | TSEC_REDUCED)
359 #define TSEC2_PHY_ADDR          2
360 #define TSEC2_PHYIDX            0
361 #define CONFIG_HAS_ETH1
362
363 /*
364  * BAT mappings
365  */
366 #if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR)
367 #define CONFIG_SYS_CCSR_DEFAULT_DBATL   (CONFIG_SYS_CCSRBAR_DEFAULT     |\
368                                          BATL_PP_RW                     |\
369                                          BATL_CACHEINHIBIT              |\
370                                          BATL_GUARDEDSTORAGE)
371 #define CONFIG_SYS_CCSR_DEFAULT_DBATU   (CONFIG_SYS_CCSRBAR_DEFAULT     |\
372                                          BATU_BL_1M                     |\
373                                          BATU_VS                        |\
374                                          BATU_VP)
375 #define CONFIG_SYS_CCSR_DEFAULT_IBATL   (CONFIG_SYS_CCSRBAR_DEFAULT     |\
376                                          BATL_PP_RW                     |\
377                                          BATL_CACHEINHIBIT)
378 #define CONFIG_SYS_CCSR_DEFAULT_IBATU   CONFIG_SYS_CCSR_DEFAULT_DBATU
379 #endif
380
381 /*
382  * BAT0         2G      Cacheable, non-guarded
383  * 0x0000_0000  2G      DDR
384  */
385 #define CONFIG_SYS_DBAT0L       (BATL_PP_RW | BATL_MEMCOHERENCE)
386 #define CONFIG_SYS_DBAT0U       (BATU_BL_2G | BATU_VS | BATU_VP)
387 #define CONFIG_SYS_IBAT0L       (BATL_PP_RW | BATL_MEMCOHERENCE)
388 #define CONFIG_SYS_IBAT0U       CONFIG_SYS_DBAT0U
389
390 /*
391  * BAT1         1G      Cache-inhibited, guarded
392  * 0x8000_0000  1G      PCI-Express 1 Memory
393  */
394 #define CONFIG_SYS_DBAT1L       (CONFIG_SYS_PCIE1_MEM_PHYS      |\
395                                  BATL_PP_RW                     |\
396                                  BATL_CACHEINHIBIT              |\
397                                  BATL_GUARDEDSTORAGE)
398 #define CONFIG_SYS_DBAT1U       (CONFIG_SYS_PCIE1_MEM_PHYS      |\
399                                  BATU_BL_1G                     |\
400                                  BATU_VS                        |\
401                                  BATU_VP)
402 #define CONFIG_SYS_IBAT1L       (CONFIG_SYS_PCIE1_MEM_PHYS      |\
403                                  BATL_PP_RW                     |\
404                                  BATL_CACHEINHIBIT)
405 #define CONFIG_SYS_IBAT1U       CONFIG_SYS_DBAT1U
406
407 /*
408  * BAT2         512M    Cache-inhibited, guarded
409  * 0xc000_0000  512M    PCI-Express 2 Memory
410  */
411 #define CONFIG_SYS_DBAT2L       (CONFIG_SYS_PCIE2_MEM_PHYS      |\
412                                  BATL_PP_RW                     |\
413                                  BATL_CACHEINHIBIT              |\
414                                  BATL_GUARDEDSTORAGE)
415 #define CONFIG_SYS_DBAT2U       (CONFIG_SYS_PCIE2_MEM_PHYS      |\
416                                  BATU_BL_512M                   |\
417                                  BATU_VS                        |\
418                                  BATU_VP)
419 #define CONFIG_SYS_IBAT2L       (CONFIG_SYS_PCIE2_MEM_PHYS      |\
420                                  BATL_PP_RW                     |\
421                                  BATL_CACHEINHIBIT)
422 #define CONFIG_SYS_IBAT2U       CONFIG_SYS_DBAT2U
423
424 /*
425  * BAT3         1M      Cache-inhibited, guarded
426  * 0xe000_0000  1M      CCSR
427  */
428 #define CONFIG_SYS_DBAT3L       (CONFIG_SYS_CCSRBAR             |\
429                                  BATL_PP_RW                     |\
430                                  BATL_CACHEINHIBIT              |\
431                                  BATL_GUARDEDSTORAGE)
432 #define CONFIG_SYS_DBAT3U       (CONFIG_SYS_CCSRBAR             |\
433                                  BATU_BL_1M                     |\
434                                  BATU_VS                        |\
435                                  BATU_VP)
436 #define CONFIG_SYS_IBAT3L       (CONFIG_SYS_CCSRBAR             |\
437                                  BATL_PP_RW                     |\
438                                  BATL_CACHEINHIBIT)
439 #define CONFIG_SYS_IBAT3U       CONFIG_SYS_DBAT3U
440
441 /*
442  * BAT4         32M     Cache-inhibited, guarded
443  * 0xe200_0000  16M     PCI-Express 1 I/O
444  * 0xe300_0000  16M     PCI-Express 2 I/0
445  */
446 #define CONFIG_SYS_DBAT4L       (CONFIG_SYS_PCIE1_IO_PHYS       |\
447                                  BATL_PP_RW                     |\
448                                  BATL_CACHEINHIBIT              |\
449                                  BATL_GUARDEDSTORAGE)
450 #define CONFIG_SYS_DBAT4U       (CONFIG_SYS_PCIE1_IO_PHYS       |\
451                                  BATU_BL_32M                    |\
452                                  BATU_VS                        |\
453                                  BATU_VP)
454 #define CONFIG_SYS_IBAT4L       (CONFIG_SYS_PCIE1_IO_PHYS       |\
455                                  BATL_PP_RW                     |\
456                                  BATL_CACHEINHIBIT)
457 #define CONFIG_SYS_IBAT4U       CONFIG_SYS_DBAT4U
458
459 /*
460  * BAT5         128K    Cacheable, non-guarded
461  * 0xe400_1000  128K    Init RAM for stack in the CPU DCache (no backing memory)
462  */
463 #define CONFIG_SYS_DBAT5L       (CONFIG_SYS_INIT_RAM_ADDR       |\
464                                  BATL_PP_RW                     |\
465                                  BATL_MEMCOHERENCE)
466 #define CONFIG_SYS_DBAT5U       (CONFIG_SYS_INIT_RAM_ADDR       |\
467                                  BATU_BL_128K                   |\
468                                  BATU_VS                        |\
469                                  BATU_VP)
470 #define CONFIG_SYS_IBAT5L       CONFIG_SYS_DBAT5L
471 #define CONFIG_SYS_IBAT5U       CONFIG_SYS_DBAT5U
472
473 /*
474  * BAT6         256M    Cache-inhibited, guarded
475  * 0xf000_0000  256M    FLASH
476  */
477 #define CONFIG_SYS_DBAT6L       (CONFIG_SYS_FLASH_BASE2         |\
478                                  BATL_PP_RW                     |\
479                                  BATL_CACHEINHIBIT              |\
480                                  BATL_GUARDEDSTORAGE)
481 #define CONFIG_SYS_DBAT6U       (CONFIG_SYS_FLASH_BASE          |\
482                                  BATU_BL_256M                   |\
483                                  BATU_VS                        |\
484                                  BATU_VP)
485 #define CONFIG_SYS_IBAT6L       (CONFIG_SYS_FLASH_BASE          |\
486                                  BATL_PP_RW                     |\
487                                  BATL_MEMCOHERENCE)
488 #define CONFIG_SYS_IBAT6U       CONFIG_SYS_DBAT6U
489
490 /* Map the last 1M of flash where we're running from reset */
491 #define CONFIG_SYS_DBAT6L_EARLY (CONFIG_SYS_MONITOR_BASE_EARLY  |\
492                                  BATL_PP_RW                     |\
493                                  BATL_CACHEINHIBIT              |\
494                                  BATL_GUARDEDSTORAGE)
495 #define CONFIG_SYS_DBAT6U_EARLY (CONFIG_SYS_TEXT_BASE                   |\
496                                  BATU_BL_1M                     |\
497                                  BATU_VS                        |\
498                                  BATU_VP)
499 #define CONFIG_SYS_IBAT6L_EARLY (CONFIG_SYS_MONITOR_BASE_EARLY  |\
500                                  BATL_PP_RW                     |\
501                                  BATL_MEMCOHERENCE)
502 #define CONFIG_SYS_IBAT6U_EARLY CONFIG_SYS_DBAT6U_EARLY
503
504 /*
505  * BAT7         64M     Cache-inhibited, guarded
506  * 0xe800_0000  64K     NAND FLASH
507  * 0xe804_0000  128K    DUART Registers
508  */
509 #define CONFIG_SYS_DBAT7L       (CONFIG_SYS_NAND_BASE           |\
510                                  BATL_PP_RW                     |\
511                                  BATL_CACHEINHIBIT              |\
512                                  BATL_GUARDEDSTORAGE)
513 #define CONFIG_SYS_DBAT7U       (CONFIG_SYS_NAND_BASE           |\
514                                  BATU_BL_512K                   |\
515                                  BATU_VS                        |\
516                                  BATU_VP)
517 #define CONFIG_SYS_IBAT7L       (CONFIG_SYS_NAND_BASE           |\
518                                  BATL_PP_RW                     |\
519                                  BATL_CACHEINHIBIT)
520 #define CONFIG_SYS_IBAT7U       CONFIG_SYS_DBAT7U
521
522 /*
523  * Command configuration.
524  */
525 #include <config_cmd_default.h>
526
527 #define CONFIG_CMD_ASKENV
528 #define CONFIG_CMD_DATE
529 #define CONFIG_CMD_DHCP
530 #define CONFIG_CMD_DS4510
531 #define CONFIG_CMD_DS4510_INFO
532 #define CONFIG_CMD_DTT
533 #define CONFIG_CMD_EEPROM
534 #define CONFIG_CMD_ELF
535 #define CONFIG_CMD_SAVEENV
536 #define CONFIG_CMD_FLASH
537 #define CONFIG_CMD_I2C
538 #define CONFIG_CMD_IRQ
539 #define CONFIG_CMD_JFFS2
540 #define CONFIG_CMD_MII
541 #define CONFIG_CMD_NAND
542 #define CONFIG_CMD_NET
543 #define CONFIG_CMD_PCA953X
544 #define CONFIG_CMD_PCA953X_INFO
545 #define CONFIG_CMD_PCI
546 #define CONFIG_CMD_PING
547 #define CONFIG_CMD_REGINFO
548 #define CONFIG_CMD_SNTP
549
550 /*
551  * Miscellaneous configurable options
552  */
553 #define CONFIG_SYS_LONGHELP                     /* undef to save memory */
554 #define CONFIG_SYS_LOAD_ADDR    0x2000000       /* default load address */
555 #define CONFIG_SYS_PROMPT       "=> "           /* Monitor Command Prompt */
556 #define CONFIG_SYS_CBSIZE       256             /* Console I/O Buffer Size */
557 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
558 #define CONFIG_SYS_MAXARGS      16              /* max number of command args */
559 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size */
560 #define CONFIG_SYS_HZ           1000            /* decrementer freq: 1ms ticks */
561 #define CONFIG_CMDLINE_EDITING  1               /* Command-line editing */
562 #define CONFIG_LOADADDR         0x1000000       /* default location for tftp and bootm */
563 #define CONFIG_BOOTDELAY        3               /* -1 disables auto-boot */
564 #define CONFIG_PANIC_HANG                       /* do not reset board on panic */
565 #define CONFIG_PREBOOT                          /* enable preboot variable */
566 #define CONFIG_FIT              1
567 #define CONFIG_FIT_VERBOSE      1
568 #define CONFIG_INTEGRITY                        /* support booting INTEGRITY OS */
569
570 /*
571  * For booting Linux, the board info and command line data
572  * have to be in the first 16 MB of memory, since this is
573  * the maximum mapped by the Linux kernel during initialization.
574  */
575 #define CONFIG_SYS_BOOTMAPSZ    (16 << 20)      /* Initial Memory map for Linux*/
576 #define CONFIG_SYS_BOOTM_LEN    (16 << 20)      /* Increase max gunzip size */
577
578 /*
579  * Boot Flags
580  */
581 #define BOOTFLAG_COLD           0x01            /* Normal Power-On: Boot from FLASH */
582 #define BOOTFLAG_WARM           0x02            /* Software reboot */
583
584 /*
585  * Environment Configuration
586  */
587 #define CONFIG_ENV_IS_IN_FLASH  1
588 #define CONFIG_ENV_SECT_SIZE    0x20000         /* 128k (one sector) for env */
589 #define CONFIG_ENV_SIZE         0x8000
590 #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
591
592 /*
593  * Flash memory map:
594  * fffc0000 - ffffffff  Pri FDT (256KB)
595  * fff80000 - fffbffff  Pri U-Boot Environment (256 KB)
596  * fff00000 - fff7ffff  Pri U-Boot (512 KB)
597  * fef00000 - ffefffff  Pri OS image (16MB)
598  * f8000000 - feefffff  Pri OS Use/Filesystem (111MB)
599  *
600  * f7fc0000 - f7ffffff  Sec FDT (256KB)
601  * f7f80000 - f7fbffff  Sec U-Boot Environment (256 KB)
602  * f7f00000 - f7f7ffff  Sec U-Boot (512 KB)
603  * f6f00000 - f7efffff  Sec OS image (16MB)
604  * f0000000 - f6efffff  Sec OS Use/Filesystem (111MB)
605  */
606 #define CONFIG_UBOOT1_ENV_ADDR  MK_STR(0xfff00000)
607 #define CONFIG_UBOOT2_ENV_ADDR  MK_STR(0xf7f00000)
608 #define CONFIG_FDT1_ENV_ADDR    MK_STR(0xfffc0000)
609 #define CONFIG_FDT2_ENV_ADDR    MK_STR(0xf7fc0000)
610 #define CONFIG_OS1_ENV_ADDR     MK_STR(0xfef00000)
611 #define CONFIG_OS2_ENV_ADDR     MK_STR(0xf6f00000)
612
613 #define CONFIG_PROG_UBOOT1                                              \
614         "$download_cmd $loadaddr $ubootfile; "                          \
615         "if test $? -eq 0; then "                                       \
616                 "protect off "CONFIG_UBOOT1_ENV_ADDR" +80000; "         \
617                 "erase "CONFIG_UBOOT1_ENV_ADDR" +80000; "               \
618                 "cp.w $loadaddr "CONFIG_UBOOT1_ENV_ADDR" 40000; "       \
619                 "protect on "CONFIG_UBOOT1_ENV_ADDR" +80000; "          \
620                 "cmp.b $loadaddr "CONFIG_UBOOT1_ENV_ADDR" 80000; "      \
621                 "if test $? -ne 0; then "                               \
622                         "echo PROGRAM FAILED; "                         \
623                 "else; "                                                \
624                         "echo PROGRAM SUCCEEDED; "                      \
625                 "fi; "                                                  \
626         "else; "                                                        \
627                 "echo DOWNLOAD FAILED; "                                \
628         "fi;"
629
630 #define CONFIG_PROG_UBOOT2                                              \
631         "$download_cmd $loadaddr $ubootfile; "                          \
632         "if test $? -eq 0; then "                                       \
633                 "protect off "CONFIG_UBOOT2_ENV_ADDR" +80000; "         \
634                 "erase "CONFIG_UBOOT2_ENV_ADDR" +80000; "               \
635                 "cp.w $loadaddr "CONFIG_UBOOT2_ENV_ADDR" 40000; "       \
636                 "protect on "CONFIG_UBOOT2_ENV_ADDR" +80000; "          \
637                 "cmp.b $loadaddr "CONFIG_UBOOT2_ENV_ADDR" 80000; "      \
638                 "if test $? -ne 0; then "                               \
639                         "echo PROGRAM FAILED; "                         \
640                 "else; "                                                \
641                         "echo PROGRAM SUCCEEDED; "                      \
642                 "fi; "                                                  \
643         "else; "                                                        \
644                 "echo DOWNLOAD FAILED; "                                \
645         "fi;"
646
647 #define CONFIG_BOOT_OS_NET                                              \
648         "$download_cmd $osaddr $osfile; "                               \
649         "if test $? -eq 0; then "                                       \
650                 "if test -n $fdtaddr; then "                            \
651                         "$download_cmd $fdtaddr $fdtfile; "             \
652                         "if test $? -eq 0; then "                       \
653                                 "bootm $osaddr - $fdtaddr; "            \
654                         "else; "                                        \
655                                 "echo FDT DOWNLOAD FAILED; "            \
656                         "fi; "                                          \
657                 "else; "                                                \
658                         "bootm $osaddr; "                               \
659                 "fi; "                                                  \
660         "else; "                                                        \
661                 "echo OS DOWNLOAD FAILED; "                             \
662         "fi;"
663
664 #define CONFIG_PROG_OS1                                                 \
665         "$download_cmd $osaddr $osfile; "                               \
666         "if test $? -eq 0; then "                                       \
667                 "erase "CONFIG_OS1_ENV_ADDR" +$filesize; "              \
668                 "cp.b $osaddr "CONFIG_OS1_ENV_ADDR" $filesize; "        \
669                 "cmp.b $osaddr "CONFIG_OS1_ENV_ADDR" $filesize; "       \
670                 "if test $? -ne 0; then "                               \
671                         "echo OS PROGRAM FAILED; "                      \
672                 "else; "                                                \
673                         "echo OS PROGRAM SUCCEEDED; "                   \
674                 "fi; "                                                  \
675         "else; "                                                        \
676                 "echo OS DOWNLOAD FAILED; "                             \
677         "fi;"
678
679 #define CONFIG_PROG_OS2                                                 \
680         "$download_cmd $osaddr $osfile; "                               \
681         "if test $? -eq 0; then "                                       \
682                 "erase "CONFIG_OS2_ENV_ADDR" +$filesize; "              \
683                 "cp.b $osaddr "CONFIG_OS2_ENV_ADDR" $filesize; "        \
684                 "cmp.b $osaddr "CONFIG_OS2_ENV_ADDR" $filesize; "       \
685                 "if test $? -ne 0; then "                               \
686                         "echo OS PROGRAM FAILED; "                      \
687                 "else; "                                                \
688                         "echo OS PROGRAM SUCCEEDED; "                   \
689                 "fi; "                                                  \
690         "else; "                                                        \
691                 "echo OS DOWNLOAD FAILED; "                             \
692         "fi;"
693
694 #define CONFIG_PROG_FDT1                                                \
695         "$download_cmd $fdtaddr $fdtfile; "                             \
696         "if test $? -eq 0; then "                                       \
697                 "erase "CONFIG_FDT1_ENV_ADDR" +$filesize;"              \
698                 "cp.b $fdtaddr "CONFIG_FDT1_ENV_ADDR" $filesize; "      \
699                 "cmp.b $fdtaddr "CONFIG_FDT1_ENV_ADDR" $filesize; "     \
700                 "if test $? -ne 0; then "                               \
701                         "echo FDT PROGRAM FAILED; "                     \
702                 "else; "                                                \
703                         "echo FDT PROGRAM SUCCEEDED; "                  \
704                 "fi; "                                                  \
705         "else; "                                                        \
706                 "echo FDT DOWNLOAD FAILED; "                            \
707         "fi;"
708
709 #define CONFIG_PROG_FDT2                                                \
710         "$download_cmd $fdtaddr $fdtfile; "                             \
711         "if test $? -eq 0; then "                                       \
712                 "erase "CONFIG_FDT2_ENV_ADDR" +$filesize;"              \
713                 "cp.b $fdtaddr "CONFIG_FDT2_ENV_ADDR" $filesize; "      \
714                 "cmp.b $fdtaddr "CONFIG_FDT2_ENV_ADDR" $filesize; "     \
715                 "if test $? -ne 0; then "                               \
716                         "echo FDT PROGRAM FAILED; "                     \
717                 "else; "                                                \
718                         "echo FDT PROGRAM SUCCEEDED; "                  \
719                 "fi; "                                                  \
720         "else; "                                                        \
721                 "echo FDT DOWNLOAD FAILED; "                            \
722         "fi;"
723
724 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
725         "autoload=yes\0"                                                \
726         "download_cmd=tftp\0"                                           \
727         "console_args=console=ttyS0,115200\0"                           \
728         "root_args=root=/dev/nfs rw\0"                                  \
729         "misc_args=ip=on\0"                                             \
730         "set_bootargs=setenv bootargs ${console_args} ${root_args} ${misc_args}\0" \
731         "bootfile=/home/user/file\0"                                    \
732         "osfile=/home/user/uImage-XPedite5170\0"                        \
733         "fdtfile=/home/user/xpedite5170.dtb\0"                          \
734         "ubootfile=/home/user/u-boot.bin\0"                             \
735         "fdtaddr=c00000\0"                                              \
736         "osaddr=0x1000000\0"                                            \
737         "loadaddr=0x1000000\0"                                          \
738         "prog_uboot1="CONFIG_PROG_UBOOT1"\0"                            \
739         "prog_uboot2="CONFIG_PROG_UBOOT2"\0"                            \
740         "prog_os1="CONFIG_PROG_OS1"\0"                                  \
741         "prog_os2="CONFIG_PROG_OS2"\0"                                  \
742         "prog_fdt1="CONFIG_PROG_FDT1"\0"                                \
743         "prog_fdt2="CONFIG_PROG_FDT2"\0"                                \
744         "bootcmd_net=run set_bootargs; "CONFIG_BOOT_OS_NET"\0"          \
745         "bootcmd_flash1=run set_bootargs; "                             \
746                 "bootm "CONFIG_OS1_ENV_ADDR" - "CONFIG_FDT1_ENV_ADDR"\0"\
747         "bootcmd_flash2=run set_bootargs; "                             \
748                 "bootm "CONFIG_OS2_ENV_ADDR" - "CONFIG_FDT2_ENV_ADDR"\0"\
749         "bootcmd=run bootcmd_flash1\0"
750 #endif  /* __CONFIG_H */