MPC8313ERDB.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. /*
  2. * Copyright (C) Freescale Semiconductor, Inc. 2006, 2010.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. /*
  23. * mpc8313epb board configuration file
  24. */
  25. #ifndef __CONFIG_H
  26. #define __CONFIG_H
  27. /*
  28. * High Level Configuration Options
  29. */
  30. #define CONFIG_E300 1
  31. #define CONFIG_MPC83xx 1
  32. #define CONFIG_MPC831x 1
  33. #define CONFIG_MPC8313 1
  34. #define CONFIG_MPC8313ERDB 1
  35. #ifndef CONFIG_SYS_TEXT_BASE
  36. #define CONFIG_SYS_TEXT_BASE 0xFE000000
  37. #endif
  38. #define CONFIG_PCI
  39. #define CONFIG_FSL_ELBC 1
  40. #define CONFIG_MISC_INIT_R
  41. /*
  42. * On-board devices
  43. *
  44. * TSEC1 is VSC switch
  45. * TSEC2 is SoC TSEC
  46. */
  47. #define CONFIG_VSC7385_ENET
  48. #define CONFIG_TSEC2
  49. #ifdef CONFIG_SYS_66MHZ
  50. #define CONFIG_83XX_CLKIN 66666667 /* in Hz */
  51. #elif defined(CONFIG_SYS_33MHZ)
  52. #define CONFIG_83XX_CLKIN 33333333 /* in Hz */
  53. #else
  54. #error Unknown oscillator frequency.
  55. #endif
  56. #define CONFIG_SYS_CLK_FREQ CONFIG_83XX_CLKIN
  57. #define CONFIG_BOARD_EARLY_INIT_F /* call board_pre_init */
  58. #define CONFIG_SYS_IMMR 0xE0000000
  59. #if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
  60. #define CONFIG_DEFAULT_IMMR CONFIG_SYS_IMMR
  61. #endif
  62. #define CONFIG_SYS_MEMTEST_START 0x00001000
  63. #define CONFIG_SYS_MEMTEST_END 0x07f00000
  64. /* Early revs of this board will lock up hard when attempting
  65. * to access the PMC registers, unless a JTAG debugger is
  66. * connected, or some resistor modifications are made.
  67. */
  68. #define CONFIG_SYS_8313ERDB_BROKEN_PMC 1
  69. #define CONFIG_SYS_ACR_PIPE_DEP 3 /* Arbiter pipeline depth (0-3) */
  70. #define CONFIG_SYS_ACR_RPTCNT 3 /* Arbiter repeat count (0-7) */
  71. /*
  72. * Device configurations
  73. */
  74. /* Vitesse 7385 */
  75. #ifdef CONFIG_VSC7385_ENET
  76. #define CONFIG_TSEC1
  77. /* The flash address and size of the VSC7385 firmware image */
  78. #define CONFIG_VSC7385_IMAGE 0xFE7FE000
  79. #define CONFIG_VSC7385_IMAGE_SIZE 8192
  80. #endif
  81. /*
  82. * DDR Setup
  83. */
  84. #define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory*/
  85. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
  86. #define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
  87. /*
  88. * Manually set up DDR parameters, as this board does not
  89. * seem to have the SPD connected to I2C.
  90. */
  91. #define CONFIG_SYS_DDR_SIZE 128 /* MB */
  92. #define CONFIG_SYS_DDR_CONFIG ( CSCONFIG_EN \
  93. | 0x00010000 /* TODO */ \
  94. | CSCONFIG_ROW_BIT_13 | CSCONFIG_COL_BIT_10 )
  95. /* 0x80010102 */
  96. #define CONFIG_SYS_DDR_TIMING_3 0x00000000
  97. #define CONFIG_SYS_DDR_TIMING_0 ( ( 0 << TIMING_CFG0_RWT_SHIFT ) \
  98. | ( 0 << TIMING_CFG0_WRT_SHIFT ) \
  99. | ( 0 << TIMING_CFG0_RRT_SHIFT ) \
  100. | ( 0 << TIMING_CFG0_WWT_SHIFT ) \
  101. | ( 2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT ) \
  102. | ( 2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT ) \
  103. | ( 8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT ) \
  104. | ( 2 << TIMING_CFG0_MRS_CYC_SHIFT ) )
  105. /* 0x00220802 */
  106. #define CONFIG_SYS_DDR_TIMING_1 ( ( 3 << TIMING_CFG1_PRETOACT_SHIFT ) \
  107. | ( 8 << TIMING_CFG1_ACTTOPRE_SHIFT ) \
  108. | ( 3 << TIMING_CFG1_ACTTORW_SHIFT ) \
  109. | ( 5 << TIMING_CFG1_CASLAT_SHIFT ) \
  110. | (10 << TIMING_CFG1_REFREC_SHIFT ) \
  111. | ( 3 << TIMING_CFG1_WRREC_SHIFT ) \
  112. | ( 2 << TIMING_CFG1_ACTTOACT_SHIFT ) \
  113. | ( 2 << TIMING_CFG1_WRTORD_SHIFT ) )
  114. /* 0x3835a322 */
  115. #define CONFIG_SYS_DDR_TIMING_2 ( ( 1 << TIMING_CFG2_ADD_LAT_SHIFT ) \
  116. | ( 5 << TIMING_CFG2_CPO_SHIFT ) \
  117. | ( 2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT ) \
  118. | ( 2 << TIMING_CFG2_RD_TO_PRE_SHIFT ) \
  119. | ( 2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT ) \
  120. | ( 3 << TIMING_CFG2_CKE_PLS_SHIFT ) \
  121. | ( 6 << TIMING_CFG2_FOUR_ACT_SHIFT) )
  122. /* 0x129048c6 */ /* P9-45,may need tuning */
  123. #define CONFIG_SYS_DDR_INTERVAL ( ( 1296 << SDRAM_INTERVAL_REFINT_SHIFT ) \
  124. | ( 1280 << SDRAM_INTERVAL_BSTOPRE_SHIFT ) )
  125. /* 0x05100500 */
  126. #if defined(CONFIG_DDR_2T_TIMING)
  127. #define CONFIG_SYS_SDRAM_CFG ( SDRAM_CFG_SREN \
  128. | SDRAM_CFG_SDRAM_TYPE_DDR2 \
  129. | SDRAM_CFG_2T_EN \
  130. | SDRAM_CFG_DBW_32 )
  131. #else
  132. #define CONFIG_SYS_SDRAM_CFG ( SDRAM_CFG_SREN \
  133. | SDRAM_CFG_SDRAM_TYPE_DDR2 \
  134. | SDRAM_CFG_32_BE )
  135. /* 0x43080000 */
  136. #endif
  137. #define CONFIG_SYS_SDRAM_CFG2 0x00401000
  138. /* set burst length to 8 for 32-bit data path */
  139. #define CONFIG_SYS_DDR_MODE ( ( 0x4448 << SDRAM_MODE_ESD_SHIFT ) \
  140. | ( 0x0632 << SDRAM_MODE_SD_SHIFT ) )
  141. /* 0x44480632 */
  142. #define CONFIG_SYS_DDR_MODE_2 0x8000C000
  143. #define CONFIG_SYS_DDR_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
  144. /*0x02000000*/
  145. #define CONFIG_SYS_DDRCDR_VALUE ( DDRCDR_EN \
  146. | DDRCDR_PZ_NOMZ \
  147. | DDRCDR_NZ_NOMZ \
  148. | DDRCDR_M_ODR )
  149. /*
  150. * FLASH on the Local Bus
  151. */
  152. #define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
  153. #define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
  154. #define CONFIG_SYS_FLASH_BASE 0xFE000000 /* start of FLASH */
  155. #define CONFIG_SYS_FLASH_SIZE 8 /* flash size in MB */
  156. #define CONFIG_SYS_FLASH_PROTECTION 1 /* Use h/w Flash protection. */
  157. #define CONFIG_SYS_FLASH_EMPTY_INFO /* display empty sectors */
  158. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* buffer up multiple bytes */
  159. #define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE | /* flash Base address */ \
  160. (2 << BR_PS_SHIFT) | /* 16 bit port size */ \
  161. BR_V) /* valid */
  162. #define CONFIG_SYS_NOR_OR_PRELIM ( 0xFF800000 /* 8 MByte */ \
  163. | OR_GPCM_XACS \
  164. | OR_GPCM_SCY_9 \
  165. | OR_GPCM_EHTR \
  166. | OR_GPCM_EAD )
  167. /* 0xFF006FF7 TODO SLOW 16 MB flash size */
  168. #define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE /* window base at flash base */
  169. #define CONFIG_SYS_LBLAWAR0_PRELIM 0x80000017 /* 16 MB window size */
  170. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
  171. #define CONFIG_SYS_MAX_FLASH_SECT 135 /* sectors per device */
  172. #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
  173. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
  174. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  175. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) && !defined(CONFIG_NAND_SPL)
  176. #define CONFIG_SYS_RAMBOOT
  177. #endif
  178. #define CONFIG_SYS_INIT_RAM_LOCK 1
  179. #define CONFIG_SYS_INIT_RAM_ADDR 0xFD000000 /* Initial RAM address */
  180. #define CONFIG_SYS_INIT_RAM_END 0x1000 /* End of used area in RAM*/
  181. #define CONFIG_SYS_GBL_DATA_SIZE 0x100 /* num bytes initial data */
  182. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  183. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  184. /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */
  185. #define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */
  186. #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
  187. /*
  188. * Local Bus LCRR and LBCR regs
  189. */
  190. #define CONFIG_SYS_LCRR_EADC LCRR_EADC_1
  191. #define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
  192. #define CONFIG_SYS_LBC_LBCR ( 0x00040000 /* TODO */ \
  193. | (0xFF << LBCR_BMT_SHIFT) \
  194. | 0xF ) /* 0x0004ff0f */
  195. #define CONFIG_SYS_LBC_MRTPR 0x20000000 /*TODO */ /* LB refresh timer prescal, 266MHz/32 */
  196. /* drivers/mtd/nand/nand.c */
  197. #ifdef CONFIG_NAND_SPL
  198. #define CONFIG_SYS_NAND_BASE 0xFFF00000
  199. #else
  200. #define CONFIG_SYS_NAND_BASE 0xE2800000
  201. #endif
  202. #define CONFIG_MTD_DEVICE
  203. #define CONFIG_MTD_PARTITION
  204. #define CONFIG_CMD_MTDPARTS
  205. #define MTDIDS_DEFAULT "nand0=e2800000.flash"
  206. #define MTDPARTS_DEFAULT \
  207. "mtdparts=e0600000.flash:512k(uboot),128k(env),3m@1m(kernel),-(fs)"
  208. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  209. #define CONFIG_MTD_NAND_VERIFY_WRITE
  210. #define CONFIG_CMD_NAND 1
  211. #define CONFIG_NAND_FSL_ELBC 1
  212. #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
  213. #define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  214. #define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
  215. #define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
  216. #define CONFIG_SYS_NAND_U_BOOT_OFFS 16384
  217. #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
  218. #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
  219. #define CONFIG_SYS_NAND_BR_PRELIM ( CONFIG_SYS_NAND_BASE \
  220. | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
  221. | BR_PS_8 /* Port Size = 8 bit */ \
  222. | BR_MS_FCM /* MSEL = FCM */ \
  223. | BR_V ) /* valid */
  224. #define CONFIG_SYS_NAND_OR_PRELIM ( 0xFFFF8000 /* length 32K */ \
  225. | OR_FCM_CSCT \
  226. | OR_FCM_CST \
  227. | OR_FCM_CHT \
  228. | OR_FCM_SCY_1 \
  229. | OR_FCM_TRLX \
  230. | OR_FCM_EHTR )
  231. /* 0xFFFF8396 */
  232. #ifdef CONFIG_NAND_U_BOOT
  233. #define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NAND_BR_PRELIM
  234. #define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NAND_OR_PRELIM
  235. #define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NOR_BR_PRELIM
  236. #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NOR_OR_PRELIM
  237. #else
  238. #define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
  239. #define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
  240. #define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
  241. #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
  242. #endif
  243. #define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_NAND_BASE
  244. #define CONFIG_SYS_LBLAWAR1_PRELIM 0x8000000E /* 32KB */
  245. #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
  246. #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR1_PRELIM
  247. /* local bus read write buffer mapping */
  248. #define CONFIG_SYS_BR3_PRELIM 0xFA000801 /* map at 0xFA000000 */
  249. #define CONFIG_SYS_OR3_PRELIM 0xFFFF8FF7 /* 32kB */
  250. #define CONFIG_SYS_LBLAWBAR3_PRELIM 0xFA000000
  251. #define CONFIG_SYS_LBLAWAR3_PRELIM 0x8000000E /* 32KB */
  252. /* Vitesse 7385 */
  253. #define CONFIG_SYS_VSC7385_BASE 0xF0000000
  254. #ifdef CONFIG_VSC7385_ENET
  255. #define CONFIG_SYS_BR2_PRELIM 0xf0000801 /* VSC7385 Base address */
  256. #define CONFIG_SYS_OR2_PRELIM 0xfffe09ff /* VSC7385, 128K bytes*/
  257. #define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_VSC7385_BASE/* Access window base at VSC7385 base */
  258. #define CONFIG_SYS_LBLAWAR2_PRELIM 0x80000010 /* Access window size 128K */
  259. #endif
  260. /* pass open firmware flat tree */
  261. #define CONFIG_OF_LIBFDT 1
  262. #define CONFIG_OF_BOARD_SETUP 1
  263. #define CONFIG_OF_STDOUT_VIA_ALIAS 1
  264. /*
  265. * Serial Port
  266. */
  267. #define CONFIG_CONS_INDEX 1
  268. #define CONFIG_SYS_NS16550
  269. #define CONFIG_SYS_NS16550_SERIAL
  270. #define CONFIG_SYS_NS16550_REG_SIZE 1
  271. #define CONFIG_SYS_BAUDRATE_TABLE \
  272. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
  273. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
  274. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
  275. /* Use the HUSH parser */
  276. #define CONFIG_SYS_HUSH_PARSER
  277. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  278. /* I2C */
  279. #define CONFIG_HARD_I2C /* I2C with hardware support*/
  280. #define CONFIG_FSL_I2C
  281. #define CONFIG_I2C_MULTI_BUS
  282. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
  283. #define CONFIG_SYS_I2C_SLAVE 0x7F
  284. #define CONFIG_SYS_I2C_NOPROBES {{0,0x69}} /* Don't probe these addrs */
  285. #define CONFIG_SYS_I2C_OFFSET 0x3000
  286. #define CONFIG_SYS_I2C2_OFFSET 0x3100
  287. /*
  288. * General PCI
  289. * Addresses are mapped 1-1.
  290. */
  291. #define CONFIG_SYS_PCI1_MEM_BASE 0x80000000
  292. #define CONFIG_SYS_PCI1_MEM_PHYS CONFIG_SYS_PCI1_MEM_BASE
  293. #define CONFIG_SYS_PCI1_MEM_SIZE 0x10000000 /* 256M */
  294. #define CONFIG_SYS_PCI1_MMIO_BASE 0x90000000
  295. #define CONFIG_SYS_PCI1_MMIO_PHYS CONFIG_SYS_PCI1_MMIO_BASE
  296. #define CONFIG_SYS_PCI1_MMIO_SIZE 0x10000000 /* 256M */
  297. #define CONFIG_SYS_PCI1_IO_BASE 0x00000000
  298. #define CONFIG_SYS_PCI1_IO_PHYS 0xE2000000
  299. #define CONFIG_SYS_PCI1_IO_SIZE 0x00100000 /* 1M */
  300. #define CONFIG_PCI_PNP /* do pci plug-and-play */
  301. #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057 /* Motorola */
  302. /*
  303. * TSEC
  304. */
  305. #define CONFIG_TSEC_ENET /* TSEC ethernet support */
  306. #define CONFIG_NET_MULTI
  307. #define CONFIG_GMII /* MII PHY management */
  308. #ifdef CONFIG_TSEC1
  309. #define CONFIG_HAS_ETH0
  310. #define CONFIG_TSEC1_NAME "TSEC0"
  311. #define CONFIG_SYS_TSEC1_OFFSET 0x24000
  312. #define TSEC1_PHY_ADDR 0x1c
  313. #define TSEC1_FLAGS TSEC_GIGABIT
  314. #define TSEC1_PHYIDX 0
  315. #endif
  316. #ifdef CONFIG_TSEC2
  317. #define CONFIG_HAS_ETH1
  318. #define CONFIG_TSEC2_NAME "TSEC1"
  319. #define CONFIG_SYS_TSEC2_OFFSET 0x25000
  320. #define TSEC2_PHY_ADDR 4
  321. #define TSEC2_FLAGS TSEC_GIGABIT
  322. #define TSEC2_PHYIDX 0
  323. #endif
  324. /* Options are: TSEC[0-1] */
  325. #define CONFIG_ETHPRIME "TSEC1"
  326. /*
  327. * Configure on-board RTC
  328. */
  329. #define CONFIG_RTC_DS1337
  330. #define CONFIG_SYS_I2C_RTC_ADDR 0x68
  331. /*
  332. * Environment
  333. */
  334. #if defined(CONFIG_NAND_U_BOOT)
  335. #define CONFIG_ENV_IS_IN_NAND 1
  336. #define CONFIG_ENV_OFFSET (512 * 1024)
  337. #define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  338. #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
  339. #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
  340. #define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
  341. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
  342. #elif !defined(CONFIG_SYS_RAMBOOT)
  343. #define CONFIG_ENV_IS_IN_FLASH 1
  344. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
  345. #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
  346. #define CONFIG_ENV_SIZE 0x2000
  347. /* Address and size of Redundant Environment Sector */
  348. #else
  349. #define CONFIG_ENV_IS_NOWHERE 1 /* Store ENV in memory only */
  350. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  351. #define CONFIG_ENV_SIZE 0x2000
  352. #endif
  353. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  354. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  355. /*
  356. * BOOTP options
  357. */
  358. #define CONFIG_BOOTP_BOOTFILESIZE
  359. #define CONFIG_BOOTP_BOOTPATH
  360. #define CONFIG_BOOTP_GATEWAY
  361. #define CONFIG_BOOTP_HOSTNAME
  362. /*
  363. * Command line configuration.
  364. */
  365. #include <config_cmd_default.h>
  366. #define CONFIG_CMD_PING
  367. #define CONFIG_CMD_DHCP
  368. #define CONFIG_CMD_I2C
  369. #define CONFIG_CMD_MII
  370. #define CONFIG_CMD_DATE
  371. #define CONFIG_CMD_PCI
  372. #if defined(CONFIG_SYS_RAMBOOT) && !defined(CONFIG_NAND_U_BOOT)
  373. #undef CONFIG_CMD_SAVEENV
  374. #undef CONFIG_CMD_LOADS
  375. #endif
  376. #define CONFIG_CMDLINE_EDITING 1
  377. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  378. /*
  379. * Miscellaneous configurable options
  380. */
  381. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  382. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  383. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  384. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  385. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  386. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  387. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  388. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1ms ticks */
  389. /*
  390. * For booting Linux, the board info and command line data
  391. * have to be in the first 256 MB of memory, since this is
  392. * the maximum mapped by the Linux kernel during initialization.
  393. */
  394. #define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
  395. #define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
  396. #ifdef CONFIG_SYS_66MHZ
  397. /* 66MHz IN, 133MHz CSB, 266 DDR, 266 CORE */
  398. /* 0x62040000 */
  399. #define CONFIG_SYS_HRCW_LOW (\
  400. 0x20000000 /* reserved, must be set */ |\
  401. HRCWL_DDRCM |\
  402. HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
  403. HRCWL_DDR_TO_SCB_CLK_2X1 |\
  404. HRCWL_CSB_TO_CLKIN_2X1 |\
  405. HRCWL_CORE_TO_CSB_2X1)
  406. #define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
  407. #elif defined(CONFIG_SYS_33MHZ)
  408. /* 33MHz IN, 165MHz CSB, 330 DDR, 330 CORE */
  409. /* 0x65040000 */
  410. #define CONFIG_SYS_HRCW_LOW (\
  411. 0x20000000 /* reserved, must be set */ |\
  412. HRCWL_DDRCM |\
  413. HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
  414. HRCWL_DDR_TO_SCB_CLK_2X1 |\
  415. HRCWL_CSB_TO_CLKIN_5X1 |\
  416. HRCWL_CORE_TO_CSB_2X1)
  417. #define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 5)
  418. #endif
  419. #define CONFIG_SYS_HRCW_HIGH_BASE (\
  420. HRCWH_PCI_HOST |\
  421. HRCWH_PCI1_ARBITER_ENABLE |\
  422. HRCWH_CORE_ENABLE |\
  423. HRCWH_BOOTSEQ_DISABLE |\
  424. HRCWH_SW_WATCHDOG_DISABLE |\
  425. HRCWH_TSEC1M_IN_RGMII |\
  426. HRCWH_TSEC2M_IN_RGMII |\
  427. HRCWH_BIG_ENDIAN)
  428. #ifdef CONFIG_NAND_SPL
  429. #define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
  430. HRCWH_FROM_0XFFF00100 |\
  431. HRCWH_ROM_LOC_NAND_SP_8BIT |\
  432. HRCWH_RL_EXT_NAND)
  433. #else
  434. #define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
  435. HRCWH_FROM_0X00000100 |\
  436. HRCWH_ROM_LOC_LOCAL_16BIT |\
  437. HRCWH_RL_EXT_LEGACY)
  438. #endif
  439. /* System IO Config */
  440. #define CONFIG_SYS_SICRH (SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
  441. #define CONFIG_SYS_SICRL SICRL_USBDR_10 /* Enable Internal USB Phy */
  442. #define CONFIG_SYS_HID0_INIT 0x000000000
  443. #define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
  444. HID0_ENABLE_INSTRUCTION_CACHE | \
  445. HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)
  446. #define CONFIG_SYS_HID2 HID2_HBE
  447. #define CONFIG_HIGH_BATS 1 /* High BATs supported */
  448. /* DDR @ 0x00000000 */
  449. #define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_10)
  450. #define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  451. /* PCI @ 0x80000000 */
  452. #define CONFIG_SYS_IBAT1L (CONFIG_SYS_PCI1_MEM_BASE | BATL_PP_10)
  453. #define CONFIG_SYS_IBAT1U (CONFIG_SYS_PCI1_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  454. #define CONFIG_SYS_IBAT2L (CONFIG_SYS_PCI1_MMIO_BASE | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  455. #define CONFIG_SYS_IBAT2U (CONFIG_SYS_PCI1_MMIO_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  456. /* PCI2 not supported on 8313 */
  457. #define CONFIG_SYS_IBAT3L (0)
  458. #define CONFIG_SYS_IBAT3U (0)
  459. #define CONFIG_SYS_IBAT4L (0)
  460. #define CONFIG_SYS_IBAT4U (0)
  461. /* IMMRBAR @ 0xE0000000, PCI IO @ 0xE2000000 & BCSR @ 0xE2400000 */
  462. #define CONFIG_SYS_IBAT5L (CONFIG_SYS_IMMR | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  463. #define CONFIG_SYS_IBAT5U (CONFIG_SYS_IMMR | BATU_BL_256M | BATU_VS | BATU_VP)
  464. /* SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
  465. #define CONFIG_SYS_IBAT6L (0xF0000000 | BATL_PP_10 | BATL_GUARDEDSTORAGE)
  466. #define CONFIG_SYS_IBAT6U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
  467. #define CONFIG_SYS_IBAT7L (0)
  468. #define CONFIG_SYS_IBAT7U (0)
  469. #define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
  470. #define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
  471. #define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
  472. #define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
  473. #define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
  474. #define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
  475. #define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
  476. #define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
  477. #define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
  478. #define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
  479. #define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
  480. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  481. #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
  482. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  483. #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
  484. #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
  485. /*
  486. * Environment Configuration
  487. */
  488. #define CONFIG_ENV_OVERWRITE
  489. #define CONFIG_NETDEV eth1
  490. #define CONFIG_HOSTNAME mpc8313erdb
  491. #define CONFIG_ROOTPATH /nfs/root/path
  492. #define CONFIG_BOOTFILE uImage
  493. #define CONFIG_UBOOTPATH u-boot.bin /* U-Boot image on TFTP server */
  494. #define CONFIG_FDTFILE mpc8313erdb.dtb
  495. #define CONFIG_LOADADDR 800000 /* default location for tftp and bootm */
  496. #define CONFIG_BOOTDELAY 6 /* -1 disables auto-boot */
  497. #define CONFIG_BAUDRATE 115200
  498. #define XMK_STR(x) #x
  499. #define MK_STR(x) XMK_STR(x)
  500. #define CONFIG_EXTRA_ENV_SETTINGS \
  501. "netdev=" MK_STR(CONFIG_NETDEV) "\0" \
  502. "ethprime=TSEC1\0" \
  503. "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0" \
  504. "tftpflash=tftpboot $loadaddr $uboot; " \
  505. "protect off " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
  506. "erase " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
  507. "cp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize; " \
  508. "protect on " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; " \
  509. "cmp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize\0" \
  510. "fdtaddr=780000\0" \
  511. "fdtfile=" MK_STR(CONFIG_FDTFILE) "\0" \
  512. "console=ttyS0\0" \
  513. "setbootargs=setenv bootargs " \
  514. "root=$rootdev rw console=$console,$baudrate $othbootargs\0" \
  515. "setipargs=setenv bootargs nfsroot=$serverip:$rootpath " \
  516. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
  517. "root=$rootdev rw console=$console,$baudrate $othbootargs\0"
  518. #define CONFIG_NFSBOOTCOMMAND \
  519. "setenv rootdev /dev/nfs;" \
  520. "run setbootargs;" \
  521. "run setipargs;" \
  522. "tftp $loadaddr $bootfile;" \
  523. "tftp $fdtaddr $fdtfile;" \
  524. "bootm $loadaddr - $fdtaddr"
  525. #define CONFIG_RAMBOOTCOMMAND \
  526. "setenv rootdev /dev/ram;" \
  527. "run setbootargs;" \
  528. "tftp $ramdiskaddr $ramdiskfile;" \
  529. "tftp $loadaddr $bootfile;" \
  530. "tftp $fdtaddr $fdtfile;" \
  531. "bootm $loadaddr $ramdiskaddr $fdtaddr"
  532. #undef MK_STR
  533. #undef XMK_STR
  534. #endif /* __CONFIG_H */