MPC837XERDB.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. /*
  2. * Copyright (C) 2007 Freescale Semiconductor, Inc.
  3. * Kevin Lam <kevin.lam@freescale.com>
  4. * Joe D'Abbraccio <joe.d'abbraccio@freescale.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #ifndef __CONFIG_H
  22. #define __CONFIG_H
  23. /*
  24. * High Level Configuration Options
  25. */
  26. #define CONFIG_E300 1 /* E300 family */
  27. #define CONFIG_MPC83XX 1 /* MPC83XX family */
  28. #define CONFIG_MPC837X 1 /* MPC837X CPU specific */
  29. #define CONFIG_MPC837XERDB 1
  30. #define CONFIG_PCI 1
  31. #define CONFIG_BOARD_EARLY_INIT_F
  32. #define CONFIG_MISC_INIT_R
  33. /*
  34. * On-board devices
  35. */
  36. #define CONFIG_TSEC_ENET /* TSEC Ethernet support */
  37. #define CONFIG_VSC7385_ENET
  38. /*
  39. * System Clock Setup
  40. */
  41. #ifdef CONFIG_PCISLAVE
  42. #define CONFIG_83XX_PCICLK 66666667 /* in HZ */
  43. #else
  44. #define CONFIG_83XX_CLKIN 66666667 /* in Hz */
  45. #define CONFIG_83XX_GENERIC_PCI 1
  46. #endif
  47. #ifndef CONFIG_SYS_CLK_FREQ
  48. #define CONFIG_SYS_CLK_FREQ CONFIG_83XX_CLKIN
  49. #endif
  50. /*
  51. * Hardware Reset Configuration Word
  52. */
  53. #define CFG_HRCW_LOW (\
  54. HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
  55. HRCWL_DDR_TO_SCB_CLK_1X1 |\
  56. HRCWL_SVCOD_DIV_2 |\
  57. HRCWL_CSB_TO_CLKIN_5X1 |\
  58. HRCWL_CORE_TO_CSB_2X1)
  59. #ifdef CONFIG_PCISLAVE
  60. #define CFG_HRCW_HIGH (\
  61. HRCWH_PCI_AGENT |\
  62. HRCWH_PCI1_ARBITER_DISABLE |\
  63. HRCWH_CORE_ENABLE |\
  64. HRCWH_FROM_0XFFF00100 |\
  65. HRCWH_BOOTSEQ_DISABLE |\
  66. HRCWH_SW_WATCHDOG_DISABLE |\
  67. HRCWH_ROM_LOC_LOCAL_16BIT |\
  68. HRCWH_RL_EXT_LEGACY |\
  69. HRCWH_TSEC1M_IN_RGMII |\
  70. HRCWH_TSEC2M_IN_RGMII |\
  71. HRCWH_BIG_ENDIAN |\
  72. HRCWH_LDP_CLEAR)
  73. #else
  74. #define CFG_HRCW_HIGH (\
  75. HRCWH_PCI_HOST |\
  76. HRCWH_PCI1_ARBITER_ENABLE |\
  77. HRCWH_CORE_ENABLE |\
  78. HRCWH_FROM_0X00000100 |\
  79. HRCWH_BOOTSEQ_DISABLE |\
  80. HRCWH_SW_WATCHDOG_DISABLE |\
  81. HRCWH_ROM_LOC_LOCAL_16BIT |\
  82. HRCWH_RL_EXT_LEGACY |\
  83. HRCWH_TSEC1M_IN_RGMII |\
  84. HRCWH_TSEC2M_IN_RGMII |\
  85. HRCWH_BIG_ENDIAN |\
  86. HRCWH_LDP_CLEAR)
  87. #endif
  88. /* System performance - define the value i.e. CFG_XXX
  89. */
  90. /* Arbiter Configuration Register */
  91. #define CFG_ACR_PIPE_DEP 3 /* Arbiter pipeline depth (0-3) */
  92. #define CFG_ACR_RPTCNT 3 /* Arbiter repeat count (0-7) */
  93. /* System Priority Control Regsiter */
  94. #define CFG_SPCR_TSECEP 3 /* eTSEC1&2 emergency priority (0-3) */
  95. /* System Clock Configuration Register */
  96. #define CFG_SCCR_TSEC1CM 1 /* eTSEC1 clock mode (0-3) */
  97. #define CFG_SCCR_TSEC2CM 1 /* eTSEC2 clock mode (0-3) */
  98. #define CFG_SCCR_SATACM SCCR_SATACM_2 /* SATA1-4 clock mode (0-3) */
  99. /*
  100. * System IO Config
  101. */
  102. #define CFG_SICRH 0x08200000
  103. #define CFG_SICRL 0x00000000
  104. /*
  105. * Output Buffer Impedance
  106. */
  107. #define CFG_OBIR 0x30100000
  108. /*
  109. * IMMR new address
  110. */
  111. #define CFG_IMMR 0xE0000000
  112. /*
  113. * Device configurations
  114. */
  115. /* Vitesse 7385 */
  116. #ifdef CONFIG_VSC7385_ENET
  117. #define CONFIG_TSEC2
  118. /* The flash address and size of the VSC7385 firmware image */
  119. #define CONFIG_VSC7385_IMAGE 0xFE7FE000
  120. #define CONFIG_VSC7385_IMAGE_SIZE 8192
  121. #endif
  122. /*
  123. * DDR Setup
  124. */
  125. #define CFG_DDR_BASE 0x00000000 /* DDR is system memory */
  126. #define CFG_SDRAM_BASE CFG_DDR_BASE
  127. #define CFG_DDR_SDRAM_BASE CFG_DDR_BASE
  128. #define CFG_DDR_SDRAM_CLK_CNTL 0x03000000
  129. #define CFG_83XX_DDR_USES_CS0
  130. #define CFG_DDRCDR_VALUE (DDRCDR_DHC_EN | DDRCDR_ODT | DDRCDR_Q_DRN)
  131. #undef CONFIG_DDR_ECC /* support DDR ECC function */
  132. #undef CONFIG_DDR_ECC_CMD /* Use DDR ECC user commands */
  133. #undef CONFIG_NEVER_ASSERT_ODT_TO_CPU /* Never assert ODT to internal IOs */
  134. /*
  135. * Manually set up DDR parameters
  136. */
  137. #define CFG_DDR_SIZE 256 /* MB */
  138. #define CFG_DDR_CS0_BNDS 0x0000000f
  139. #define CFG_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_ODT_WR_ACS \
  140. | CSCONFIG_ROW_BIT_13 | CSCONFIG_COL_BIT_10)
  141. #define CFG_DDR_TIMING_3 0x00000000
  142. #define CFG_DDR_TIMING_0 ((0 << TIMING_CFG0_RWT_SHIFT) \
  143. | (0 << TIMING_CFG0_WRT_SHIFT) \
  144. | (0 << TIMING_CFG0_RRT_SHIFT) \
  145. | (0 << TIMING_CFG0_WWT_SHIFT) \
  146. | (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) \
  147. | (6 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) \
  148. | (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) \
  149. | (2 << TIMING_CFG0_MRS_CYC_SHIFT))
  150. /* 0x00220802 */
  151. /* 0x00260802 */ /* DDR400 */
  152. #define CFG_DDR_TIMING_1 ((3 << TIMING_CFG1_PRETOACT_SHIFT) \
  153. | (9 << TIMING_CFG1_ACTTOPRE_SHIFT) \
  154. | (3 << TIMING_CFG1_ACTTORW_SHIFT) \
  155. | (7 << TIMING_CFG1_CASLAT_SHIFT) \
  156. | (13 << TIMING_CFG1_REFREC_SHIFT) \
  157. | (3 << TIMING_CFG1_WRREC_SHIFT) \
  158. | (2 << TIMING_CFG1_ACTTOACT_SHIFT) \
  159. | (2 << TIMING_CFG1_WRTORD_SHIFT))
  160. /* 0x3935d322 */
  161. /* 0x3937d322 */
  162. #define CFG_DDR_TIMING_2 0x02984cc8
  163. #define CFG_DDR_INTERVAL ((1545 << SDRAM_INTERVAL_REFINT_SHIFT) \
  164. | (256 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
  165. /* 0x06090100 */
  166. #if defined(CONFIG_DDR_2T_TIMING)
  167. #define CFG_DDR_SDRAM_CFG (SDRAM_CFG_SREN \
  168. | 3 << SDRAM_CFG_SDRAM_TYPE_SHIFT \
  169. | SDRAM_CFG_2T_EN \
  170. | SDRAM_CFG_DBW_32)
  171. #else
  172. #define CFG_DDR_SDRAM_CFG (SDRAM_CFG_SREN \
  173. | 3 << SDRAM_CFG_SDRAM_TYPE_SHIFT)
  174. /* 0x43000000 */
  175. #endif
  176. #define CFG_DDR_SDRAM_CFG2 0x00001000 /* 1 posted refresh */
  177. #define CFG_DDR_MODE ((0x0440 << SDRAM_MODE_ESD_SHIFT) \
  178. | (0x0442 << SDRAM_MODE_SD_SHIFT))
  179. /* 0x04400442 */ /* DDR400 */
  180. #define CFG_DDR_MODE2 0x00000000;
  181. /*
  182. * Memory test
  183. */
  184. #undef CFG_DRAM_TEST /* memory test, takes time */
  185. #define CFG_MEMTEST_START 0x00040000 /* memtest region */
  186. #define CFG_MEMTEST_END 0x0ef70010
  187. /*
  188. * The reserved memory
  189. */
  190. #define CFG_MONITOR_BASE TEXT_BASE /* start of monitor */
  191. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  192. #define CFG_RAMBOOT
  193. #else
  194. #undef CFG_RAMBOOT
  195. #endif
  196. #define CFG_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */
  197. #define CFG_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
  198. /*
  199. * Initial RAM Base Address Setup
  200. */
  201. #define CFG_INIT_RAM_LOCK 1
  202. #define CFG_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
  203. #define CFG_INIT_RAM_END 0x1000 /* End of used area in RAM */
  204. #define CFG_GBL_DATA_SIZE 0x100 /* num bytes initial data */
  205. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  206. /*
  207. * Local Bus Configuration & Clock Setup
  208. */
  209. #define CFG_LCRR (LCRR_DBYP | LCRR_CLKDIV_8)
  210. #define CFG_LBC_LBCR 0x00000000
  211. /*
  212. * FLASH on the Local Bus
  213. */
  214. #define CFG_FLASH_CFI /* use the Common Flash Interface */
  215. #define CFG_FLASH_CFI_DRIVER /* use the CFI driver */
  216. #define CFG_FLASH_BASE 0xFE000000 /* FLASH base address */
  217. #define CFG_FLASH_SIZE 8 /* max FLASH size is 32M */
  218. #define CFG_FLASH_EMPTY_INFO /* display empty sectors */
  219. #define CFG_FLASH_USE_BUFFER_WRITE /* buffer up multiple bytes */
  220. #define CFG_LBLAWBAR0_PRELIM CFG_FLASH_BASE /* Window base at flash base */
  221. #define CFG_LBLAWAR0_PRELIM 0x80000016 /* 8 MB window size */
  222. #define CFG_BR0_PRELIM (CFG_FLASH_BASE | /* Flash Base address */ \
  223. (2 << BR_PS_SHIFT) | /* 16 bit port size */ \
  224. BR_V) /* valid */
  225. #define CFG_OR0_PRELIM (0xFF800000 /* 8 MByte */ \
  226. | OR_GPCM_XACS \
  227. | OR_GPCM_SCY_9 \
  228. | OR_GPCM_EHTR \
  229. | OR_GPCM_EAD)
  230. /* 0xFF806FF7 TODO SLOW 8 MB flash size */
  231. #define CFG_MAX_FLASH_BANKS 1 /* number of banks */
  232. #define CFG_MAX_FLASH_SECT 256 /* max sectors per device */
  233. #undef CFG_FLASH_CHECKSUM
  234. #define CFG_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
  235. #define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
  236. /*
  237. * NAND Flash on the Local Bus
  238. */
  239. #define CFG_NAND_BASE 0xE0600000 /* 0xE0600000 */
  240. #define CFG_BR1_PRELIM (CFG_NAND_BASE | \
  241. (2 << BR_DECC_SHIFT) | /* Use HW ECC */ \
  242. BR_PS_8 | /* Port Size = 8 bit */ \
  243. BR_MS_FCM | /* MSEL = FCM */ \
  244. BR_V) /* valid */
  245. #define CFG_OR1_PRELIM (0xFFFF8000 | /* length 32K */ \
  246. OR_FCM_CSCT | \
  247. OR_FCM_CST | \
  248. OR_FCM_CHT | \
  249. OR_FCM_SCY_1 | \
  250. OR_FCM_TRLX | \
  251. OR_FCM_EHTR)
  252. #define CFG_LBLAWBAR1_PRELIM CFG_NAND_BASE
  253. #define CFG_LBLAWAR1_PRELIM 0x8000000E /* 32KB */
  254. /* Vitesse 7385 */
  255. #define CFG_VSC7385_BASE 0xF0000000
  256. #ifdef CONFIG_VSC7385_ENET
  257. #define CFG_BR2_PRELIM 0xf0000801 /* Base address */
  258. #define CFG_OR2_PRELIM 0xfffe09ff /* 128K bytes*/
  259. #define CFG_LBLAWBAR2_PRELIM CFG_VSC7385_BASE /* Access Base */
  260. #define CFG_LBLAWAR2_PRELIM 0x80000010 /* Access Size 128K */
  261. #endif
  262. /*
  263. * Serial Port
  264. */
  265. #define CONFIG_CONS_INDEX 1
  266. #undef CONFIG_SERIAL_SOFTWARE_FIFO
  267. #define CFG_NS16550
  268. #define CFG_NS16550_SERIAL
  269. #define CFG_NS16550_REG_SIZE 1
  270. #define CFG_NS16550_CLK get_bus_freq(0)
  271. #define CFG_BAUDRATE_TABLE \
  272. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
  273. #define CFG_NS16550_COM1 (CFG_IMMR+0x4500)
  274. #define CFG_NS16550_COM2 (CFG_IMMR+0x4600)
  275. /* SERDES */
  276. #define CONFIG_FSL_SERDES
  277. #define CONFIG_FSL_SERDES1 0xe3000
  278. #define CONFIG_FSL_SERDES2 0xe3100
  279. /* Use the HUSH parser */
  280. #define CFG_HUSH_PARSER
  281. #ifdef CFG_HUSH_PARSER
  282. #define CFG_PROMPT_HUSH_PS2 "> "
  283. #endif
  284. /* Pass open firmware flat tree */
  285. #define CONFIG_OF_LIBFDT 1
  286. #define CONFIG_OF_BOARD_SETUP 1
  287. #define CONFIG_OF_STDOUT_VIA_ALIAS 1
  288. /* I2C */
  289. #define CONFIG_HARD_I2C /* I2C with hardware support */
  290. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  291. #define CONFIG_FSL_I2C
  292. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  293. #define CFG_I2C_SLAVE 0x7F
  294. #define CFG_I2C_NOPROBES {0x51} /* Don't probe these addrs */
  295. #define CFG_I2C_OFFSET 0x3000
  296. #define CFG_I2C2_OFFSET 0x3100
  297. /*
  298. * Config on-board RTC
  299. */
  300. #define CONFIG_RTC_DS1374 /* use ds1374 rtc via i2c */
  301. #define CFG_I2C_RTC_ADDR 0x68 /* at address 0x68 */
  302. /*
  303. * General PCI
  304. * Addresses are mapped 1-1.
  305. */
  306. #define CFG_PCI_MEM_BASE 0x80000000
  307. #define CFG_PCI_MEM_PHYS CFG_PCI_MEM_BASE
  308. #define CFG_PCI_MEM_SIZE 0x10000000 /* 256M */
  309. #define CFG_PCI_MMIO_BASE 0x90000000
  310. #define CFG_PCI_MMIO_PHYS CFG_PCI_MMIO_BASE
  311. #define CFG_PCI_MMIO_SIZE 0x10000000 /* 256M */
  312. #define CFG_PCI_IO_BASE 0x00000000
  313. #define CFG_PCI_IO_PHYS 0xE0300000
  314. #define CFG_PCI_IO_SIZE 0x100000 /* 1M */
  315. #define CFG_PCI_SLV_MEM_LOCAL CFG_SDRAM_BASE
  316. #define CFG_PCI_SLV_MEM_BUS 0x00000000
  317. #define CFG_PCI_SLV_MEM_SIZE 0x80000000
  318. #ifdef CONFIG_PCI
  319. #define CONFIG_NET_MULTI
  320. #define CONFIG_PCI_PNP /* do pci plug-and-play */
  321. #undef CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
  322. #define CFG_PCI_SUBSYS_VENDORID 0x1957 /* Freescale */
  323. #endif /* CONFIG_PCI */
  324. /*
  325. * TSEC
  326. */
  327. #ifdef CONFIG_TSEC_ENET
  328. #define CONFIG_NET_MULTI
  329. #define CONFIG_GMII /* MII PHY management */
  330. #define CONFIG_TSEC1
  331. #ifdef CONFIG_TSEC1
  332. #define CONFIG_HAS_ETH0
  333. #define CONFIG_TSEC1_NAME "TSEC0"
  334. #define CFG_TSEC1_OFFSET 0x24000
  335. #define TSEC1_PHY_ADDR 2
  336. #define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  337. #define TSEC1_PHYIDX 0
  338. #endif
  339. #ifdef CONFIG_TSEC2
  340. #define CONFIG_HAS_ETH1
  341. #define CONFIG_TSEC2_NAME "TSEC1"
  342. #define CFG_TSEC2_OFFSET 0x25000
  343. #define TSEC2_PHY_ADDR 0x1c
  344. #define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  345. #define TSEC2_PHYIDX 0
  346. #endif
  347. /* Options are: TSEC[0-1] */
  348. #define CONFIG_ETHPRIME "TSEC0"
  349. #endif
  350. /*
  351. * SATA
  352. */
  353. #define CONFIG_LIBATA
  354. #define CONFIG_FSL_SATA
  355. #define CFG_SATA_MAX_DEVICE 2
  356. #define CONFIG_SATA1
  357. #define CFG_SATA1_OFFSET 0x18000
  358. #define CFG_SATA1 (CFG_IMMR + CFG_SATA1_OFFSET)
  359. #define CFG_SATA1_FLAGS FLAGS_DMA
  360. #define CONFIG_SATA2
  361. #define CFG_SATA2_OFFSET 0x19000
  362. #define CFG_SATA2 (CFG_IMMR + CFG_SATA2_OFFSET)
  363. #define CFG_SATA2_FLAGS FLAGS_DMA
  364. #ifdef CONFIG_FSL_SATA
  365. #define CONFIG_LBA48
  366. #define CONFIG_CMD_SATA
  367. #define CONFIG_DOS_PARTITION
  368. #define CONFIG_CMD_EXT2
  369. #endif
  370. /*
  371. * Environment
  372. */
  373. #ifndef CFG_RAMBOOT
  374. #define CFG_ENV_IS_IN_FLASH 1
  375. #define CFG_ENV_ADDR (CFG_MONITOR_BASE+CFG_MONITOR_LEN)
  376. #define CFG_ENV_SECT_SIZE 0x10000 /* 64K (one sector) for env */
  377. #define CFG_ENV_SIZE 0x4000
  378. #else
  379. #define CFG_NO_FLASH 1 /* Flash is not usable now */
  380. #define CFG_ENV_IS_NOWHERE 1 /* Store ENV in memory only */
  381. #define CFG_ENV_ADDR (CFG_MONITOR_BASE-0x1000)
  382. #define CFG_ENV_SIZE 0x2000
  383. #endif
  384. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  385. #define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  386. /*
  387. * BOOTP options
  388. */
  389. #define CONFIG_BOOTP_BOOTFILESIZE
  390. #define CONFIG_BOOTP_BOOTPATH
  391. #define CONFIG_BOOTP_GATEWAY
  392. #define CONFIG_BOOTP_HOSTNAME
  393. /*
  394. * Command line configuration.
  395. */
  396. #include <config_cmd_default.h>
  397. #define CONFIG_CMD_PING
  398. #define CONFIG_CMD_I2C
  399. #define CONFIG_CMD_MII
  400. #define CONFIG_CMD_DATE
  401. #if defined(CONFIG_PCI)
  402. #define CONFIG_CMD_PCI
  403. #endif
  404. #if defined(CFG_RAMBOOT)
  405. #undef CONFIG_CMD_ENV
  406. #undef CONFIG_CMD_LOADS
  407. #endif
  408. #define CONFIG_CMDLINE_EDITING 1 /* add command line history */
  409. #undef CONFIG_WATCHDOG /* watchdog disabled */
  410. /*
  411. * Miscellaneous configurable options
  412. */
  413. #define CFG_LONGHELP /* undef to save memory */
  414. #define CFG_LOAD_ADDR 0x2000000 /* default load address */
  415. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  416. #if defined(CONFIG_CMD_KGDB)
  417. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  418. #else
  419. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  420. #endif
  421. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  422. #define CFG_MAXARGS 16 /* max number of command args */
  423. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  424. #define CFG_HZ 1000 /* decrementer freq: 1ms ticks */
  425. /*
  426. * For booting Linux, the board info and command line data
  427. * have to be in the first 8 MB of memory, since this is
  428. * the maximum mapped by the Linux kernel during initialization.
  429. */
  430. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  431. /*
  432. * Core HID Setup
  433. */
  434. #define CFG_HID0_INIT 0x000000000
  435. #define CFG_HID0_FINAL HID0_ENABLE_MACHINE_CHECK
  436. #define CFG_HID2 HID2_HBE
  437. /*
  438. * MMU Setup
  439. */
  440. /* DDR: cache cacheable */
  441. #define CFG_SDRAM_LOWER CFG_SDRAM_BASE
  442. #define CFG_SDRAM_UPPER (CFG_SDRAM_BASE + 0x10000000)
  443. #define CFG_IBAT0L (CFG_SDRAM_LOWER | BATL_PP_10 | BATL_MEMCOHERENCE)
  444. #define CFG_IBAT0U (CFG_SDRAM_LOWER | BATU_BL_256M | BATU_VS | BATU_VP)
  445. #define CFG_DBAT0L CFG_IBAT0L
  446. #define CFG_DBAT0U CFG_IBAT0U
  447. #define CFG_IBAT1L (CFG_SDRAM_UPPER | BATL_PP_10 | BATL_MEMCOHERENCE)
  448. #define CFG_IBAT1U (CFG_SDRAM_UPPER | BATU_BL_256M | BATU_VS | BATU_VP)
  449. #define CFG_DBAT1L CFG_IBAT1L
  450. #define CFG_DBAT1U CFG_IBAT1U
  451. /* IMMRBAR, PCI IO and NAND: cache-inhibit and guarded */
  452. #define CFG_IBAT2L (CFG_IMMR | BATL_PP_10 | \
  453. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  454. #define CFG_IBAT2U (CFG_IMMR | BATU_BL_8M | BATU_VS | BATU_VP)
  455. #define CFG_DBAT2L CFG_IBAT2L
  456. #define CFG_DBAT2U CFG_IBAT2U
  457. /* L2 Switch: cache-inhibit and guarded */
  458. #define CFG_IBAT3L (CFG_VSC7385_BASE | BATL_PP_10 | \
  459. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  460. #define CFG_IBAT3U (CFG_VSC7385_BASE | BATU_BL_128K | BATU_VS | BATU_VP)
  461. #define CFG_DBAT3L CFG_IBAT3L
  462. #define CFG_DBAT3U CFG_IBAT3U
  463. /* FLASH: icache cacheable, but dcache-inhibit and guarded */
  464. #define CFG_IBAT4L (CFG_FLASH_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
  465. #define CFG_IBAT4U (CFG_FLASH_BASE | BATU_BL_32M | BATU_VS | BATU_VP)
  466. #define CFG_DBAT4L (CFG_FLASH_BASE | BATL_PP_10 | \
  467. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  468. #define CFG_DBAT4U CFG_IBAT4U
  469. /* Stack in dcache: cacheable, no memory coherence */
  470. #define CFG_IBAT5L (CFG_INIT_RAM_ADDR | BATL_PP_10)
  471. #define CFG_IBAT5U (CFG_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
  472. #define CFG_DBAT5L CFG_IBAT5L
  473. #define CFG_DBAT5U CFG_IBAT5U
  474. #ifdef CONFIG_PCI
  475. /* PCI MEM space: cacheable */
  476. #define CFG_IBAT6L (CFG_PCI_MEM_PHYS | BATL_PP_10 | BATL_MEMCOHERENCE)
  477. #define CFG_IBAT6U (CFG_PCI_MEM_PHYS | BATU_BL_256M | BATU_VS | BATU_VP)
  478. #define CFG_DBAT6L CFG_IBAT6L
  479. #define CFG_DBAT6U CFG_IBAT6U
  480. /* PCI MMIO space: cache-inhibit and guarded */
  481. #define CFG_IBAT7L (CFG_PCI_MMIO_PHYS | BATL_PP_10 | \
  482. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  483. #define CFG_IBAT7U (CFG_PCI_MMIO_PHYS | BATU_BL_256M | BATU_VS | BATU_VP)
  484. #define CFG_DBAT7L CFG_IBAT7L
  485. #define CFG_DBAT7U CFG_IBAT7U
  486. #else
  487. #define CFG_IBAT6L (0)
  488. #define CFG_IBAT6U (0)
  489. #define CFG_IBAT7L (0)
  490. #define CFG_IBAT7U (0)
  491. #define CFG_DBAT6L CFG_IBAT6L
  492. #define CFG_DBAT6U CFG_IBAT6U
  493. #define CFG_DBAT7L CFG_IBAT7L
  494. #define CFG_DBAT7U CFG_IBAT7U
  495. #endif
  496. /*
  497. * Internal Definitions
  498. *
  499. * Boot Flags
  500. */
  501. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  502. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  503. #if defined(CONFIG_CMD_KGDB)
  504. #define CONFIG_KGDB_BAUDRATE 230400 /* speed of kgdb serial port */
  505. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  506. #endif
  507. /*
  508. * Environment Configuration
  509. */
  510. #define CONFIG_ENV_OVERWRITE
  511. #ifdef CONFIG_HAS_ETH0
  512. #define CONFIG_ETHADDR 00:04:9f:ef:04:01
  513. #endif
  514. #ifdef CONFIG_HAS_ETH1
  515. #define CONFIG_ETH1ADDR 00:04:9f:ef:04:02
  516. #endif
  517. #define CONFIG_HAS_FSL_DR_USB
  518. #define CONFIG_IPADDR 10.0.0.2
  519. #define CONFIG_SERVERIP 10.0.0.1
  520. #define CONFIG_GATEWAYIP 10.0.0.1
  521. #define CONFIG_NETMASK 255.0.0.0
  522. #define CONFIG_NETDEV eth1
  523. #define CONFIG_HOSTNAME mpc837x_rdb
  524. #define CONFIG_ROOTPATH /nfsroot
  525. #define CONFIG_RAMDISKFILE rootfs.ext2.gz.uboot
  526. #define CONFIG_BOOTFILE uImage
  527. #define CONFIG_UBOOTPATH u-boot.bin /* U-Boot image on TFTP server */
  528. #define CONFIG_FDTFILE mpc8379_rdb.dtb
  529. #define CONFIG_LOADADDR 200000 /* default location for tftp and bootm */
  530. #define CONFIG_BOOTDELAY -1 /* -1 disables auto-boot */
  531. #define CONFIG_BAUDRATE 115200
  532. #define XMK_STR(x) #x
  533. #define MK_STR(x) XMK_STR(x)
  534. #define CONFIG_EXTRA_ENV_SETTINGS \
  535. "netdev=" MK_STR(CONFIG_NETDEV) "\0" \
  536. "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0" \
  537. "tftpflash=tftp $loadaddr $uboot;" \
  538. "protect off " MK_STR(TEXT_BASE) " +$filesize; " \
  539. "erase " MK_STR(TEXT_BASE) " +$filesize; " \
  540. "cp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize; " \
  541. "protect on " MK_STR(TEXT_BASE) " +$filesize; " \
  542. "cmp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize\0" \
  543. "fdtaddr=400000\0" \
  544. "fdtfile=" MK_STR(CONFIG_FDTFILE) "\0" \
  545. "ramdiskaddr=1000000\0" \
  546. "ramdiskfile=" MK_STR(CONFIG_RAMDISKFILE) "\0" \
  547. "console=ttyS0\0" \
  548. "setbootargs=setenv bootargs " \
  549. "root=$rootdev rw console=$console,$baudrate $othbootargs\0" \
  550. "setipargs=setenv bootargs nfsroot=$serverip:$rootpath " \
  551. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
  552. "root=$rootdev rw console=$console,$baudrate $othbootargs\0"
  553. #define CONFIG_NFSBOOTCOMMAND \
  554. "setenv rootdev /dev/nfs;" \
  555. "run setbootargs;" \
  556. "run setipargs;" \
  557. "tftp $loadaddr $bootfile;" \
  558. "tftp $fdtaddr $fdtfile;" \
  559. "bootm $loadaddr - $fdtaddr"
  560. #define CONFIG_RAMBOOTCOMMAND \
  561. "setenv rootdev /dev/ram;" \
  562. "run setbootargs;" \
  563. "tftp $ramdiskaddr $ramdiskfile;" \
  564. "tftp $loadaddr $bootfile;" \
  565. "tftp $fdtaddr $fdtfile;" \
  566. "bootm $loadaddr $ramdiskaddr $fdtaddr"
  567. #undef MK_STR
  568. #undef XMK_STR
  569. #endif /* __CONFIG_H */