mpq101.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. /*
  2. * Copyright 2011 Alex Dubov <oakad@yahoo.com>
  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. * Merury Computers MPQ101 board configuration file
  24. *
  25. */
  26. #ifndef __CONFIG_H
  27. #define __CONFIG_H
  28. #ifdef CONFIG_36BIT
  29. # define CONFIG_PHYS_64BIT
  30. #endif
  31. /* High Level Configuration Options */
  32. #define CONFIG_BOOKE /* BOOKE */
  33. #define CONFIG_E500 /* BOOKE e500 family */
  34. #define CONFIG_MPC85xx /* MPC8540/60/55/41/48 */
  35. #define CONFIG_MPC8548 /* MPC8548 specific */
  36. #define CONFIG_MPQ101 /* MPQ101 board specific */
  37. #define CONFIG_SYS_SRIO /* enable serial RapidIO */
  38. #define CONFIG_TSEC_ENET /* tsec ethernet support */
  39. #define CONFIG_INTERRUPTS /* enable pci, srio, ddr interrupts */
  40. #define CONFIG_FSL_LAW /* Use common FSL init code */
  41. /*
  42. * These can be toggled for performance analysis, otherwise use default.
  43. */
  44. #define CONFIG_L2_CACHE /* toggle L2 cache */
  45. #define CONFIG_BTB /* toggle branch predition */
  46. #define CONFIG_PANIC_HANG
  47. /*
  48. * Only possible on E500 Version 2 or newer cores.
  49. */
  50. #define CONFIG_ENABLE_36BIT_PHYS
  51. #ifdef CONFIG_PHYS_64BIT
  52. # define CONFIG_ADDR_MAP
  53. # define CONFIG_SYS_NUM_ADDR_MAP 16 /* number of TLB1 entries */
  54. #endif
  55. #define CONFIG_SYS_CLK_FREQ 33000000 /* sysclk for MPC85xx */
  56. /*
  57. * Base addresses -- Note these are effective addresses where the
  58. * actual resources get mapped (not physical addresses)
  59. */
  60. #define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000
  61. #define CONFIG_SYS_CCSRBAR 0xe0000000
  62. #ifdef CONFIG_PHYS_64BIT
  63. # define CONFIG_SYS_CCSRBAR_PHYS 0xfe0000000ull
  64. #else
  65. # define CONFIG_SYS_CCSRBAR_PHYS CONFIG_SYS_CCSRBAR
  66. #endif
  67. #define CONFIG_SYS_IMMR CONFIG_SYS_CCSRBAR
  68. /* DDR Setup */
  69. #define CONFIG_FSL_DDR2
  70. #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER /* DDR controller or DMA? */
  71. #define CONFIG_MEM_INIT_VALUE 0xDeadBeef
  72. #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 /* DDR is system memory*/
  73. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
  74. #define CONFIG_NUM_DDR_CONTROLLERS 1
  75. #define CONFIG_DIMM_SLOTS_PER_CTLR 1
  76. #define CONFIG_CHIP_SELECTS_PER_CTRL (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
  77. /* Fixed 512MB DDR2 parameters */
  78. #define CONFIG_SYS_SDRAM_SIZE_LOG 29 /* DDR is 512MB */
  79. #define CONFIG_SYS_DDR_CS0_BNDS 0x0000001f
  80. #define CONFIG_SYS_DDR_CS0_CONFIG 0x80014102
  81. #define CONFIG_SYS_DDR_TIMING_3 0x00010000
  82. #define CONFIG_SYS_DDR_TIMING_0 0x00260802
  83. #define CONFIG_SYS_DDR_TIMING_1 0x5c47a432
  84. #define CONFIG_SYS_DDR_TIMING_1_PERF 0x49352322
  85. #define CONFIG_SYS_DDR_TIMING_2 0x03984cce
  86. #define CONFIG_SYS_DDR_TIMING_2_PERF 0x14904cca
  87. #define CONFIG_SYS_DDR_MODE_1 0x00400442
  88. #define CONFIG_SYS_DDR_MODE_1_PERF 0x00480432
  89. #define CONFIG_SYS_DDR_MODE_2 0x00000000
  90. #define CONFIG_SYS_DDR_MODE_2_PERF 0x00000000
  91. #define CONFIG_SYS_DDR_INTERVAL 0x08200100
  92. #define CONFIG_SYS_DDR_INTERVAL_PERF 0x06180100
  93. #define CONFIG_SYS_DDR_CLK_CTRL 0x03800000
  94. #define CONFIG_SYS_DDR_CONTROL 0xc3008000 /* Type = DDR2 */
  95. #define CONFIG_SYS_DDR_CONTROL2 0x04400000
  96. #define CONFIG_SYS_ALT_MEMTEST
  97. #define CONFIG_SYS_MEMTEST_START 0x0ff00000 /* memtest works on */
  98. #define CONFIG_SYS_MEMTEST_END 0x0ffffffc
  99. /*
  100. * RAM definitions
  101. */
  102. #define CONFIG_SYS_INIT_RAM_LOCK
  103. #define CONFIG_SYS_INIT_RAM_ADDR 0xe4010000 /* Initial RAM address */
  104. #define CONFIG_SYS_INIT_RAM_SIZE 0x4000 /* Size of used area in RAM */
  105. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE \
  106. - GENERATED_GBL_DATA_SIZE)
  107. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  108. #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */
  109. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc */
  110. /*
  111. * Local Bus Definitions
  112. */
  113. #define CONFIG_SYS_LBC_LCRR 0x00000004 /* LB clock ratio reg */
  114. #define CONFIG_SYS_LBC_LBCR 0x00000000 /* LB config reg */
  115. /*
  116. * FLASH on the Local Bus
  117. * One bank, 128M, using the CFI driver.
  118. */
  119. #define CONFIG_SYS_BOOT_BLOCK 0xf8000000 /* boot TLB block */
  120. #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_BOOT_BLOCK /* start of FLASH 128M */
  121. #ifdef CONFIG_PHYS_64BIT
  122. # define CONFIG_SYS_FLASH_BASE_PHYS 0xff8000000ull
  123. #else
  124. # define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE
  125. #endif
  126. /* 0xf8001801 */
  127. #define CONFIG_SYS_BR0_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) \
  128. | BR_PS_32 | BR_V)
  129. /* 0xf8006ff7 */
  130. #define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(128) | OR_GPCM_XAM | OR_GPCM_CSNT \
  131. | OR_GPCM_ACS_DIV2 | OR_GPCM_XACS \
  132. | OR_GPCM_SCY_15 | OR_GPCM_TRLX \
  133. | OR_GPCM_EHTR | OR_GPCM_EAD)
  134. #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS}
  135. #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
  136. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
  137. #define CONFIG_SYS_MAX_FLASH_SECT 512 /* sectors per device */
  138. #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
  139. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
  140. #define CONFIG_FLASH_CFI_DRIVER
  141. #define CONFIG_SYS_FLASH_CFI
  142. #define CONFIG_SYS_FLASH_EMPTY_INFO
  143. #define CONFIG_SYS_FLASH_AMD_CHECK_DQ7
  144. /*
  145. * When initializing flash, if we cannot find the manufacturer ID,
  146. * assume this is the AMD flash.
  147. */
  148. #define CONFIG_ASSUME_AMD_FLASH
  149. /*
  150. * Environment parameters
  151. */
  152. #define CONFIG_ENV_IS_IN_FLASH
  153. #define CONFIG_ENV_OVERWRITE
  154. #define CONFIG_SYS_USE_PPCENV
  155. #define ENV_IS_EMBEDDED
  156. #define CONFIG_ENV_SECT_SIZE 0x40000 /* 256K */
  157. #define CONFIG_ENV_SIZE 0x800
  158. /* Environment at the start of flash sector, before text. */
  159. #define CONFIG_ENV_ADDR (CONFIG_SYS_TEXT_BASE - CONFIG_ENV_SIZE)
  160. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  161. #define CONFIG_SYS_TEXT_BASE 0xfffc0800
  162. #define CONFIG_SYS_LDSCRIPT "board/mercury/mpq101/u-boot.lds"
  163. /*
  164. * Cypress CY7C67200 USB controller on the Local Bus.
  165. * Not supported by u-boot at present.
  166. */
  167. #define CONFIG_SYS_LBC_OPTION_BASE 0xf0000000
  168. #ifdef CONFIG_PHYS_64BIT
  169. # define CONFIG_SYS_LBC_OPTION_BASE_PHYS 0xff0000000ull
  170. #else
  171. # define CONFIG_SYS_LBC_OPTION_BASE_PHYS CONFIG_SYS_LBC_OPTION_BASE
  172. #endif
  173. /* 0xf0001001 */
  174. #define CONFIG_SYS_BR1_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_LBC_OPTION_BASE_PHYS) \
  175. | BR_PS_16 | BR_V)
  176. /* fffff002 */
  177. #define CONFIG_SYS_OR1_PRELIM (P2SZ_TO_AM(0x8000) | OR_GPCM_XAM \
  178. | OR_GPCM_BCTLD | OR_GPCM_EHTR)
  179. /*
  180. * Serial Ports
  181. */
  182. #define CONFIG_CONS_INDEX 2
  183. #define CONFIG_SYS_NS16550
  184. #define CONFIG_SYS_NS16550_SERIAL
  185. #define CONFIG_SYS_NS16550_REG_SIZE 1
  186. #define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
  187. #define CONFIG_SYS_BAUDRATE_TABLE {300, 600, 1200, 2400, 4800, 9600, \
  188. 19200, 38400, 115200}
  189. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR+0x4500)
  190. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x4600)
  191. /*
  192. * I2C buses and peripherals
  193. */
  194. #define CONFIG_FSL_I2C /* Use FSL common I2C driver */
  195. #define CONFIG_HARD_I2C /* I2C with hardware support*/
  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_OFFSET 0x3000
  200. #define CONFIG_SYS_I2C2_OFFSET 0x3100
  201. /* I2C RTC - M41T81 */
  202. #define CONFIG_RTC_M41T62
  203. #define CONFIG_SYS_I2C_RTC_ADDR 0x68
  204. #define CONFIG_SYS_M41T11_BASE_YEAR 2000
  205. /* I2C EEPROM - 24C256 */
  206. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
  207. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6
  208. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 12
  209. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  210. #define CONFIG_SYS_EEPROM_BUS_NUM 1
  211. /*
  212. * RapidIO MMU
  213. */
  214. #ifdef CONFIG_SYS_SRIO
  215. # define CONFIG_SRIO1
  216. # define CONFIG_SYS_SRIO1_MEM_VIRT 0xc0000000
  217. # define CONFIG_SYS_SRIO1_MEM_SIZE 0x20000000 /* 512M */
  218. # ifdef CONFIG_PHYS_64BIT
  219. # define CONFIG_SYS_SRIO1_MEM_PHYS 0xfc0000000ull
  220. # else
  221. # define CONFIG_SYS_SRIO1_MEM_PHYS CONFIG_SYS_SRIO1_MEM_VIRT
  222. # endif
  223. #endif
  224. /*
  225. * Ethernet
  226. */
  227. #ifdef CONFIG_TSEC_ENET
  228. # ifndef CONFIG_NET_MULTI
  229. # define CONFIG_NET_MULTI
  230. # endif
  231. # define CONFIG_MII /* MII PHY management */
  232. # define CONFIG_MII_DEFAULT_TSEC 1 /* Allow unregistered phys */
  233. # define CONFIG_TSEC1
  234. # define CONFIG_TSEC1_NAME "eTSEC0"
  235. # define TSEC1_PHY_ADDR 0x10
  236. # define TSEC1_PHYIDX 0
  237. # define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  238. # define CONFIG_TSEC2
  239. # define CONFIG_TSEC2_NAME "eTSEC1"
  240. # define TSEC2_PHY_ADDR 0x11
  241. # define TSEC2_PHYIDX 0
  242. # define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  243. # define CONFIG_TSEC3
  244. # define CONFIG_TSEC3_NAME "eTSEC2"
  245. # define TSEC3_PHY_ADDR 0x12
  246. # define TSEC3_PHYIDX 0
  247. # define TSEC3_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  248. # define CONFIG_TSEC4
  249. # define CONFIG_TSEC4_NAME "eTSEC3"
  250. # define TSEC4_PHY_ADDR 0x13
  251. # define TSEC4_PHYIDX 0
  252. # define TSEC4_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  253. /* Options are: eTSEC[0-3] */
  254. # define CONFIG_ETHPRIME "eTSEC0"
  255. # define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */
  256. #endif
  257. /*
  258. * Command line configuration.
  259. */
  260. #include <config_cmd_default.h>
  261. #define CONFIG_CMD_DATE
  262. #define CONFIG_CMD_DHCP
  263. #define CONFIG_CMD_PING
  264. #define CONFIG_CMD_SNTP
  265. #define CONFIG_CMD_I2C
  266. #define CONFIG_CMD_EEPROM
  267. #define CONFIG_CMD_MII
  268. #define CONFIG_CMD_ELF
  269. #define CONFIG_CMD_IRQ
  270. #define CONFIG_CMD_SETEXPR
  271. #define CONFIG_CMD_JFFS2
  272. /*
  273. * Miscellaneous configurable options
  274. */
  275. /* pass open firmware flat tree */
  276. #define CONFIG_OF_LIBFDT
  277. #define CONFIG_OF_BOARD_SETUP
  278. #define CONFIG_OF_STDOUT_VIA_ALIAS
  279. #define CONFIG_FIT /* new uImage format support */
  280. #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
  281. /* Use the HUSH parser */
  282. #define CONFIG_SYS_HUSH_PARSER
  283. #ifdef CONFIG_SYS_HUSH_PARSER
  284. # define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  285. #endif
  286. #define CONFIG_LOADS_ECHO /* echo on for serial download */
  287. #define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
  288. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  289. #define CONFIG_CMDLINE_EDITING /* Command-line editing */
  290. #define CONFIG_AUTO_COMPLETE /* add autocompletion support */
  291. #define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
  292. #define CONFIG_SYS_PROMPT "MPQ-101=> " /* Monitor Command Prompt */
  293. /* Console I/O Buffer Size */
  294. #ifdef CONFIG_CMD_KGDB
  295. # define CONFIG_SYS_CBSIZE 1024
  296. #else
  297. # define CONFIG_SYS_CBSIZE 256
  298. #endif
  299. /* Print Buffer Size */
  300. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)+16)
  301. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  302. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  303. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1ms ticks */
  304. /*
  305. * For booting Linux, the board info and command line data
  306. * have to be in the first 16 MB of memory, since this is
  307. * the maximum mapped by the Linux kernel during initialization.
  308. */
  309. #define CONFIG_SYS_BOOTMAPSZ (16 << 20) /* Initial Memory map for Linux*/
  310. #define CONFIG_SYS_BOOTM_LEN (16 << 20) /* Increase max gunzip size */
  311. #ifdef CONFIG_CMD_KGDB
  312. # define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  313. # define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  314. #endif
  315. /*
  316. * Basic Environment Configuration
  317. */
  318. #define CONFIG_BAUDRATE 115200
  319. #define CONFIG_BOOTDELAY 5 /* -1 disables auto-boot */
  320. /*default location for tftp and bootm*/
  321. #define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
  322. #endif /* __CONFIG_H */