SIMPC8313.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * Copyright (C) Sheldon Instruments, Inc. 2008
  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. * simpc8313 board configuration file
  24. */
  25. #ifndef __CONFIG_H
  26. #define __CONFIG_H
  27. /*
  28. * High Level Configuration Options
  29. */
  30. #define CONFIG_NAND_U_BOOT
  31. #define CONFIG_E300 1
  32. #define CONFIG_MPC83xx 1
  33. #define CONFIG_MPC831x 1
  34. #define CONFIG_MPC8313 1
  35. #define CONFIG_PCI
  36. #define CONFIG_FSL_ELBC 1
  37. #define CONFIG_MISC_INIT_R
  38. /*
  39. * On-board devices
  40. *
  41. * TSEC1 is Marvell PHY 88E1118
  42. */
  43. #define CONFIG_SYS_33MHZ
  44. #define CONFIG_83XX_CLKIN 33333333 /* in Hz */
  45. #define CONFIG_SYS_CLK_FREQ CONFIG_83XX_CLKIN
  46. #define CONFIG_SYS_IMMR 0xE0000000
  47. #if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
  48. #define CONFIG_DEFAULT_IMMR CONFIG_SYS_IMMR
  49. #endif
  50. #define CONFIG_SYS_MEMTEST_START 0x00001000
  51. #define CONFIG_SYS_MEMTEST_END 0x07f00000
  52. #define CONFIG_SYS_ACR_PIPE_DEP 3 /* Arbiter pipeline depth (0-3) */
  53. #define CONFIG_SYS_ACR_RPTCNT 3 /* Arbiter repeat count (0-7) */
  54. /*
  55. * Device configurations
  56. */
  57. #define CONFIG_TSEC1
  58. /*
  59. * DDR Setup
  60. */
  61. #define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory*/
  62. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
  63. #define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
  64. #define CONFIG_VERY_BIG_RAM
  65. #define CONFIG_MAX_MEM_MAPPED (512 << 20)
  66. #define CONFIG_SYS_DDRCDR ( DDRCDR_EN \
  67. | DDRCDR_PZ_NOMZ \
  68. | DDRCDR_NZ_NOMZ \
  69. | DDRCDR_M_ODR )
  70. /* 0x73000002 TODO ODR & DRN ? */
  71. /*
  72. * FLASH on the Local Bus
  73. */
  74. #define CONFIG_SYS_NO_FLASH
  75. #define CONFIG_SYS_MONITOR_BASE TEXT_BASE /* start of monitor */
  76. #if !defined(CONFIG_NAND_SPL)
  77. #define CONFIG_SYS_RAMBOOT
  78. #endif
  79. #define CONFIG_SYS_INIT_RAM_LOCK 1
  80. #define CONFIG_SYS_INIT_RAM_ADDR 0xFD000000 /* Initial RAM address */
  81. #define CONFIG_SYS_INIT_RAM_END 0x1000 /* End of used area in RAM*/
  82. #define CONFIG_SYS_GBL_DATA_SIZE 0x100 /* num bytes initial data */
  83. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  84. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  85. /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */
  86. #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */
  87. #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
  88. /*
  89. * Local Bus LCRR and LBCR regs
  90. */
  91. #define CONFIG_SYS_LCRR_DBYP LCRR_DBYP
  92. #define CONFIG_SYS_LCRR_EADC LCRR_EADC_1
  93. #define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_2
  94. #define CONFIG_SYS_LBC_LBCR (0x00040000 /* TODO */ \
  95. | (0xFF << LBCR_BMT_SHIFT) \
  96. | 0xF ) /* 0x0004ff0f */
  97. #define CONFIG_SYS_LBC_MRTPR 0x20000000 /* LB refresh timer prescal, 266MHz/32 */
  98. /* drivers/mtd/nand/nand.c */
  99. #ifdef CONFIG_NAND_SPL
  100. #define CONFIG_SYS_NAND_BASE 0xFFF00000
  101. #else
  102. #define CONFIG_SYS_NAND_BASE 0xE2800000
  103. #endif
  104. #define CONFIG_SYS_FPGA_BASE 0xFF000000
  105. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  106. #define NAND_MAX_CHIPS 1
  107. #define CONFIG_MTD_NAND_VERIFY_WRITE
  108. #define CONFIG_CMD_NAND 1
  109. #define CONFIG_NAND_FSL_ELBC 1
  110. #define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  111. #define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
  112. #define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
  113. #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
  114. #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
  115. #define CONFIG_SYS_NAND_BR_PRELIM ( CONFIG_SYS_NAND_BASE \
  116. | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
  117. | BR_PS_8 /* Port Size = 8 bit */ \
  118. | BR_MS_FCM /* MSEL = FCM */ \
  119. | BR_V ) /* valid */
  120. #ifdef CONFIG_NAND_SP
  121. #define CONFIG_SYS_NAND_OR_PRELIM ( 0xFFFF8000 /* length 32K */ \
  122. | OR_FCM_CSCT \
  123. | OR_FCM_CST \
  124. | OR_FCM_CHT \
  125. | OR_FCM_SCY_1 \
  126. | OR_FCM_TRLX \
  127. | OR_FCM_EHTR )
  128. #define CONFIG_SYS_LBLAWAR0_PRELIM 0x8000000E /* 32KB */
  129. #define CONFIG_SYS_NAND_PAGE_SIZE (512) /* NAND chip page size */
  130. #define CONFIG_SYS_NAND_BLOCK_SIZE (16 << 10) /* NAND chip block size */
  131. #define NAND_CACHE_PAGES 32
  132. #elif defined(CONFIG_NAND_LP)
  133. #define CONFIG_SYS_NAND_OR_PRELIM ( 0xFFFC0000 /* length 256K */ \
  134. | OR_FCM_PGS \
  135. | OR_FCM_CSCT \
  136. | OR_FCM_CST \
  137. | OR_FCM_CHT \
  138. | OR_FCM_SCY_1 \
  139. | OR_FCM_TRLX \
  140. | OR_FCM_EHTR )
  141. #define CONFIG_SYS_LBLAWAR0_PRELIM 0x80000011 /* 256KB */
  142. #define CONFIG_SYS_NAND_PAGE_SIZE (2048) /* NAND chip page size */
  143. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 << 10) /* NAND chip block size */
  144. #define NAND_CACHE_PAGES 64
  145. #else
  146. #error Page size of NAND not defined.
  147. #endif /* CONFIG_NAND_SP */
  148. #define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SYS_NAND_BLOCK_SIZE
  149. #define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NAND_BR_PRELIM
  150. #define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NAND_OR_PRELIM
  151. #define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_NAND_BASE
  152. #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR0_PRELIM
  153. #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR0_PRELIM
  154. #define CONFIG_SYS_BR1_PRELIM ( CONFIG_SYS_FPGA_BASE \
  155. | BR_PS_16 \
  156. | BR_MS_UPMA \
  157. | BR_V )
  158. #define CONFIG_SYS_OR1_PRELIM ( OR_AM_2MB \
  159. | OR_UPM_BCTLD)
  160. #define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_FPGA_BASE
  161. #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_2MB)
  162. /*
  163. * JFFS2 configuration
  164. */
  165. #define CONFIG_JFFS2_NAND
  166. #define CONFIG_JFFS2_DEV "nand0"
  167. /* mtdparts command line support */
  168. #define CONFIG_CMD_MTDPARTS
  169. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  170. #define MTDIDS_DEFAULT "nand0=nand0"
  171. #define MTDPARTS_DEFAULT "mtdparts=nand0:2M(u-boot),6M(kernel),-(jffs2)"
  172. /* pass open firmware flat tree */
  173. #define CONFIG_OF_LIBFDT 1
  174. #define CONFIG_OF_BOARD_SETUP 1
  175. #define CONFIG_OF_STDOUT_VIA_ALIAS 1
  176. /*
  177. * Serial Port
  178. */
  179. #define CONFIG_CONS_INDEX 1
  180. #define CONFIG_SYS_NS16550
  181. #define CONFIG_SYS_NS16550_SERIAL
  182. #define CONFIG_SYS_NS16550_REG_SIZE 1
  183. #ifdef CONFIG_NAND_SPL
  184. #define CONFIG_NS16550_MIN_FUNCTIONS
  185. #endif
  186. #define CONFIG_SYS_BAUDRATE_TABLE \
  187. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
  188. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
  189. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
  190. /* Use the HUSH parser */
  191. #define CONFIG_SYS_HUSH_PARSER
  192. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  193. /* I2C */
  194. #define CONFIG_HARD_I2C /* I2C with hardware support*/
  195. #define CONFIG_FSL_I2C
  196. #define CONFIG_I2C_MULTI_BUS
  197. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address */
  198. #define CONFIG_SYS_I2C_SLAVE 0x7F
  199. #define CONFIG_SYS_I2C_NOPROBES {{0,0x69}} /* Don't probe these addrs */
  200. #define CONFIG_SYS_I2C_OFFSET 0x3000
  201. #define CONFIG_SYS_I2C2_OFFSET 0x3100
  202. /*
  203. * General PCI
  204. * Addresses are mapped 1-1.
  205. */
  206. #define CONFIG_SYS_PCI1_MEM_BASE 0x80000000
  207. #define CONFIG_SYS_PCI1_MEM_PHYS CONFIG_SYS_PCI1_MEM_BASE
  208. #define CONFIG_SYS_PCI1_MEM_SIZE 0x10000000 /* 256M */
  209. #define CONFIG_SYS_PCI1_MMIO_BASE 0x90000000
  210. #define CONFIG_SYS_PCI1_MMIO_PHYS CONFIG_SYS_PCI1_MMIO_BASE
  211. #define CONFIG_SYS_PCI1_MMIO_SIZE 0x10000000 /* 256M */
  212. #define CONFIG_SYS_PCI1_IO_BASE 0x00000000
  213. #define CONFIG_SYS_PCI1_IO_PHYS 0xE2000000
  214. #define CONFIG_SYS_PCI1_IO_SIZE 0x00100000 /* 1M */
  215. #define CONFIG_PCI_PNP /* do pci plug-and-play */
  216. #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057 /* Motorola */
  217. /*
  218. * TSEC
  219. */
  220. #define CONFIG_TSEC_ENET /* TSEC ethernet support */
  221. #define CONFIG_NET_MULTI
  222. #define CONFIG_GMII /* MII PHY management */
  223. #ifdef CONFIG_TSEC1
  224. #define CONFIG_HAS_ETH0
  225. #define CONFIG_TSEC1_NAME "TSEC0"
  226. #define CONFIG_SYS_TSEC1_OFFSET 0x24000
  227. #define TSEC1_PHY_ADDR 0x0
  228. #define TSEC1_FLAGS TSEC_GIGABIT
  229. #define TSEC1_PHYIDX 0
  230. #endif
  231. #ifdef CONFIG_TSEC2
  232. #define CONFIG_HAS_ETH1
  233. #define CONFIG_TSEC2_NAME "TSEC1"
  234. #define CONFIG_SYS_TSEC2_OFFSET 0x25000
  235. #define TSEC2_PHY_ADDR 4
  236. #define TSEC2_FLAGS TSEC_GIGABIT
  237. #define TSEC2_PHYIDX 0
  238. #endif
  239. /* Options are: TSEC[0-1] */
  240. #define CONFIG_ETHPRIME "TSEC1"
  241. /*
  242. * Configure on-board RTC
  243. */
  244. #define CONFIG_RTC_DS1337
  245. #define CONFIG_SYS_I2C_RTC_ADDR 0x68
  246. /*
  247. * Environment
  248. */
  249. #if defined(CONFIG_NAND_U_BOOT)
  250. #define CONFIG_ENV_IS_IN_NAND 1
  251. #define CONFIG_ENV_OFFSET (768 * 1024)
  252. #define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  253. #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
  254. #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
  255. #define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
  256. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
  257. #elif !defined(CONFIG_SYS_RAMBOOT)
  258. #define CONFIG_ENV_IS_IN_FLASH 1
  259. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
  260. #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
  261. #define CONFIG_ENV_SIZE 0x2000
  262. /* Address and size of Redundant Environment Sector */
  263. #else
  264. #define CONFIG_ENV_IS_NOWHERE 1 /* Store ENV in memory only */
  265. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  266. #define CONFIG_ENV_SIZE 0x2000
  267. #endif
  268. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  269. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  270. /*
  271. * BOOTP options
  272. */
  273. #define CONFIG_BOOTP_BOOTFILESIZE
  274. #define CONFIG_BOOTP_BOOTPATH
  275. #define CONFIG_BOOTP_GATEWAY
  276. #define CONFIG_BOOTP_HOSTNAME
  277. /*
  278. * Command line configuration.
  279. */
  280. #include <config_cmd_default.h>
  281. #undef CONFIG_CMD_IMLS
  282. #undef CONFIG_CMD_FLASH
  283. #define CONFIG_CMD_PING
  284. #define CONFIG_CMD_DHCP
  285. #define CONFIG_CMD_I2C
  286. #define CONFIG_CMD_MII
  287. #define CONFIG_CMD_DATE
  288. #define CONFIG_CMD_PCI
  289. #define CONFIG_CMD_JFFS2
  290. #if defined(CONFIG_SYS_RAMBOOT) && !defined(CONFIG_NAND_U_BOOT)
  291. #undef CONFIG_CMD_SAVEENV
  292. #undef CONFIG_CMD_LOADS
  293. #endif
  294. #define CONFIG_CMDLINE_EDITING 1
  295. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  296. /*
  297. * Miscellaneous configurable options
  298. */
  299. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  300. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  301. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  302. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  303. #define CONFIG_SYS_PBSIZE ( CONFIG_SYS_CBSIZE \
  304. + sizeof(CONFIG_SYS_PROMPT) \
  305. + 16 ) /* Print Buffer Size */
  306. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  307. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  308. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1ms ticks */
  309. /*
  310. * For booting Linux, the board info and command line data
  311. * have to be in the first 8 MB of memory, since this is
  312. * the maximum mapped by the Linux kernel during initialization.
  313. */
  314. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
  315. #define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
  316. #define CONFIG_SYS_HRCW_LOW ( HRCWL_LCL_BUS_TO_SCB_CLK_1X1 \
  317. | 0x20000000 /* reserved */ \
  318. | HRCWL_DDR_TO_SCB_CLK_2X1 \
  319. | HRCWL_CSB_TO_CLKIN_4X1 \
  320. | HRCWL_CORE_TO_CSB_2_5X1 )
  321. #define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 4)
  322. #define CONFIG_SYS_HRCW_HIGH_BASE ( HRCWH_PCI_HOST \
  323. | HRCWH_PCI1_ARBITER_ENABLE \
  324. | HRCWH_CORE_ENABLE \
  325. | HRCWH_BOOTSEQ_DISABLE \
  326. | HRCWH_SW_WATCHDOG_DISABLE \
  327. | HRCWH_TSEC1M_IN_RGMII \
  328. | HRCWH_TSEC2M_IN_RGMII \
  329. | HRCWH_BIG_ENDIAN \
  330. | HRCWH_LALE_NORMAL )
  331. #ifdef CONFIG_NAND_LP
  332. #define CONFIG_SYS_HRCW_HIGH ( CONFIG_SYS_HRCW_HIGH_BASE \
  333. | HRCWH_FROM_0XFFF00100 \
  334. | HRCWH_ROM_LOC_NAND_LP_8BIT \
  335. | HRCWH_RL_EXT_NAND)
  336. #else
  337. #define CONFIG_SYS_HRCW_HIGH ( CONFIG_SYS_HRCW_HIGH_BASE \
  338. | HRCWH_FROM_0XFFF00100 \
  339. | HRCWH_ROM_LOC_NAND_SP_8BIT \
  340. | HRCWH_RL_EXT_NAND )
  341. #endif
  342. /* System IO Config */
  343. #define CONFIG_SYS_SICRH ( SICRH_ETSEC2_B \
  344. | SICRH_ETSEC2_C \
  345. | SICRH_ETSEC2_D \
  346. | SICRH_ETSEC2_E \
  347. | SICRH_ETSEC2_F \
  348. | SICRH_ETSEC2_G \
  349. | SICRH_TSOBI1 \
  350. | SICRH_TSOBI2 )
  351. #define CONFIG_SYS_SICRL ( SICRL_LBC \
  352. | SICRL_USBDR_10 \
  353. | SICRL_ETSEC2_A )
  354. #define CONFIG_SYS_HID0_INIT 0x000000000
  355. #define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
  356. HID0_ENABLE_INSTRUCTION_CACHE | \
  357. HID0_ENABLE_DYNAMIC_POWER_MANAGMENT )
  358. #define CONFIG_SYS_HID2 HID2_HBE
  359. #define CONFIG_HIGH_BATS 1 /* High BATs supported */
  360. /* DDR @ 0x00000000 */
  361. #define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_10)
  362. #define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  363. #define CONFIG_SYS_IBAT1L ((CONFIG_SYS_SDRAM_BASE + 0x10000000) | BATL_PP_10)
  364. #define CONFIG_SYS_IBAT1U ((CONFIG_SYS_SDRAM_BASE + 0x10000000) | BATU_BL_256M | BATU_VS | BATU_VP)
  365. /* PCI @ 0x80000000 */
  366. #define CONFIG_SYS_IBAT2L (CONFIG_SYS_PCI1_MEM_BASE | BATL_PP_10)
  367. #define CONFIG_SYS_IBAT2U (CONFIG_SYS_PCI1_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  368. #define CONFIG_SYS_IBAT3L (CONFIG_SYS_PCI1_MMIO_BASE | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  369. #define CONFIG_SYS_IBAT3U (CONFIG_SYS_PCI1_MMIO_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
  370. /* PCI2 not supported on 8313 */
  371. #define CONFIG_SYS_IBAT4L (0)
  372. #define CONFIG_SYS_IBAT4U (0)
  373. /* IMMRBAR @ 0xE0000000, PCI IO @ 0xE2000000 */
  374. #define CONFIG_SYS_IBAT5L (CONFIG_SYS_IMMR | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  375. #define CONFIG_SYS_IBAT5U (CONFIG_SYS_IMMR | BATU_BL_256M | BATU_VS | BATU_VP)
  376. /* SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
  377. #define CONFIG_SYS_IBAT6L (0xF0000000 | BATL_PP_10 | BATL_GUARDEDSTORAGE)
  378. #define CONFIG_SYS_IBAT6U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
  379. #define CONFIG_SYS_IBAT7L (0)
  380. #define CONFIG_SYS_IBAT7U (0)
  381. #define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
  382. #define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
  383. #define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
  384. #define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
  385. #define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
  386. #define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
  387. #define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
  388. #define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
  389. #define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
  390. #define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
  391. #define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
  392. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  393. #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
  394. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  395. #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
  396. #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
  397. /*
  398. * Internal Definitions
  399. *
  400. * Boot Flags
  401. */
  402. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  403. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  404. /*
  405. * Environment Configuration
  406. */
  407. #define CONFIG_ENV_OVERWRITE
  408. #define CONFIG_NETDEV eth1
  409. #define CONFIG_HOSTNAME simpc8313
  410. #define CONFIG_ROOTPATH /tftpboot/
  411. #define CONFIG_BOOTFILE /tftpboot/uImage
  412. #define CONFIG_UBOOTPATH u-boot-nand.bin /* U-Boot image on TFTP server */
  413. #define CONFIG_FDTFILE simpc8313.dtb
  414. #define CONFIG_LOADADDR 500000 /* default location for tftp and bootm */
  415. #define CONFIG_BOOTDELAY 5 /* 5 second delay */
  416. #define CONFIG_BAUDRATE 115200
  417. #define CONFIG_BOOTCOMMAND "nand read $loadaddr kernel 600000;bootm $loadaddr - $fdtaddr"
  418. #define XMK_STR(x) #x
  419. #define MK_STR(x) XMK_STR(x)
  420. #define CONFIG_EXTRA_ENV_SETTINGS \
  421. "netdev=" MK_STR(CONFIG_NETDEV) "\0" \
  422. "ethprime=TSEC1\0" \
  423. "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0" \
  424. "tftpflash=tftpboot $loadaddr $uboot; " \
  425. "protect off " MK_STR(TEXT_BASE) " +$filesize; " \
  426. "erase " MK_STR(TEXT_BASE) " +$filesize; " \
  427. "cp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize; " \
  428. "protect on " MK_STR(TEXT_BASE) " +$filesize; " \
  429. "cmp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize\0" \
  430. "fdtaddr=ae0000\0" \
  431. "fdtfile=" MK_STR(CONFIG_FDTFILE) "\0" \
  432. "console=ttyS0\0" \
  433. "setbootargs=setenv bootargs " \
  434. "root=$rootdev rw console=$console,$baudrate $othbootargs\0" \
  435. "setipargs=setenv bootargs nfsroot=$serverip:$rootpath " \
  436. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
  437. "root=$rootdev rw console=$console,$baudrate $othbootargs\0" \
  438. "load_uboot=tftp 100000 u-boot-nand.bin\0" \
  439. "burn_uboot=nand erase u-boot 80000; " \
  440. "nand write 100000 u-boot $filesize\0" \
  441. "update_uboot=run load_uboot;run burn_uboot\0" \
  442. "mtdids=nand0=nand0\0" \
  443. "mtdparts=mtdparts=nand0:2M(u-boot),6M(kernel),-(jffs2)\0" \
  444. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  445. "nfsroot=${serverip}:${rootpath}\0" \
  446. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  447. "addip=setenv bootargs ${bootargs} " \
  448. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  449. ":${hostname}:${netdev}:off panic=1\0" \
  450. "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0" \
  451. "bootargs=root=/dev/mtdblock2 rootfstype=jffs2 rw " \
  452. "console=ttyS0,115200\0" \
  453. ""
  454. #define CONFIG_NFSBOOTCOMMAND \
  455. "setenv rootdev /dev/nfs;" \
  456. "run setbootargs;" \
  457. "run setipargs;" \
  458. "tftp $loadaddr $bootfile;" \
  459. "tftp $fdtaddr $fdtfile;" \
  460. "bootm $loadaddr - $fdtaddr"
  461. #define CONFIG_RAMBOOTCOMMAND \
  462. "setenv rootdev /dev/ram;" \
  463. "run setbootargs;" \
  464. "tftp $ramdiskaddr $ramdiskfile;" \
  465. "tftp $loadaddr $bootfile;" \
  466. "tftp $fdtaddr $fdtfile;" \
  467. "bootm $loadaddr $ramdiskaddr $fdtaddr"
  468. #undef MK_STR
  469. #undef XMK_STR
  470. #endif /* __CONFIG_H */