BSC9131RDB.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. /*
  2. * Copyright 2011-2012 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. * BSC9131 RDB board configuration file
  24. */
  25. #ifndef __CONFIG_H
  26. #define __CONFIG_H
  27. #ifdef CONFIG_BSC9131RDB
  28. #define CONFIG_BSC9131
  29. #define CONFIG_NAND_FSL_IFC
  30. #endif
  31. #ifdef CONFIG_SPIFLASH
  32. #define CONFIG_RAMBOOT_SPIFLASH
  33. #define CONFIG_SYS_RAMBOOT
  34. #define CONFIG_SYS_EXTRA_ENV_RELOC
  35. #define CONFIG_SYS_TEXT_BASE 0x11000000
  36. #define CONFIG_RESET_VECTOR_ADDRESS 0x1107fffc
  37. #endif
  38. #ifndef CONFIG_SYS_MONITOR_BASE
  39. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  40. #endif
  41. /* High Level Configuration Options */
  42. #define CONFIG_BOOKE /* BOOKE */
  43. #define CONFIG_E500 /* BOOKE e500 family */
  44. #define CONFIG_MPC85xx /* MPC8540/60/55/41/48/P1020/P2020/P1010,etc*/
  45. #define CONFIG_FSL_IFC /* Enable IFC Support */
  46. #define CONFIG_FSL_LAW /* Use common FSL init code */
  47. #define CONFIG_TSEC_ENET
  48. #define CONFIG_ENV_OVERWRITE
  49. #define CONFIG_DDR_CLK_FREQ 66666666 /* DDRCLK on 9131 RDB */
  50. #define CONFIG_SYS_CLK_FREQ 66666666 /* SYSCLK for 9131 RDB */
  51. #define CONFIG_HWCONFIG
  52. /*
  53. * These can be toggled for performance analysis, otherwise use default.
  54. */
  55. #define CONFIG_L2_CACHE /* toggle L2 cache */
  56. #define CONFIG_BTB /* enable branch predition */
  57. #define CONFIG_SYS_MEMTEST_START 0x01000000 /* memtest works on */
  58. #define CONFIG_SYS_MEMTEST_END 0x01ffffff
  59. /* DDR Setup */
  60. #define CONFIG_FSL_DDR3
  61. #undef CONFIG_SYS_DDR_RAW_TIMING
  62. #undef CONFIG_DDR_SPD
  63. #define CONFIG_SYS_SPD_BUS_NUM 0
  64. #define SPD_EEPROM_ADDRESS 0x52 /* I2C access */
  65. #define CONFIG_MEM_INIT_VALUE 0xDeadBeef
  66. #ifndef __ASSEMBLY__
  67. extern unsigned long get_sdram_size(void);
  68. #endif
  69. #define CONFIG_SYS_SDRAM_SIZE get_sdram_size() /* DDR size */
  70. #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000
  71. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
  72. #define CONFIG_NUM_DDR_CONTROLLERS 1
  73. #define CONFIG_DIMM_SLOTS_PER_CTLR 1
  74. #define CONFIG_CHIP_SELECTS_PER_CTRL 1
  75. #define CONFIG_SYS_DDR_CS0_BNDS 0x0000003f
  76. #define CONFIG_SYS_DDR_CS0_CONFIG 0x80014302
  77. #define CONFIG_SYS_DDR_CS0_CONFIG_2 0x00000000
  78. #define CONFIG_SYS_DDR_DATA_INIT 0xdeadbeef
  79. #define CONFIG_SYS_DDR_INIT_ADDR 0x00000000
  80. #define CONFIG_SYS_DDR_INIT_EXT_ADDR 0x00000000
  81. #define CONFIG_SYS_DDR_MODE_CONTROL 0x00000000
  82. #define CONFIG_SYS_DDR_ZQ_CONTROL 0x89080600
  83. #define CONFIG_SYS_DDR_SR_CNTR 0x00000000
  84. #define CONFIG_SYS_DDR_RCW_1 0x00000000
  85. #define CONFIG_SYS_DDR_RCW_2 0x00000000
  86. #define CONFIG_SYS_DDR_CONTROL 0xC70C0000 /* Type = DDR3 */
  87. #define CONFIG_SYS_DDR_CONTROL_2 0x24401000
  88. #define CONFIG_SYS_DDR_TIMING_4 0x00000001
  89. #define CONFIG_SYS_DDR_TIMING_5 0x02401400
  90. #define CONFIG_SYS_DDR_TIMING_3_800 0x00030000
  91. #define CONFIG_SYS_DDR_TIMING_0_800 0x00110104
  92. #define CONFIG_SYS_DDR_TIMING_1_800 0x6f6b8644
  93. #define CONFIG_SYS_DDR_TIMING_2_800 0x0fa888cf
  94. #define CONFIG_SYS_DDR_CLK_CTRL_800 0x03000000
  95. #define CONFIG_SYS_DDR_MODE_1_800 0x00441420
  96. #define CONFIG_SYS_DDR_MODE_2_800 0x8000c000
  97. #define CONFIG_SYS_DDR_INTERVAL_800 0x0c300100
  98. #define CONFIG_SYS_DDR_WRLVL_CONTROL_800 0x8675f608
  99. /*
  100. * Base addresses -- Note these are effective addresses where the
  101. * actual resources get mapped (not physical addresses)
  102. */
  103. /* relocated CCSRBAR */
  104. #define CONFIG_SYS_CCSRBAR CONFIG_SYS_CCSRBAR_DEFAULT
  105. #define CONFIG_SYS_CCSRBAR_PHYS_LOW CONFIG_SYS_CCSRBAR_DEFAULT
  106. #define CONFIG_SYS_IMMR CONFIG_SYS_CCSRBAR /* PQII uses */
  107. /* CONFIG_SYS_IMMR */
  108. /*
  109. * Memory map
  110. *
  111. * 0x0000_0000 0x3FFF_FFFF DDR 1G cacheable
  112. * 0x8800_0000 0x8810_0000 IFC internal SRAM 1M
  113. * 0xC100_0000 0xC13F_FFFF MAPLE-2F 4M
  114. * 0xC1F0_0000 0xC1F3_FFFF PA L2 SRAM Region 0 256K
  115. * 0xC1F8_0000 0xC1F9_FFFF PA L2 SRAM Region 1 128K
  116. * 0xFED0_0000 0xFED0_3FFF SEC Secured RAM 16K
  117. * 0xFF70_0000 0xFF7F_FFFF PA CCSR 1M
  118. * 0xFF80_0000 0xFFFF_FFFF Boot Page & NAND flash buffer 8M
  119. *
  120. */
  121. /*
  122. * IFC Definitions
  123. */
  124. #define CONFIG_SYS_NO_FLASH
  125. /* NAND Flash on IFC */
  126. #define CONFIG_SYS_NAND_BASE 0xff800000
  127. #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
  128. #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
  129. | CSPR_PORT_SIZE_8 /* Port Size = 8 bit*/ \
  130. | CSPR_MSEL_NAND /* MSEL = NAND */ \
  131. | CSPR_V)
  132. #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024)
  133. #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
  134. | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
  135. | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
  136. | CSOR_NAND_RAL_2 /* RAL = 2Byes */ \
  137. | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
  138. | CSOR_NAND_SPRZ_64 /* Spare size = 64 */ \
  139. | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/
  140. /* NAND Flash Timing Params */
  141. #define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x08) \
  142. | FTIM0_NAND_TWP(0x06) \
  143. | FTIM0_NAND_TWCHT(0x03) \
  144. | FTIM0_NAND_TWH(0x04))
  145. #define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x18) \
  146. | FTIM1_NAND_TWBE(0x23) \
  147. | FTIM1_NAND_TRR(0x08) \
  148. | FTIM1_NAND_TRP(0x05))
  149. #define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x08) \
  150. | FTIM2_NAND_TREH(0x04) \
  151. | FTIM2_NAND_TWHRE(0x3f))
  152. #define CONFIG_SYS_NAND_FTIM3 FTIM3_NAND_TWW(0x22)
  153. #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
  154. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  155. #define CONFIG_MTD_NAND_VERIFY_WRITE
  156. #define CONFIG_CMD_NAND
  157. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  158. #define CONFIG_SYS_NAND_DDR_LAW 11
  159. /* Set up IFC registers for boot location NAND */
  160. #define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
  161. #define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
  162. #define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
  163. #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
  164. #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
  165. #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
  166. #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
  167. #define CONFIG_BOARD_EARLY_INIT_F /* Call board_pre_init */
  168. #define CONFIG_SYS_INIT_RAM_LOCK
  169. #define CONFIG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */
  170. #define CONFIG_SYS_INIT_RAM_END 0x00004000/* End of used area in RAM */
  171. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END \
  172. - GENERATED_GBL_DATA_SIZE)
  173. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  174. #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon*/
  175. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc*/
  176. /* Serial Port */
  177. #define CONFIG_CONS_INDEX 1
  178. #undef CONFIG_SERIAL_SOFTWARE_FIFO
  179. #define CONFIG_SYS_NS16550
  180. #define CONFIG_SYS_NS16550_SERIAL
  181. #define CONFIG_SYS_NS16550_REG_SIZE 1
  182. #define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
  183. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* determine from environment */
  184. #define CONFIG_SYS_BAUDRATE_TABLE \
  185. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
  186. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR+0x4500)
  187. /* Use the HUSH parser */
  188. #define CONFIG_SYS_HUSH_PARSER
  189. #ifdef CONFIG_SYS_HUSH_PARSER
  190. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  191. #endif
  192. /*
  193. * Pass open firmware flat tree
  194. */
  195. #define CONFIG_OF_LIBFDT
  196. #define CONFIG_OF_BOARD_SETUP
  197. #define CONFIG_OF_STDOUT_VIA_ALIAS
  198. /* new uImage format support */
  199. #define CONFIG_FIT
  200. #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
  201. #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
  202. #define CONFIG_HARD_I2C /* I2C with hardware support */
  203. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  204. #define CONFIG_I2C_MULTI_BUS
  205. #define CONFIG_I2C_CMD_TREE
  206. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed and slave address*/
  207. #define CONFIG_SYS_I2C_OFFSET 0x3000
  208. /* I2C EEPROM */
  209. #define CONFIG_CMD_EEPROM
  210. #define CONFIG_SYS_I2C_MULTI_EEPROMS
  211. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  212. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
  213. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  214. #define CONFIG_CMD_I2C
  215. #define CONFIG_FSL_ESPI
  216. /* eSPI - Enhanced SPI */
  217. #ifdef CONFIG_FSL_ESPI
  218. #define CONFIG_SPI_FLASH
  219. #define CONFIG_SPI_FLASH_SPANSION
  220. #define CONFIG_CMD_SF
  221. #define CONFIG_SF_DEFAULT_SPEED 10000000
  222. #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
  223. #endif
  224. #if defined(CONFIG_TSEC_ENET)
  225. #define CONFIG_MII /* MII PHY management */
  226. #define CONFIG_MII_DEFAULT_TSEC 1 /* Allow unregistered phys */
  227. #define CONFIG_TSEC1 1
  228. #define CONFIG_TSEC1_NAME "eTSEC1"
  229. #define CONFIG_TSEC2 1
  230. #define CONFIG_TSEC2_NAME "eTSEC2"
  231. #define TSEC1_PHY_ADDR 0
  232. #define TSEC2_PHY_ADDR 3
  233. #define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  234. #define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  235. #define TSEC1_PHYIDX 0
  236. #define TSEC2_PHYIDX 0
  237. #define CONFIG_ETHPRIME "eTSEC1"
  238. #define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */
  239. #endif /* CONFIG_TSEC_ENET */
  240. /*
  241. * Environment
  242. */
  243. #if defined(CONFIG_SYS_RAMBOOT)
  244. #if defined(CONFIG_RAMBOOT_SPIFLASH)
  245. #define CONFIG_ENV_IS_IN_SPI_FLASH
  246. #define CONFIG_ENV_SPI_BUS 0
  247. #define CONFIG_ENV_SPI_CS 0
  248. #define CONFIG_ENV_SPI_MAX_HZ 10000000
  249. #define CONFIG_ENV_SPI_MODE 0
  250. #define CONFIG_ENV_OFFSET 0x100000 /* 1MB */
  251. #define CONFIG_ENV_SECT_SIZE 0x10000
  252. #define CONFIG_ENV_SIZE 0x2000
  253. #else
  254. #define CONFIG_ENV_IS_NOWHERE /* Store ENV in memory only */
  255. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  256. #define CONFIG_ENV_SIZE 0x2000
  257. #endif
  258. #else
  259. #define CONFIG_ENV_IS_NOWHERE 1 /* Store ENV in memory only */
  260. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
  261. #define CONFIG_ENV_SIZE 0x400
  262. #endif
  263. #define CONFIG_LOADS_ECHO /* echo on for serial download */
  264. #define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
  265. /*
  266. * Command line configuration.
  267. */
  268. #include <config_cmd_default.h>
  269. #define CONFIG_CMD_DHCP
  270. #define CONFIG_CMD_ERRATA
  271. #define CONFIG_CMD_ELF
  272. #define CONFIG_CMD_EXT2
  273. #define CONFIG_CMD_FAT
  274. #define CONFIG_CMD_IRQ
  275. #define CONFIG_CMD_MII
  276. #define CONFIG_DOS_PARTITION
  277. #define CONFIG_CMD_PING
  278. #define CONFIG_CMD_REGINFO
  279. #define CONFIG_CMD_SETEXPR
  280. /*
  281. * Miscellaneous configurable options
  282. */
  283. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  284. #define CONFIG_CMDLINE_EDITING /* Command-line editing */
  285. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  286. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  287. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  288. #if defined(CONFIG_CMD_KGDB)
  289. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  290. #else
  291. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  292. #endif
  293. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  294. /* Print Buffer Size */
  295. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  296. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE/* Boot Argument Buffer Size */
  297. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1ms ticks */
  298. /*
  299. * For booting Linux, the board info and command line data
  300. * have to be in the first 64 MB of memory, since this is
  301. * the maximum mapped by the Linux kernel during initialization.
  302. */
  303. #define CONFIG_SYS_BOOTMAPSZ (64 << 20) /* Initial Memory map for Linux */
  304. #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
  305. #if defined(CONFIG_CMD_KGDB)
  306. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  307. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  308. #endif
  309. #define CONFIG_USB_EHCI
  310. #ifdef CONFIG_USB_EHCI
  311. #define CONFIG_CMD_USB
  312. #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
  313. #define CONFIG_USB_EHCI_FSL
  314. #define CONFIG_USB_STORAGE
  315. #define CONFIG_HAS_FSL_DR_USB
  316. #endif
  317. /*
  318. * Environment Configuration
  319. */
  320. #if defined(CONFIG_TSEC_ENET)
  321. #define CONFIG_HAS_ETH0
  322. #endif
  323. #define CONFIG_HOSTNAME BSC9131rdb
  324. #define CONFIG_ROOTPATH "/opt/nfsroot"
  325. #define CONFIG_BOOTFILE "uImage"
  326. #define CONFIG_UBOOTPATH "u-boot.bin" /* U-Boot image on TFTP server */
  327. #define CONFIG_BAUDRATE 115200
  328. #define CONFIG_EXTRA_ENV_SETTINGS \
  329. "netdev=eth0\0" \
  330. "uboot=" CONFIG_UBOOTPATH "\0" \
  331. "loadaddr=1000000\0" \
  332. "bootfile=uImage\0" \
  333. "consoledev=ttyS0\0" \
  334. "ramdiskaddr=2000000\0" \
  335. "ramdiskfile=rootfs.ext2.gz.uboot\0" \
  336. "fdtaddr=c00000\0" \
  337. "fdtfile=bsc9131rdb.dtb\0" \
  338. "bdev=sda1\0" \
  339. "hwconfig=usb1:dr_mode=host,phy_type=ulpi\0" \
  340. "othbootargs=ramdisk_size=600000 \0" \
  341. "usbext2boot=setenv bootargs root=/dev/ram rw " \
  342. "console=$consoledev,$baudrate $othbootargs; " \
  343. "usb start;" \
  344. "ext2load usb 0:4 $loadaddr $bootfile;" \
  345. "ext2load usb 0:4 $fdtaddr $fdtfile;" \
  346. "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;" \
  347. "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
  348. #define CONFIG_RAMBOOTCOMMAND \
  349. "setenv bootargs root=/dev/ram rw " \
  350. "console=$consoledev,$baudrate $othbootargs; " \
  351. "tftp $ramdiskaddr $ramdiskfile;" \
  352. "tftp $loadaddr $bootfile;" \
  353. "tftp $fdtaddr $fdtfile;" \
  354. "bootm $loadaddr $ramdiskaddr $fdtaddr"
  355. #define CONFIG_BOOTCOMMAND CONFIG_RAMBOOTCOMMAND
  356. #endif /* __CONFIG_H */