SIMPC8313.h 17 KB

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