P1010RDB.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. /*
  2. * Copyright 2010-2011 Freescale Semiconductor, Inc.
  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. * P010 RDB board configuration file
  24. */
  25. #ifndef __CONFIG_H
  26. #define __CONFIG_H
  27. #ifdef CONFIG_36BIT
  28. #define CONFIG_PHYS_64BIT
  29. #endif
  30. #ifdef CONFIG_P1010RDB
  31. #define CONFIG_P1010
  32. #define CONFIG_NAND_FSL_IFC
  33. #endif
  34. #ifdef CONFIG_SDCARD
  35. #define CONFIG_RAMBOOT_SDCARD
  36. #define CONFIG_SYS_TEXT_BASE 0x11000000
  37. #define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
  38. #endif
  39. #ifdef CONFIG_SPIFLASH
  40. #define CONFIG_RAMBOOT_SPIFLASH
  41. #define CONFIG_SYS_TEXT_BASE 0x11000000
  42. #define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
  43. #endif
  44. #ifdef CONFIG_NAND /* NAND Boot */
  45. #define CONFIG_RAMBOOT_NAND
  46. #define CONFIG_NAND_U_BOOT
  47. #define CONFIG_SYS_TEXT_BASE_SPL 0xff800000
  48. #ifdef CONFIG_NAND_SPL
  49. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL
  50. #else
  51. #define CONFIG_SYS_TEXT_BASE 0x11001000
  52. #endif /* CONFIG_NAND_SPL */
  53. #endif
  54. #ifdef CONFIG_NAND_SECBOOT /* NAND Boot */
  55. #define CONFIG_RAMBOOT_NAND
  56. #define CONFIG_SYS_TEXT_BASE 0x11000000
  57. #define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
  58. #endif
  59. #ifndef CONFIG_SYS_TEXT_BASE
  60. #define CONFIG_SYS_TEXT_BASE 0xeff80000
  61. #endif
  62. #ifndef CONFIG_RESET_VECTOR_ADDRESS
  63. #define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
  64. #endif
  65. #ifndef CONFIG_SYS_MONITOR_BASE
  66. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  67. #endif
  68. /* High Level Configuration Options */
  69. #define CONFIG_BOOKE /* BOOKE */
  70. #define CONFIG_E500 /* BOOKE e500 family */
  71. #define CONFIG_MPC85xx
  72. #define CONFIG_FSL_IFC /* Enable IFC Support */
  73. #define CONFIG_SYS_HAS_SERDES /* common SERDES init code */
  74. #define CONFIG_PCI /* Enable PCI/PCIE */
  75. #if defined(CONFIG_PCI)
  76. #define CONFIG_PCIE1 /* PCIE controler 1 (slot 1) */
  77. #define CONFIG_PCIE2 /* PCIE controler 2 (slot 2) */
  78. #define CONFIG_FSL_PCI_INIT /* Use common FSL init code */
  79. #define CONFIG_FSL_PCIE_RESET /* need PCIe reset errata */
  80. #define CONFIG_SYS_PCI_64BIT /* enable 64-bit PCI resources */
  81. #define CONFIG_CMD_NET
  82. #define CONFIG_CMD_PCI
  83. #define CONFIG_E1000 /* E1000 pci Ethernet card*/
  84. /*
  85. * PCI Windows
  86. * Memory space is mapped 1-1, but I/O space must start from 0.
  87. */
  88. /* controller 1, Slot 1, tgtid 1, Base address a000 */
  89. #define CONFIG_SYS_PCIE1_NAME "mini PCIe Slot"
  90. #define CONFIG_SYS_PCIE1_MEM_VIRT 0x80000000
  91. #ifdef CONFIG_PHYS_64BIT
  92. #define CONFIG_SYS_PCIE1_MEM_BUS 0x80000000
  93. #define CONFIG_SYS_PCIE1_MEM_PHYS 0xc00000000ull
  94. #else
  95. #define CONFIG_SYS_PCIE1_MEM_BUS 0x80000000
  96. #define CONFIG_SYS_PCIE1_MEM_PHYS 0x80000000
  97. #endif
  98. #define CONFIG_SYS_PCIE1_MEM_SIZE 0x20000000 /* 512M */
  99. #define CONFIG_SYS_PCIE1_IO_VIRT 0xffc00000
  100. #define CONFIG_SYS_PCIE1_IO_BUS 0x00000000
  101. #define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
  102. #ifdef CONFIG_PHYS_64BIT
  103. #define CONFIG_SYS_PCIE1_IO_PHYS 0xfffc00000ull
  104. #else
  105. #define CONFIG_SYS_PCIE1_IO_PHYS 0xffc00000
  106. #endif
  107. /* controller 2, Slot 2, tgtid 2, Base address 9000 */
  108. #define CONFIG_SYS_PCIE2_NAME "PCIe Slot"
  109. #define CONFIG_SYS_PCIE2_MEM_VIRT 0xa0000000
  110. #ifdef CONFIG_PHYS_64BIT
  111. #define CONFIG_SYS_PCIE2_MEM_BUS 0xc0000000
  112. #define CONFIG_SYS_PCIE2_MEM_PHYS 0xc20000000ull
  113. #else
  114. #define CONFIG_SYS_PCIE2_MEM_BUS 0xa0000000
  115. #define CONFIG_SYS_PCIE2_MEM_PHYS 0xa0000000
  116. #endif
  117. #define CONFIG_SYS_PCIE2_MEM_SIZE 0x20000000 /* 512M */
  118. #define CONFIG_SYS_PCIE2_IO_VIRT 0xffc10000
  119. #define CONFIG_SYS_PCIE2_IO_BUS 0x00000000
  120. #define CONFIG_SYS_PCIE2_IO_SIZE 0x00010000 /* 64k */
  121. #ifdef CONFIG_PHYS_64BIT
  122. #define CONFIG_SYS_PCIE2_IO_PHYS 0xfffc10000ull
  123. #else
  124. #define CONFIG_SYS_PCIE2_IO_PHYS 0xffc10000
  125. #endif
  126. #define CONFIG_PCI_PNP /* do pci plug-and-play */
  127. #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
  128. #define CONFIG_DOS_PARTITION
  129. #endif
  130. #define CONFIG_FSL_LAW /* Use common FSL init code */
  131. #define CONFIG_TSEC_ENET
  132. #define CONFIG_ENV_OVERWRITE
  133. #define CONFIG_DDR_CLK_FREQ 66666666 /* DDRCLK on P1010 RDB */
  134. #define CONFIG_SYS_CLK_FREQ 66666666 /* SYSCLK for P1010 RDB */
  135. #ifndef CONFIG_SDCARD
  136. #define CONFIG_MISC_INIT_R
  137. #endif
  138. #define CONFIG_HWCONFIG
  139. /*
  140. * These can be toggled for performance analysis, otherwise use default.
  141. */
  142. #define CONFIG_L2_CACHE /* toggle L2 cache */
  143. #define CONFIG_BTB /* toggle branch predition */
  144. #define CONFIG_ADDR_STREAMING /* toggle addr streaming */
  145. #define CONFIG_ENABLE_36BIT_PHYS
  146. #ifdef CONFIG_PHYS_64BIT
  147. #define CONFIG_ADDR_MAP 1
  148. #define CONFIG_SYS_NUM_ADDR_MAP 16 /* number of TLB1 entries */
  149. #endif
  150. #define CONFIG_SYS_MEMTEST_START 0x00000000 /* memtest works on */
  151. #define CONFIG_SYS_MEMTEST_END 0x1fffffff
  152. #define CONFIG_PANIC_HANG /* do not reset board on panic */
  153. /* DDR Setup */
  154. #define CONFIG_FSL_DDR3
  155. #define CONFIG_DDR_RAW_TIMING
  156. #define CONFIG_DDR_SPD
  157. #define CONFIG_SYS_SPD_BUS_NUM 1
  158. #define SPD_EEPROM_ADDRESS 0x52
  159. #define CONFIG_MEM_INIT_VALUE 0xDeadBeef
  160. #ifndef __ASSEMBLY__
  161. extern unsigned long get_sdram_size(void);
  162. #endif
  163. #define CONFIG_SYS_SDRAM_SIZE get_sdram_size() /* DDR size */
  164. #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000
  165. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
  166. #define CONFIG_DIMM_SLOTS_PER_CTLR 1
  167. #define CONFIG_CHIP_SELECTS_PER_CTRL 1
  168. /* DDR3 Controller Settings */
  169. #define CONFIG_SYS_DDR_CS0_BNDS 0x0000003f
  170. #define CONFIG_SYS_DDR_CS0_CONFIG 0x80014302
  171. #define CONFIG_SYS_DDR_CS0_CONFIG_2 0x00000000
  172. #define CONFIG_SYS_DDR_DATA_INIT 0xdeadbeef
  173. #define CONFIG_SYS_DDR_INIT_ADDR 0x00000000
  174. #define CONFIG_SYS_DDR_INIT_EXT_ADDR 0x00000000
  175. #define CONFIG_SYS_DDR_MODE_CONTROL 0x00000000
  176. #define CONFIG_SYS_DDR_ZQ_CONTROL 0x89080600
  177. #define CONFIG_SYS_DDR_SR_CNTR 0x00000000
  178. #define CONFIG_SYS_DDR_RCW_1 0x00000000
  179. #define CONFIG_SYS_DDR_RCW_2 0x00000000
  180. #define CONFIG_SYS_DDR_CONTROL 0x470C0000 /* Type = DDR3 */
  181. #define CONFIG_SYS_DDR_CONTROL_2 0x04401010
  182. #define CONFIG_SYS_DDR_TIMING_4 0x00000001
  183. #define CONFIG_SYS_DDR_TIMING_5 0x03402400
  184. #define CONFIG_SYS_DDR_TIMING_3_800 0x00020000
  185. #define CONFIG_SYS_DDR_TIMING_0_800 0x00330004
  186. #define CONFIG_SYS_DDR_TIMING_1_800 0x6f6B4644
  187. #define CONFIG_SYS_DDR_TIMING_2_800 0x0FA888CF
  188. #define CONFIG_SYS_DDR_CLK_CTRL_800 0x03000000
  189. #define CONFIG_SYS_DDR_MODE_1_800 0x40461520
  190. #define CONFIG_SYS_DDR_MODE_2_800 0x8000c000
  191. #define CONFIG_SYS_DDR_INTERVAL_800 0x0C300100
  192. #define CONFIG_SYS_DDR_WRLVL_CONTROL_800 0x8655A608
  193. /* settings for DDR3 at 667MT/s */
  194. #define CONFIG_SYS_DDR_TIMING_3_667 0x00010000
  195. #define CONFIG_SYS_DDR_TIMING_0_667 0x00110004
  196. #define CONFIG_SYS_DDR_TIMING_1_667 0x5d59e544
  197. #define CONFIG_SYS_DDR_TIMING_2_667 0x0FA890CD
  198. #define CONFIG_SYS_DDR_CLK_CTRL_667 0x03000000
  199. #define CONFIG_SYS_DDR_MODE_1_667 0x00441210
  200. #define CONFIG_SYS_DDR_MODE_2_667 0x00000000
  201. #define CONFIG_SYS_DDR_INTERVAL_667 0x0a280000
  202. #define CONFIG_SYS_DDR_WRLVL_CONTROL_667 0x8675F608
  203. #define CONFIG_SYS_CCSRBAR 0xffe00000
  204. #define CONFIG_SYS_CCSRBAR_PHYS_LOW CONFIG_SYS_CCSRBAR
  205. /* Don't relocate CCSRBAR while in NAND_SPL */
  206. #ifdef CONFIG_NAND_SPL
  207. #define CONFIG_SYS_CCSR_DO_NOT_RELOCATE
  208. #endif
  209. /*
  210. * Memory map
  211. *
  212. * 0x0000_0000 0x3fff_ffff DDR 1G cacheable
  213. * 0x8000_0000 0xbfff_ffff PCI Express Mem 1.5G non-cacheable
  214. * 0xffc0_0000 0xffc3_ffff PCI IO range 256k non-cacheable
  215. *
  216. * Localbus non-cacheable
  217. * 0xff80_0000 0xff8f_ffff NAND Flash 1M non-cacheable
  218. * 0xffb0_0000 0xffbf_ffff Board CPLD 1M non-cacheable
  219. * 0xffd0_0000 0xffd0_3fff L1 for stack 16K Cacheable TLB0
  220. * 0xffe0_0000 0xffef_ffff CCSR 1M non-cacheable
  221. */
  222. /* In case of SD card boot, IFC interface is not available because of muxing */
  223. #ifdef CONFIG_SDCARD
  224. #define CONFIG_SYS_NO_FLASH
  225. #else
  226. /*
  227. * IFC Definitions
  228. */
  229. /* NOR Flash on IFC */
  230. #define CONFIG_SYS_FLASH_BASE 0xee000000
  231. #define CONFIG_SYS_MAX_FLASH_SECT 256 /* 32M */
  232. #ifdef CONFIG_PHYS_64BIT
  233. #define CONFIG_SYS_FLASH_BASE_PHYS (0xf00000000ull | CONFIG_SYS_FLASH_BASE)
  234. #else
  235. #define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE
  236. #endif
  237. #define CONFIG_SYS_NOR_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
  238. CSPR_PORT_SIZE_16 | \
  239. CSPR_MSEL_NOR | \
  240. CSPR_V)
  241. #define CONFIG_SYS_NOR_AMASK IFC_AMASK(32*1024*1024)
  242. #define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(7)
  243. /* NOR Flash Timing Params */
  244. #define CONFIG_SYS_NOR_FTIM0 FTIM0_NOR_TACSE(0x4) | \
  245. FTIM0_NOR_TEADC(0x5) | \
  246. FTIM0_NOR_TEAHC(0x5)
  247. #define CONFIG_SYS_NOR_FTIM1 FTIM1_NOR_TACO(0x1e) | \
  248. FTIM1_NOR_TRAD_NOR(0x0f)
  249. #define CONFIG_SYS_NOR_FTIM2 FTIM2_NOR_TCS(0x4) | \
  250. FTIM2_NOR_TCH(0x4) | \
  251. FTIM2_NOR_TWP(0x1c)
  252. #define CONFIG_SYS_NOR_FTIM3 0x0
  253. #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS}
  254. #define CONFIG_SYS_FLASH_QUIET_TEST
  255. #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
  256. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
  257. #undef CONFIG_SYS_FLASH_CHECKSUM
  258. #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
  259. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
  260. /* CFI for NOR Flash */
  261. #define CONFIG_FLASH_CFI_DRIVER
  262. #define CONFIG_SYS_FLASH_CFI
  263. #define CONFIG_SYS_FLASH_EMPTY_INFO
  264. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  265. /* NAND Flash on IFC */
  266. #define CONFIG_SYS_NAND_BASE 0xff800000
  267. #ifdef CONFIG_PHYS_64BIT
  268. #define CONFIG_SYS_NAND_BASE_PHYS 0xfff800000ull
  269. #else
  270. #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
  271. #endif
  272. #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
  273. | CSPR_PORT_SIZE_8 \
  274. | CSPR_MSEL_NAND \
  275. | CSPR_V)
  276. #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024)
  277. #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
  278. | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
  279. | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
  280. | CSOR_NAND_RAL_2 /* RAL = 2 Bytes */ \
  281. | CSOR_NAND_PGS_512 /* Page Size = 512b */ \
  282. | CSOR_NAND_SPRZ_16 /* Spare size = 16 */ \
  283. | CSOR_NAND_PB(32)) /* 32 Pages Per Block */
  284. #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
  285. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  286. #define CONFIG_MTD_NAND_VERIFY_WRITE
  287. #define CONFIG_CMD_NAND
  288. #define CONFIG_SYS_NAND_BLOCK_SIZE (16 * 1024)
  289. /* NAND Flash Timing Params */
  290. #define CONFIG_SYS_NAND_FTIM0 FTIM0_NAND_TCCST(0x01) | \
  291. FTIM0_NAND_TWP(0x0C) | \
  292. FTIM0_NAND_TWCHT(0x04) | \
  293. FTIM0_NAND_TWH(0x05)
  294. #define CONFIG_SYS_NAND_FTIM1 FTIM1_NAND_TADLE(0x1d) | \
  295. FTIM1_NAND_TWBE(0x1d) | \
  296. FTIM1_NAND_TRR(0x07) | \
  297. FTIM1_NAND_TRP(0x0c)
  298. #define CONFIG_SYS_NAND_FTIM2 FTIM2_NAND_TRAD(0x0c) | \
  299. FTIM2_NAND_TREH(0x05) | \
  300. FTIM2_NAND_TWHRE(0x0f)
  301. #define CONFIG_SYS_NAND_FTIM3 FTIM3_NAND_TWW(0x04)
  302. #define CONFIG_SYS_NAND_DDR_LAW 11
  303. /* Set up IFC registers for boot location NOR/NAND */
  304. #if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SECBOOT)
  305. #define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
  306. #define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
  307. #define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
  308. #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
  309. #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
  310. #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
  311. #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
  312. #define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR_CSPR
  313. #define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
  314. #define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
  315. #define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
  316. #define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
  317. #define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
  318. #define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
  319. #else
  320. #define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR_CSPR
  321. #define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
  322. #define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
  323. #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
  324. #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
  325. #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
  326. #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
  327. #define CONFIG_SYS_CSPR1 CONFIG_SYS_NAND_CSPR
  328. #define CONFIG_SYS_AMASK1 CONFIG_SYS_NAND_AMASK
  329. #define CONFIG_SYS_CSOR1 CONFIG_SYS_NAND_CSOR
  330. #define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NAND_FTIM0
  331. #define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NAND_FTIM1
  332. #define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NAND_FTIM2
  333. #define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NAND_FTIM3
  334. #endif
  335. /* NAND boot: 8K NAND loader config */
  336. #define CONFIG_SYS_NAND_SPL_SIZE 0x2000
  337. #define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  338. #define CONFIG_SYS_NAND_U_BOOT_DST (0x11000000 - CONFIG_SYS_NAND_SPL_SIZE)
  339. #define CONFIG_SYS_NAND_U_BOOT_START 0x11000000
  340. #define CONFIG_SYS_NAND_U_BOOT_OFFS (0)
  341. #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x10000
  342. #define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
  343. /* CPLD on IFC */
  344. #define CONFIG_SYS_CPLD_BASE 0xffb00000
  345. #ifdef CONFIG_PHYS_64BIT
  346. #define CONFIG_SYS_CPLD_BASE_PHYS 0xfffb00000ull
  347. #else
  348. #define CONFIG_SYS_CPLD_BASE_PHYS CONFIG_SYS_CPLD_BASE
  349. #endif
  350. #define CONFIG_SYS_CSPR3 (CSPR_PHYS_ADDR(CONFIG_SYS_CPLD_BASE_PHYS) \
  351. | CSPR_PORT_SIZE_8 \
  352. | CSPR_MSEL_GPCM \
  353. | CSPR_V)
  354. #define CONFIG_SYS_AMASK3 IFC_AMASK(64*1024)
  355. #define CONFIG_SYS_CSOR3 0x0
  356. /* CPLD Timing parameters for IFC CS3 */
  357. #define CONFIG_SYS_CS3_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
  358. FTIM0_GPCM_TEADC(0x0e) | \
  359. FTIM0_GPCM_TEAHC(0x0e))
  360. #define CONFIG_SYS_CS3_FTIM1 (FTIM1_GPCM_TACO(0x0e) | \
  361. FTIM1_GPCM_TRAD(0x1f))
  362. #define CONFIG_SYS_CS3_FTIM2 (FTIM2_GPCM_TCS(0x0e) | \
  363. FTIM2_GPCM_TCH(0x0) | \
  364. FTIM2_GPCM_TWP(0x1f))
  365. #define CONFIG_SYS_CS3_FTIM3 0x0
  366. #endif /* CONFIG_SDCARD */
  367. #if defined(CONFIG_RAMBOOT_SDCARD) || defined(CONFIG_RAMBOOT_SPIFLASH) || \
  368. defined(CONFIG_RAMBOOT_NAND)
  369. #define CONFIG_SYS_RAMBOOT
  370. #define CONFIG_SYS_EXTRA_ENV_RELOC
  371. #else
  372. #undef CONFIG_SYS_RAMBOOT
  373. #endif
  374. #define CONFIG_BOARD_EARLY_INIT_F /* Call board_pre_init */
  375. #define CONFIG_BOARD_EARLY_INIT_R
  376. #define CONFIG_SYS_INIT_RAM_LOCK
  377. #define CONFIG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */
  378. #define CONFIG_SYS_INIT_RAM_END 0x00004000 /* End of used area in RAM */
  379. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END \
  380. - GENERATED_GBL_DATA_SIZE)
  381. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  382. #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon*/
  383. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc*/
  384. /* Serial Port */
  385. #define CONFIG_CONS_INDEX 1
  386. #undef CONFIG_SERIAL_SOFTWARE_FIFO
  387. #define CONFIG_SYS_NS16550
  388. #define CONFIG_SYS_NS16550_SERIAL
  389. #define CONFIG_SYS_NS16550_REG_SIZE 1
  390. #define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
  391. #ifdef CONFIG_NAND_SPL
  392. #define CONFIG_NS16550_MIN_FUNCTIONS
  393. #endif
  394. #define CONFIG_SERIAL_MULTI /* Enable both serial ports */
  395. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */
  396. #define CONFIG_SYS_BAUDRATE_TABLE \
  397. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
  398. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR+0x4500)
  399. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x4600)
  400. /* Use the HUSH parser */
  401. #define CONFIG_SYS_HUSH_PARSER
  402. #ifdef CONFIG_SYS_HUSH_PARSER
  403. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  404. #endif
  405. /*
  406. * Pass open firmware flat tree
  407. */
  408. #define CONFIG_OF_LIBFDT
  409. #define CONFIG_OF_BOARD_SETUP
  410. #define CONFIG_OF_STDOUT_VIA_ALIAS
  411. /* new uImage format support */
  412. #define CONFIG_FIT
  413. #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
  414. #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
  415. #define CONFIG_HARD_I2C /* I2C with hardware support */
  416. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  417. #define CONFIG_I2C_MULTI_BUS
  418. #define CONFIG_I2C_CMD_TREE
  419. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/
  420. #define CONFIG_SYS_I2C_SLAVE 0x7F
  421. #define CONFIG_SYS_I2C_OFFSET 0x3000
  422. #define CONFIG_SYS_I2C2_OFFSET 0x3100
  423. /* I2C EEPROM */
  424. #undef CONFIG_ID_EEPROM
  425. /* enable read and write access to EEPROM */
  426. #define CONFIG_CMD_EEPROM
  427. #define CONFIG_SYS_I2C_MULTI_EEPROMS
  428. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  429. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
  430. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  431. /* RTC */
  432. #define CONFIG_RTC_PT7C4338
  433. #define CONFIG_SYS_I2C_RTC_ADDR 0x68
  434. #define CONFIG_CMD_I2C
  435. /*
  436. * SPI interface will not be available in case of NAND boot SPI CS0 will be
  437. * used for SLIC
  438. */
  439. #if !defined(CONFIG_NAND_U_BOOT) || !defined(CONFIG_NAND_SECBOOT)
  440. /* eSPI - Enhanced SPI */
  441. #define CONFIG_FSL_ESPI
  442. #define CONFIG_SPI_FLASH
  443. #define CONFIG_SPI_FLASH_SPANSION
  444. #define CONFIG_CMD_SF
  445. #define CONFIG_SF_DEFAULT_SPEED 10000000
  446. #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
  447. #endif
  448. #if defined(CONFIG_TSEC_ENET)
  449. #ifndef CONFIG_NET_MULTI
  450. #define CONFIG_NET_MULTI
  451. #endif
  452. #define CONFIG_MII /* MII PHY management */
  453. #define CONFIG_MII_DEFAULT_TSEC 1 /* Allow unregistered phys */
  454. #define CONFIG_TSEC1 1
  455. #define CONFIG_TSEC1_NAME "eTSEC1"
  456. #define CONFIG_TSEC2 1
  457. #define CONFIG_TSEC2_NAME "eTSEC2"
  458. #define CONFIG_TSEC3 1
  459. #define CONFIG_TSEC3_NAME "eTSEC3"
  460. #define TSEC1_PHY_ADDR 1
  461. #define TSEC2_PHY_ADDR 0
  462. #define TSEC3_PHY_ADDR 2
  463. #define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  464. #define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  465. #define TSEC3_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  466. #define TSEC1_PHYIDX 0
  467. #define TSEC2_PHYIDX 0
  468. #define TSEC3_PHYIDX 0
  469. #define CONFIG_ETHPRIME "eTSEC1"
  470. #define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */
  471. /* TBI PHY configuration for SGMII mode */
  472. #define CONFIG_TSEC_TBICR_SETTINGS ( \
  473. TBICR_PHY_RESET \
  474. | TBICR_ANEG_ENABLE \
  475. | TBICR_FULL_DUPLEX \
  476. | TBICR_SPEED1_SET \
  477. )
  478. #endif /* CONFIG_TSEC_ENET */
  479. /* SATA */
  480. #define CONFIG_FSL_SATA
  481. #define CONFIG_LIBATA
  482. #ifdef CONFIG_FSL_SATA
  483. #define CONFIG_SYS_SATA_MAX_DEVICE 2
  484. #define CONFIG_SATA1
  485. #define CONFIG_SYS_SATA1 CONFIG_SYS_MPC85xx_SATA1_ADDR
  486. #define CONFIG_SYS_SATA1_FLAGS FLAGS_DMA
  487. #define CONFIG_SATA2
  488. #define CONFIG_SYS_SATA2 CONFIG_SYS_MPC85xx_SATA2_ADDR
  489. #define CONFIG_SYS_SATA2_FLAGS FLAGS_DMA
  490. #define CONFIG_CMD_SATA
  491. #define CONFIG_LBA48
  492. #endif /* #ifdef CONFIG_FSL_SATA */
  493. /* SD interface will only be available in case of SD boot */
  494. #ifdef CONFIG_SDCARD
  495. #define CONFIG_MMC
  496. #define CONFIG_DEF_HWCONFIG esdhc
  497. #endif
  498. #ifdef CONFIG_MMC
  499. #define CONFIG_CMD_MMC
  500. #define CONFIG_DOS_PARTITION
  501. #define CONFIG_FSL_ESDHC
  502. #define CONFIG_GENERIC_MMC
  503. #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC85xx_ESDHC_ADDR
  504. #endif
  505. #define CONFIG_HAS_FSL_DR_USB
  506. #if defined(CONFIG_HAS_FSL_DR_USB)
  507. #define CONFIG_USB_EHCI
  508. #ifdef CONFIG_USB_EHCI
  509. #define CONFIG_CMD_USB
  510. #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
  511. #define CONFIG_USB_EHCI_FSL
  512. #define CONFIG_USB_STORAGE
  513. #endif
  514. #endif
  515. /*
  516. * Environment
  517. */
  518. #if defined(CONFIG_SYS_RAMBOOT)
  519. #if defined(CONFIG_RAMBOOT_SDCARD)
  520. #define CONFIG_ENV_IS_IN_MMC
  521. #define CONFIG_SYS_MMC_ENV_DEV 0
  522. #define CONFIG_ENV_SIZE 0x2000
  523. #elif defined(CONFIG_RAMBOOT_SPIFLASH)
  524. #define CONFIG_ENV_IS_IN_SPI_FLASH
  525. #define CONFIG_ENV_SPI_BUS 0
  526. #define CONFIG_ENV_SPI_CS 0
  527. #define CONFIG_ENV_SPI_MAX_HZ 10000000
  528. #define CONFIG_ENV_SPI_MODE 0
  529. #define CONFIG_ENV_OFFSET 0x100000 /* 1MB */
  530. #define CONFIG_ENV_SECT_SIZE 0x10000
  531. #define CONFIG_ENV_SIZE 0x2000
  532. #elif defined(CONFIG_NAND_U_BOOT)
  533. #define CONFIG_ENV_IS_IN_NAND
  534. #define CONFIG_ENV_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  535. #define CONFIG_ENV_OFFSET CONFIG_SYS_NAND_U_BOOT_SIZE
  536. #define CONFIG_ENV_RANGE (3 * CONFIG_ENV_SIZE)
  537. #else
  538. #define CONFIG_ENV_IS_NOWHERE /* Store ENV in memory only */
  539. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  540. #define CONFIG_ENV_SIZE 0x2000
  541. #endif
  542. #else
  543. #define CONFIG_ENV_IS_IN_FLASH
  544. #if CONFIG_SYS_MONITOR_BASE > 0xfff80000
  545. #define CONFIG_ENV_ADDR 0xfff80000
  546. #else
  547. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
  548. #endif
  549. #define CONFIG_ENV_SIZE 0x2000
  550. #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) */
  551. #endif
  552. #define CONFIG_LOADS_ECHO /* echo on for serial download */
  553. #define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
  554. /*
  555. * Command line configuration.
  556. */
  557. #include <config_cmd_default.h>
  558. #define CONFIG_CMD_DATE
  559. #define CONFIG_CMD_ERRATA
  560. #define CONFIG_CMD_ELF
  561. #define CONFIG_CMD_IRQ
  562. #define CONFIG_CMD_MII
  563. #define CONFIG_CMD_PING
  564. #define CONFIG_CMD_SETEXPR
  565. #define CONFIG_CMD_REGINFO
  566. #undef CONFIG_WATCHDOG /* watchdog disabled */
  567. #if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI) \
  568. || defined(CONFIG_FSL_SATA)
  569. #define CONFIG_CMD_EXT2
  570. #define CONFIG_CMD_FAT
  571. #define CONFIG_DOS_PARTITION
  572. #endif
  573. /*
  574. * Miscellaneous configurable options
  575. */
  576. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  577. #define CONFIG_CMDLINE_EDITING /* Command-line editing */
  578. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  579. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  580. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  581. #if defined(CONFIG_CMD_KGDB)
  582. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  583. #else
  584. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  585. #endif
  586. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  587. /* Print Buffer Size */
  588. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  589. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE/* Boot Argument Buffer Size */
  590. #define CONFIG_SYS_HZ 1000 /* dec freq: 1ms ticks */
  591. /*
  592. * Internal Definitions
  593. *
  594. * Boot Flags
  595. */
  596. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  597. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  598. /*
  599. * For booting Linux, the board info and command line data
  600. * have to be in the first 64 MB of memory, since this is
  601. * the maximum mapped by the Linux kernel during initialization.
  602. */
  603. #define CONFIG_SYS_BOOTMAPSZ (64 << 20) /* Initial Memory map for Linux */
  604. #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
  605. #if defined(CONFIG_CMD_KGDB)
  606. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  607. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  608. #endif
  609. /*
  610. * Environment Configuration
  611. */
  612. #if defined(CONFIG_TSEC_ENET)
  613. #define CONFIG_HAS_ETH0
  614. #define CONFIG_HAS_ETH1
  615. #define CONFIG_HAS_ETH2
  616. #endif
  617. #define CONFIG_HOSTNAME P1010RDB
  618. #define CONFIG_ROOTPATH "/opt/nfsroot"
  619. #define CONFIG_BOOTFILE "uImage"
  620. #define CONFIG_UBOOTPATH u-boot.bin/* U-Boot image on TFTP server */
  621. /* default location for tftp and bootm */
  622. #define CONFIG_LOADADDR 1000000
  623. #define CONFIG_BOOTDELAY 10 /* -1 disables auto-boot */
  624. #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
  625. #define CONFIG_BAUDRATE 115200
  626. #define CONFIG_EXTRA_ENV_SETTINGS \
  627. "hwconfig=" MK_STR(CONFIG_DEF_HWCONFIG) "\0" \
  628. "netdev=eth0\0" \
  629. "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0" \
  630. "loadaddr=1000000\0" \
  631. "consoledev=ttyS0\0" \
  632. "ramdiskaddr=2000000\0" \
  633. "ramdiskfile=rootfs.ext2.gz.uboot\0" \
  634. "fdtaddr=c00000\0" \
  635. "fdtfile=p1010rdb.dtb\0" \
  636. "bdev=sda1\0" \
  637. "hwconfig=usb1:dr_mode=host,phy_type=utmi\0" \
  638. "othbootargs=ramdisk_size=600000\0" \
  639. "usbfatboot=setenv bootargs root=/dev/ram rw " \
  640. "console=$consoledev,$baudrate $othbootargs; " \
  641. "usb start;" \
  642. "fatload usb 0:2 $loadaddr $bootfile;" \
  643. "fatload usb 0:2 $fdtaddr $fdtfile;" \
  644. "fatload usb 0:2 $ramdiskaddr $ramdiskfile;" \
  645. "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
  646. "usbext2boot=setenv bootargs root=/dev/ram rw " \
  647. "console=$consoledev,$baudrate $othbootargs; " \
  648. "usb start;" \
  649. "ext2load usb 0:4 $loadaddr $bootfile;" \
  650. "ext2load usb 0:4 $fdtaddr $fdtfile;" \
  651. "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;" \
  652. "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
  653. #define CONFIG_RAMBOOTCOMMAND \
  654. "setenv bootargs root=/dev/ram rw " \
  655. "console=$consoledev,$baudrate $othbootargs; " \
  656. "tftp $ramdiskaddr $ramdiskfile;" \
  657. "tftp $loadaddr $bootfile;" \
  658. "tftp $fdtaddr $fdtfile;" \
  659. "bootm $loadaddr $ramdiskaddr $fdtaddr"
  660. #define CONFIG_BOOTCOMMAND CONFIG_RAMBOOTCOMMAND
  661. #ifdef CONFIG_SECURE_BOOT
  662. #include <asm/fsl_secure_boot.h>
  663. #endif
  664. #endif /* __CONFIG_H */