mpc83xx: Migrate legacy PCI options to Kconfig
[platform/kernel/u-boot.git] / include / configs / MPC8349EMDS.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2006-2010
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5  */
6
7 /*
8  * mpc8349emds board configuration file
9  *
10  */
11
12 #ifndef __CONFIG_H
13 #define __CONFIG_H
14
15 /*
16  * High Level Configuration Options
17  */
18 #define CONFIG_E300             1       /* E300 Family */
19
20 #define CONFIG_PCI_66M
21 #ifdef CONFIG_PCI_66M
22 #define CONFIG_83XX_CLKIN       66000000        /* in Hz */
23 #else
24 #define CONFIG_83XX_CLKIN       33000000        /* in Hz */
25 #endif
26
27 #ifdef CONFIG_PCISLAVE
28 #define CONFIG_83XX_PCICLK      66666666        /* in Hz */
29 #endif /* CONFIG_PCISLAVE */
30
31 #ifndef CONFIG_SYS_CLK_FREQ
32 #ifdef CONFIG_PCI_66M
33 #define CONFIG_SYS_CLK_FREQ     66000000
34 #define HRCWL_CSB_TO_CLKIN      HRCWL_CSB_TO_CLKIN_4X1
35 #else
36 #define CONFIG_SYS_CLK_FREQ     33000000
37 #define HRCWL_CSB_TO_CLKIN      HRCWL_CSB_TO_CLKIN_8X1
38 #endif
39 #endif
40
41 #define CONFIG_SYS_IMMR         0xE0000000
42
43 #undef CONFIG_SYS_DRAM_TEST             /* memory test, takes time */
44 #define CONFIG_SYS_MEMTEST_START        0x00000000      /* memtest region */
45 #define CONFIG_SYS_MEMTEST_END          0x00100000
46
47 /*
48  * DDR Setup
49  */
50 #define CONFIG_DDR_ECC                  /* support DDR ECC function */
51 #define CONFIG_DDR_ECC_CMD              /* use DDR ECC user commands */
52 #define CONFIG_SPD_EEPROM               /* use SPD EEPROM for DDR setup*/
53
54 /*
55  * SYS_FSL_DDR2 is selected in Kconfig to use unified DDR driver
56  * unselect it to use old spd_sdram.c
57  */
58 #define CONFIG_SYS_SPD_BUS_NUM  0
59 #define SPD_EEPROM_ADDRESS1     0x52
60 #define SPD_EEPROM_ADDRESS2     0x51
61 #define CONFIG_DIMM_SLOTS_PER_CTLR      2
62 #define CONFIG_CHIP_SELECTS_PER_CTRL    (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
63 #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
64 #define CONFIG_MEM_INIT_VALUE   0xDeadBeef
65
66 /*
67  * 32-bit data path mode.
68  *
69  * Please note that using this mode for devices with the real density of 64-bit
70  * effectively reduces the amount of available memory due to the effect of
71  * wrapping around while translating address to row/columns, for example in the
72  * 256MB module the upper 128MB get aliased with contents of the lower
73  * 128MB); normally this define should be used for devices with real 32-bit
74  * data path.
75  */
76 #undef CONFIG_DDR_32BIT
77
78 #define CONFIG_SYS_DDR_BASE     0x00000000      /* DDR is system memory*/
79 #define CONFIG_SYS_SDRAM_BASE   CONFIG_SYS_DDR_BASE
80 #define CONFIG_SYS_DDR_SDRAM_BASE       CONFIG_SYS_DDR_BASE
81 #define CONFIG_SYS_DDR_SDRAM_CLK_CNTL   (DDR_SDRAM_CLK_CNTL_SS_EN \
82                                         | DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
83 #undef  CONFIG_DDR_2T_TIMING
84
85 /*
86  * DDRCDR - DDR Control Driver Register
87  */
88 #define CONFIG_SYS_DDRCDR_VALUE 0x80080001
89
90 #if defined(CONFIG_SPD_EEPROM)
91 /*
92  * Determine DDR configuration from I2C interface.
93  */
94 #define SPD_EEPROM_ADDRESS      0x51            /* DDR DIMM */
95 #else
96 /*
97  * Manually set up DDR parameters
98  */
99 #define CONFIG_SYS_DDR_SIZE             256             /* MB */
100 #if defined(CONFIG_DDR_II)
101 #define CONFIG_SYS_DDRCDR               0x80080001
102 #define CONFIG_SYS_DDR_CS2_BNDS         0x0000000f
103 #define CONFIG_SYS_DDR_CS2_CONFIG       0x80330102
104 #define CONFIG_SYS_DDR_TIMING_0         0x00220802
105 #define CONFIG_SYS_DDR_TIMING_1         0x38357322
106 #define CONFIG_SYS_DDR_TIMING_2         0x2f9048c8
107 #define CONFIG_SYS_DDR_TIMING_3         0x00000000
108 #define CONFIG_SYS_DDR_CLK_CNTL         0x02000000
109 #define CONFIG_SYS_DDR_MODE             0x47d00432
110 #define CONFIG_SYS_DDR_MODE2            0x8000c000
111 #define CONFIG_SYS_DDR_INTERVAL         0x03cf0080
112 #define CONFIG_SYS_DDR_SDRAM_CFG        0x43000000
113 #define CONFIG_SYS_DDR_SDRAM_CFG2       0x00401000
114 #else
115 #define CONFIG_SYS_DDR_CS2_CONFIG       (CSCONFIG_EN \
116                                 | CSCONFIG_ROW_BIT_13 \
117                                 | CSCONFIG_COL_BIT_10)
118 #define CONFIG_SYS_DDR_TIMING_1 0x36332321
119 #define CONFIG_SYS_DDR_TIMING_2 0x00000800      /* P9-45,may need tuning */
120 #define CONFIG_SYS_DDR_CONTROL  0xc2000000      /* unbuffered,no DYN_PWR */
121 #define CONFIG_SYS_DDR_INTERVAL 0x04060100      /* autocharge,no open page */
122
123 #if defined(CONFIG_DDR_32BIT)
124 /* set burst length to 8 for 32-bit data path */
125                                 /* DLL,normal,seq,4/2.5, 8 burst len */
126 #define CONFIG_SYS_DDR_MODE     0x00000023
127 #else
128 /* the default burst length is 4 - for 64-bit data path */
129                                 /* DLL,normal,seq,4/2.5, 4 burst len */
130 #define CONFIG_SYS_DDR_MODE     0x00000022
131 #endif
132 #endif
133 #endif
134
135 /*
136  * SDRAM on the Local Bus
137  */
138 #define CONFIG_SYS_LBC_SDRAM_BASE       0xF0000000      /* Localbus SDRAM */
139 #define CONFIG_SYS_LBC_SDRAM_SIZE       64              /* LBC SDRAM is 64MB */
140
141 /*
142  * FLASH on the Local Bus
143  */
144 #define CONFIG_SYS_FLASH_BASE           0xFE000000      /* start of FLASH   */
145 #define CONFIG_SYS_FLASH_SIZE           32      /* max flash size in MB */
146
147 #define CONFIG_SYS_BR0_PRELIM   (CONFIG_SYS_FLASH_BASE \
148                                 | BR_PS_16      /* 16 bit port  */ \
149                                 | BR_MS_GPCM    /* MSEL = GPCM */ \
150                                 | BR_V)         /* valid */
151 #define CONFIG_SYS_OR0_PRELIM   (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
152                                 | OR_UPM_XAM \
153                                 | OR_GPCM_CSNT \
154                                 | OR_GPCM_ACS_DIV2 \
155                                 | OR_GPCM_XACS \
156                                 | OR_GPCM_SCY_15 \
157                                 | OR_GPCM_TRLX_SET \
158                                 | OR_GPCM_EHTR_SET \
159                                 | OR_GPCM_EAD)
160
161                                         /* window base at flash base */
162 #define CONFIG_SYS_LBLAWBAR0_PRELIM     CONFIG_SYS_FLASH_BASE
163 #define CONFIG_SYS_LBLAWAR0_PRELIM      (LBLAWAR_EN | LBLAWAR_32MB)
164
165 #define CONFIG_SYS_MAX_FLASH_BANKS      1       /* number of banks */
166 #define CONFIG_SYS_MAX_FLASH_SECT       256     /* max sectors per device */
167
168 #undef CONFIG_SYS_FLASH_CHECKSUM
169 #define CONFIG_SYS_FLASH_ERASE_TOUT     60000   /* Flash Erase Timeout (ms) */
170 #define CONFIG_SYS_FLASH_WRITE_TOUT     500     /* Flash Write Timeout (ms) */
171
172 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE    /* start of monitor */
173
174 #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
175 #define CONFIG_SYS_RAMBOOT
176 #else
177 #undef  CONFIG_SYS_RAMBOOT
178 #endif
179
180 /*
181  * BCSR register on local bus 32KB, 8-bit wide for MDS config reg
182  */
183 #define CONFIG_SYS_BCSR                 0xE2400000
184                                         /* Access window base at BCSR base */
185 #define CONFIG_SYS_LBLAWBAR1_PRELIM     CONFIG_SYS_BCSR
186 #define CONFIG_SYS_LBLAWAR1_PRELIM      (LBLAWAR_EN | LBLAWAR_32KB)
187 #define CONFIG_SYS_BR1_PRELIM           (CONFIG_SYS_BCSR \
188                                         | BR_PS_8 \
189                                         | BR_MS_GPCM \
190                                         | BR_V)
191                                         /* 0x00000801 */
192 #define CONFIG_SYS_OR1_PRELIM           (OR_AM_32KB \
193                                         | OR_GPCM_XAM \
194                                         | OR_GPCM_CSNT \
195                                         | OR_GPCM_SCY_15 \
196                                         | OR_GPCM_TRLX_CLEAR \
197                                         | OR_GPCM_EHTR_CLEAR)
198                                         /* 0xFFFFE8F0 */
199
200 #define CONFIG_SYS_INIT_RAM_LOCK        1
201 #define CONFIG_SYS_INIT_RAM_ADDR        0xFD000000      /* Initial RAM addr */
202 #define CONFIG_SYS_INIT_RAM_SIZE        0x1000  /* Size of used area in RAM*/
203
204 #define CONFIG_SYS_GBL_DATA_OFFSET      \
205                         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
206 #define CONFIG_SYS_INIT_SP_OFFSET       CONFIG_SYS_GBL_DATA_OFFSET
207
208 #define CONFIG_SYS_MONITOR_LEN  (512 * 1024)    /* Reserve 512 kB for Mon */
209 #define CONFIG_SYS_MALLOC_LEN   (256 * 1024)    /* Reserved for malloc */
210
211 /*
212  * Local Bus LCRR and LBCR regs
213  *    LCRR:  DLL bypass, Clock divider is 4
214  * External Local Bus rate is
215  *    CLKIN * HRCWL_CSB_TO_CLKIN / HRCWL_LCL_BUS_TO_SCB_CLK / LCRR_CLKDIV
216  */
217 #define CONFIG_SYS_LCRR_DBYP    LCRR_DBYP
218 #define CONFIG_SYS_LCRR_CLKDIV  LCRR_CLKDIV_4
219 #define CONFIG_SYS_LBC_LBCR     0x00000000
220
221 /*
222  * Serial Port
223  */
224 #define CONFIG_SYS_NS16550_SERIAL
225 #define CONFIG_SYS_NS16550_REG_SIZE    1
226 #define CONFIG_SYS_NS16550_CLK          get_bus_freq(0)
227
228 #define CONFIG_SYS_BAUDRATE_TABLE  \
229                 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
230
231 #define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
232 #define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
233
234 /* I2C */
235 #define CONFIG_SYS_I2C
236 #define CONFIG_SYS_I2C_FSL
237 #define CONFIG_SYS_FSL_I2C_SPEED        400000
238 #define CONFIG_SYS_FSL_I2C_SLAVE        0x7F
239 #define CONFIG_SYS_FSL_I2C_OFFSET       0x3000
240 #define CONFIG_SYS_FSL_I2C2_SPEED       400000
241 #define CONFIG_SYS_FSL_I2C2_SLAVE       0x7F
242 #define CONFIG_SYS_FSL_I2C2_OFFSET      0x3100
243 #define CONFIG_SYS_I2C_NOPROBES         { {0, 0x69} }
244
245 /* SPI */
246 #undef CONFIG_SOFT_SPI                  /* SPI bit-banged */
247
248 /* GPIOs.  Used as SPI chip selects */
249 #define CONFIG_SYS_GPIO1_PRELIM
250 #define CONFIG_SYS_GPIO1_DIR            0xC0000000  /* SPI CS on 0, LED on 1 */
251 #define CONFIG_SYS_GPIO1_DAT            0xC0000000  /* Both are active LOW */
252
253 /* TSEC */
254 #define CONFIG_SYS_TSEC1_OFFSET 0x24000
255 #define CONFIG_SYS_TSEC1        (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC1_OFFSET)
256 #define CONFIG_SYS_TSEC2_OFFSET 0x25000
257 #define CONFIG_SYS_TSEC2        (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC2_OFFSET)
258
259 /* USB */
260 #define CONFIG_SYS_USE_MPC834XSYS_USB_PHY       1 /* Use SYS board PHY */
261
262 /*
263  * General PCI
264  * Addresses are mapped 1-1.
265  */
266 #define CONFIG_SYS_PCI1_MEM_BASE        0x80000000
267 #define CONFIG_SYS_PCI1_MEM_PHYS        CONFIG_SYS_PCI1_MEM_BASE
268 #define CONFIG_SYS_PCI1_MEM_SIZE        0x10000000      /* 256M */
269 #define CONFIG_SYS_PCI1_MMIO_BASE       0x90000000
270 #define CONFIG_SYS_PCI1_MMIO_PHYS       CONFIG_SYS_PCI1_MMIO_BASE
271 #define CONFIG_SYS_PCI1_MMIO_SIZE       0x10000000      /* 256M */
272 #define CONFIG_SYS_PCI1_IO_BASE         0x00000000
273 #define CONFIG_SYS_PCI1_IO_PHYS         0xE2000000
274 #define CONFIG_SYS_PCI1_IO_SIZE         0x00100000      /* 1M */
275
276 #define CONFIG_SYS_PCI2_MEM_BASE        0xA0000000
277 #define CONFIG_SYS_PCI2_MEM_PHYS        CONFIG_SYS_PCI2_MEM_BASE
278 #define CONFIG_SYS_PCI2_MEM_SIZE        0x10000000      /* 256M */
279 #define CONFIG_SYS_PCI2_MMIO_BASE       0xB0000000
280 #define CONFIG_SYS_PCI2_MMIO_PHYS       CONFIG_SYS_PCI2_MMIO_BASE
281 #define CONFIG_SYS_PCI2_MMIO_SIZE       0x10000000      /* 256M */
282 #define CONFIG_SYS_PCI2_IO_BASE         0x00000000
283 #define CONFIG_SYS_PCI2_IO_PHYS         0xE2100000
284 #define CONFIG_SYS_PCI2_IO_SIZE         0x00100000      /* 1M */
285
286 #if defined(CONFIG_PCI)
287
288 #define CONFIG_83XX_PCI_STREAMING
289
290 #undef CONFIG_EEPRO100
291 #undef CONFIG_TULIP
292
293 #if !defined(CONFIG_PCI_PNP)
294         #define PCI_ENET0_IOADDR        0xFIXME
295         #define PCI_ENET0_MEMADDR       0xFIXME
296         #define PCI_IDSEL_NUMBER        0x0c    /* slot0->3(IDSEL)=12->15 */
297 #endif
298
299 #undef CONFIG_PCI_SCAN_SHOW             /* show pci devices on startup */
300 #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1957  /* Freescale */
301
302 #endif  /* CONFIG_PCI */
303
304 /*
305  * TSEC configuration
306  */
307
308 #if defined(CONFIG_TSEC_ENET)
309
310 #define CONFIG_GMII             1       /* MII PHY management */
311 #define CONFIG_TSEC1            1
312 #define CONFIG_TSEC1_NAME       "TSEC0"
313 #define CONFIG_TSEC2            1
314 #define CONFIG_TSEC2_NAME       "TSEC1"
315 #define TSEC1_PHY_ADDR          0
316 #define TSEC2_PHY_ADDR          1
317 #define TSEC1_PHYIDX            0
318 #define TSEC2_PHYIDX            0
319 #define TSEC1_FLAGS             TSEC_GIGABIT
320 #define TSEC2_FLAGS             TSEC_GIGABIT
321
322 /* Options are: TSEC[0-1] */
323 #define CONFIG_ETHPRIME         "TSEC0"
324
325 #endif  /* CONFIG_TSEC_ENET */
326
327 /*
328  * Configure on-board RTC
329  */
330 #define CONFIG_RTC_DS1374               /* use ds1374 rtc via i2c */
331 #define CONFIG_SYS_I2C_RTC_ADDR 0x68    /* at address 0x68 */
332
333 /*
334  * Environment
335  */
336 #ifndef CONFIG_SYS_RAMBOOT
337         #define CONFIG_ENV_ADDR         \
338                         (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
339         #define CONFIG_ENV_SECT_SIZE    0x20000 /* 128K(one sector) for env */
340         #define CONFIG_ENV_SIZE         0x2000
341
342 /* Address and size of Redundant Environment Sector     */
343 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
344 #define CONFIG_ENV_SIZE_REDUND  (CONFIG_ENV_SIZE)
345
346 #else
347         #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE - 0x1000)
348         #define CONFIG_ENV_SIZE         0x2000
349 #endif
350
351 #define CONFIG_LOADS_ECHO       1       /* echo on for serial download */
352 #define CONFIG_SYS_LOADS_BAUD_CHANGE    1       /* allow baudrate change */
353
354 /*
355  * BOOTP options
356  */
357 #define CONFIG_BOOTP_BOOTFILESIZE
358
359 /*
360  * Command line configuration.
361  */
362
363 #undef CONFIG_WATCHDOG                  /* watchdog disabled */
364
365 /*
366  * Miscellaneous configurable options
367  */
368 #define CONFIG_SYS_LOAD_ADDR    0x2000000       /* default load address */
369
370 /*
371  * For booting Linux, the board info and command line data
372  * have to be in the first 256 MB of memory, since this is
373  * the maximum mapped by the Linux kernel during initialization.
374  */
375                                 /* Initial Memory map for Linux*/
376 #define CONFIG_SYS_BOOTMAPSZ    (256 << 20)
377 #define CONFIG_SYS_BOOTM_LEN    (64 << 20)      /* Increase max gunzip size */
378
379 #define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST  */
380
381 #if 1 /*528/264*/
382 #define CONFIG_SYS_HRCW_LOW (\
383         HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
384         HRCWL_DDR_TO_SCB_CLK_1X1 |\
385         HRCWL_CSB_TO_CLKIN |\
386         HRCWL_VCO_1X2 |\
387         HRCWL_CORE_TO_CSB_2X1)
388 #elif 0 /*396/132*/
389 #define CONFIG_SYS_HRCW_LOW (\
390         HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
391         HRCWL_DDR_TO_SCB_CLK_1X1 |\
392         HRCWL_CSB_TO_CLKIN |\
393         HRCWL_VCO_1X4 |\
394         HRCWL_CORE_TO_CSB_3X1)
395 #elif 0 /*264/132*/
396 #define CONFIG_SYS_HRCW_LOW (\
397         HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
398         HRCWL_DDR_TO_SCB_CLK_1X1 |\
399         HRCWL_CSB_TO_CLKIN |\
400         HRCWL_VCO_1X4 |\
401         HRCWL_CORE_TO_CSB_2X1)
402 #elif 0 /*132/132*/
403 #define CONFIG_SYS_HRCW_LOW (\
404         HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
405         HRCWL_DDR_TO_SCB_CLK_1X1 |\
406         HRCWL_CSB_TO_CLKIN |\
407         HRCWL_VCO_1X4 |\
408         HRCWL_CORE_TO_CSB_1X1)
409 #elif 0 /*264/264 */
410 #define CONFIG_SYS_HRCW_LOW (\
411         HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
412         HRCWL_DDR_TO_SCB_CLK_1X1 |\
413         HRCWL_CSB_TO_CLKIN |\
414         HRCWL_VCO_1X4 |\
415         HRCWL_CORE_TO_CSB_1X1)
416 #endif
417
418 #ifdef CONFIG_PCISLAVE
419 #define CONFIG_SYS_HRCW_HIGH (\
420         HRCWH_PCI_AGENT |\
421         HRCWH_64_BIT_PCI |\
422         HRCWH_PCI1_ARBITER_DISABLE |\
423         HRCWH_PCI2_ARBITER_DISABLE |\
424         HRCWH_CORE_ENABLE |\
425         HRCWH_FROM_0X00000100 |\
426         HRCWH_BOOTSEQ_DISABLE |\
427         HRCWH_SW_WATCHDOG_DISABLE |\
428         HRCWH_ROM_LOC_LOCAL_16BIT |\
429         HRCWH_TSEC1M_IN_GMII |\
430         HRCWH_TSEC2M_IN_GMII)
431 #else
432 #if defined(CONFIG_PCI_64BIT)
433 #define CONFIG_SYS_HRCW_HIGH (\
434         HRCWH_PCI_HOST |\
435         HRCWH_64_BIT_PCI |\
436         HRCWH_PCI1_ARBITER_ENABLE |\
437         HRCWH_PCI2_ARBITER_DISABLE |\
438         HRCWH_CORE_ENABLE |\
439         HRCWH_FROM_0X00000100 |\
440         HRCWH_BOOTSEQ_DISABLE |\
441         HRCWH_SW_WATCHDOG_DISABLE |\
442         HRCWH_ROM_LOC_LOCAL_16BIT |\
443         HRCWH_TSEC1M_IN_GMII |\
444         HRCWH_TSEC2M_IN_GMII)
445 #else
446 #define CONFIG_SYS_HRCW_HIGH (\
447         HRCWH_PCI_HOST |\
448         HRCWH_32_BIT_PCI |\
449         HRCWH_PCI1_ARBITER_ENABLE |\
450         HRCWH_PCI2_ARBITER_ENABLE |\
451         HRCWH_CORE_ENABLE |\
452         HRCWH_FROM_0X00000100 |\
453         HRCWH_BOOTSEQ_DISABLE |\
454         HRCWH_SW_WATCHDOG_DISABLE |\
455         HRCWH_ROM_LOC_LOCAL_16BIT |\
456         HRCWH_TSEC1M_IN_GMII |\
457         HRCWH_TSEC2M_IN_GMII)
458 #endif /* CONFIG_PCI_64BIT */
459 #endif /* CONFIG_PCISLAVE */
460
461 /*
462  * System performance
463  */
464 #define CONFIG_SYS_ACR_PIPE_DEP 3       /* Arbiter pipeline depth (0-3) */
465 #define CONFIG_SYS_ACR_RPTCNT   3       /* Arbiter repeat count (0-7) */
466 #define CONFIG_SYS_SPCR_TSEC1EP 3       /* TSEC1 emergency priority (0-3) */
467 #define CONFIG_SYS_SPCR_TSEC2EP 3       /* TSEC2 emergency priority (0-3) */
468 #define CONFIG_SYS_SCCR_TSEC1CM 1       /* TSEC1 clock mode (0-3) */
469 #define CONFIG_SYS_SCCR_TSEC2CM 1       /* TSEC2 & I2C0 clock mode (0-3) */
470
471 /* System IO Config */
472 #define CONFIG_SYS_SICRH 0
473 #define CONFIG_SYS_SICRL SICRL_LDP_A
474
475 #define CONFIG_SYS_HID0_INIT    0x000000000
476 #define CONFIG_SYS_HID0_FINAL   (HID0_ENABLE_MACHINE_CHECK \
477                                 | HID0_ENABLE_INSTRUCTION_CACHE)
478
479 /* #define CONFIG_SYS_HID0_FINAL        (\
480         HID0_ENABLE_INSTRUCTION_CACHE |\
481         HID0_ENABLE_M_BIT |\
482         HID0_ENABLE_ADDRESS_BROADCAST) */
483
484 #define CONFIG_SYS_HID2 HID2_HBE
485 #define CONFIG_HIGH_BATS        1       /* High BATs supported */
486
487 /* DDR @ 0x00000000 */
488 #define CONFIG_SYS_IBAT0L       (CONFIG_SYS_SDRAM_BASE \
489                                 | BATL_PP_RW \
490                                 | BATL_MEMCOHERENCE)
491 #define CONFIG_SYS_IBAT0U       (CONFIG_SYS_SDRAM_BASE \
492                                 | BATU_BL_256M \
493                                 | BATU_VS \
494                                 | BATU_VP)
495
496 /* PCI @ 0x80000000 */
497 #ifdef CONFIG_PCI
498 #define CONFIG_PCI_INDIRECT_BRIDGE
499 #define CONFIG_SYS_IBAT1L       (CONFIG_SYS_PCI1_MEM_BASE \
500                                 | BATL_PP_RW \
501                                 | BATL_MEMCOHERENCE)
502 #define CONFIG_SYS_IBAT1U       (CONFIG_SYS_PCI1_MEM_BASE \
503                                 | BATU_BL_256M \
504                                 | BATU_VS \
505                                 | BATU_VP)
506 #define CONFIG_SYS_IBAT2L       (CONFIG_SYS_PCI1_MMIO_BASE \
507                                 | BATL_PP_RW \
508                                 | BATL_CACHEINHIBIT \
509                                 | BATL_GUARDEDSTORAGE)
510 #define CONFIG_SYS_IBAT2U       (CONFIG_SYS_PCI1_MMIO_BASE \
511                                 | BATU_BL_256M \
512                                 | BATU_VS \
513                                 | BATU_VP)
514 #else
515 #define CONFIG_SYS_IBAT1L       (0)
516 #define CONFIG_SYS_IBAT1U       (0)
517 #define CONFIG_SYS_IBAT2L       (0)
518 #define CONFIG_SYS_IBAT2U       (0)
519 #endif
520
521 #ifdef CONFIG_MPC83XX_PCI2
522 #define CONFIG_SYS_IBAT3L       (CONFIG_SYS_PCI2_MEM_BASE \
523                                 | BATL_PP_RW \
524                                 | BATL_MEMCOHERENCE)
525 #define CONFIG_SYS_IBAT3U       (CONFIG_SYS_PCI2_MEM_BASE \
526                                 | BATU_BL_256M \
527                                 | BATU_VS \
528                                 | BATU_VP)
529 #define CONFIG_SYS_IBAT4L       (CONFIG_SYS_PCI2_MMIO_BASE \
530                                 | BATL_PP_RW \
531                                 | BATL_CACHEINHIBIT \
532                                 | BATL_GUARDEDSTORAGE)
533 #define CONFIG_SYS_IBAT4U       (CONFIG_SYS_PCI2_MMIO_BASE \
534                                 | BATU_BL_256M \
535                                 | BATU_VS \
536                                 | BATU_VP)
537 #else
538 #define CONFIG_SYS_IBAT3L       (0)
539 #define CONFIG_SYS_IBAT3U       (0)
540 #define CONFIG_SYS_IBAT4L       (0)
541 #define CONFIG_SYS_IBAT4U       (0)
542 #endif
543
544 /* IMMRBAR @ 0xE0000000, PCI IO @ 0xE2000000 & BCSR @ 0xE2400000 */
545 #define CONFIG_SYS_IBAT5L       (CONFIG_SYS_IMMR \
546                                 | BATL_PP_RW \
547                                 | BATL_CACHEINHIBIT \
548                                 | BATL_GUARDEDSTORAGE)
549 #define CONFIG_SYS_IBAT5U       (CONFIG_SYS_IMMR \
550                                 | BATU_BL_256M \
551                                 | BATU_VS \
552                                 | BATU_VP)
553
554 /* SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
555 #define CONFIG_SYS_IBAT6L       (0xF0000000 \
556                                 | BATL_PP_RW \
557                                 | BATL_MEMCOHERENCE \
558                                 | BATL_GUARDEDSTORAGE)
559 #define CONFIG_SYS_IBAT6U       (0xF0000000 \
560                                 | BATU_BL_256M \
561                                 | BATU_VS \
562                                 | BATU_VP)
563
564 #define CONFIG_SYS_IBAT7L       (0)
565 #define CONFIG_SYS_IBAT7U       (0)
566
567 #define CONFIG_SYS_DBAT0L       CONFIG_SYS_IBAT0L
568 #define CONFIG_SYS_DBAT0U       CONFIG_SYS_IBAT0U
569 #define CONFIG_SYS_DBAT1L       CONFIG_SYS_IBAT1L
570 #define CONFIG_SYS_DBAT1U       CONFIG_SYS_IBAT1U
571 #define CONFIG_SYS_DBAT2L       CONFIG_SYS_IBAT2L
572 #define CONFIG_SYS_DBAT2U       CONFIG_SYS_IBAT2U
573 #define CONFIG_SYS_DBAT3L       CONFIG_SYS_IBAT3L
574 #define CONFIG_SYS_DBAT3U       CONFIG_SYS_IBAT3U
575 #define CONFIG_SYS_DBAT4L       CONFIG_SYS_IBAT4L
576 #define CONFIG_SYS_DBAT4U       CONFIG_SYS_IBAT4U
577 #define CONFIG_SYS_DBAT5L       CONFIG_SYS_IBAT5L
578 #define CONFIG_SYS_DBAT5U       CONFIG_SYS_IBAT5U
579 #define CONFIG_SYS_DBAT6L       CONFIG_SYS_IBAT6L
580 #define CONFIG_SYS_DBAT6U       CONFIG_SYS_IBAT6U
581 #define CONFIG_SYS_DBAT7L       CONFIG_SYS_IBAT7L
582 #define CONFIG_SYS_DBAT7U       CONFIG_SYS_IBAT7U
583
584 #if defined(CONFIG_CMD_KGDB)
585 #define CONFIG_KGDB_BAUDRATE    230400  /* speed of kgdb serial port */
586 #endif
587
588 /*
589  * Environment Configuration
590  */
591 #define CONFIG_ENV_OVERWRITE
592
593 #if defined(CONFIG_TSEC_ENET)
594 #define CONFIG_HAS_ETH1
595 #define CONFIG_HAS_ETH0
596 #endif
597
598 #define CONFIG_HOSTNAME         "mpc8349emds"
599 #define CONFIG_ROOTPATH         "/nfsroot/rootfs"
600 #define CONFIG_BOOTFILE         "uImage"
601
602 #define CONFIG_LOADADDR 800000  /* default location for tftp and bootm */
603
604 #define CONFIG_PREBOOT  "echo;" \
605         "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
606         "echo"
607
608 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
609         "netdev=eth0\0"                                                 \
610         "hostname=mpc8349emds\0"                                        \
611         "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
612                 "nfsroot=${serverip}:${rootpath}\0"                     \
613         "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
614         "addip=setenv bootargs ${bootargs} "                            \
615                 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
616                 ":${hostname}:${netdev}:off panic=1\0"                  \
617         "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
618         "flash_nfs=run nfsargs addip addtty;"                           \
619                 "bootm ${kernel_addr}\0"                                \
620         "flash_self=run ramargs addip addtty;"                          \
621                 "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
622         "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
623                 "bootm\0"                                               \
624         "load=tftp 100000 /tftpboot/mpc8349emds/u-boot.bin\0"           \
625         "update=protect off fe000000 fe03ffff; "                        \
626                 "era fe000000 fe03ffff; cp.b 100000 fe000000 ${filesize}\0"\
627         "upd=run load update\0"                                         \
628         "fdtaddr=780000\0"                                              \
629         "fdtfile=mpc834x_mds.dtb\0"                                     \
630         ""
631
632 #define CONFIG_NFSBOOTCOMMAND                                           \
633         "setenv bootargs root=/dev/nfs rw "                             \
634                 "nfsroot=$serverip:$rootpath "                          \
635                 "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:"   \
636                                                         "$netdev:off "  \
637                 "console=$consoledev,$baudrate $othbootargs;"           \
638         "tftp $loadaddr $bootfile;"                                     \
639         "tftp $fdtaddr $fdtfile;"                                       \
640         "bootm $loadaddr - $fdtaddr"
641
642 #define CONFIG_RAMBOOTCOMMAND                                           \
643         "setenv bootargs root=/dev/ram rw "                             \
644                 "console=$consoledev,$baudrate $othbootargs;"           \
645         "tftp $ramdiskaddr $ramdiskfile;"                               \
646         "tftp $loadaddr $bootfile;"                                     \
647         "tftp $fdtaddr $fdtfile;"                                       \
648         "bootm $loadaddr $ramdiskaddr $fdtaddr"
649
650 #define CONFIG_BOOTCOMMAND      "run flash_self"
651
652 #endif  /* __CONFIG_H */