mcc200.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. /*
  2. * (C) Copyright 2006
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef __CONFIG_H
  24. #define __CONFIG_H
  25. /*
  26. * High Level Configuration Options
  27. * (easy to change)
  28. */
  29. #define CONFIG_MPC5200
  30. #define CONFIG_MPC5xxx 1 /* This is an MPC5xxx CPU */
  31. #define CONFIG_MCC200 1 /* ... on MCC200 board */
  32. #define CFG_MPC5XXX_CLKIN 33000000 /* ... running at 33MHz */
  33. #define CONFIG_MISC_INIT_R
  34. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  35. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  36. #define CFG_CACHELINE_SIZE 32 /* For MPC5xxx CPUs */
  37. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  38. # define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
  39. #endif
  40. /*
  41. * Serial console configuration
  42. *
  43. * To select console on the one of 8 external UARTs,
  44. * define CONFIG_QUART_CONSOLE as 1, 2, 3, or 4 for the first Quad UART,
  45. * or as 5, 6, 7, or 8 for the second Quad UART.
  46. * COM11, COM12, COM13, COM14 are located on the second Quad UART.
  47. *
  48. * CONFIG_PSC_CONSOLE must be undefined in this case.
  49. */
  50. #if !defined(CONFIG_PRS200)
  51. /* MCC200 configuration: */
  52. #ifdef CONFIG_CONSOLE_COM12
  53. #define CONFIG_QUART_CONSOLE 6 /* console is on UARTF of QUART2 */
  54. #else
  55. #define CONFIG_QUART_CONSOLE 8 /* console is on UARTH of QUART2 */
  56. #endif
  57. #else
  58. /* PRS200 configuration: */
  59. #undef CONFIG_QUART_CONSOLE
  60. #endif /* CONFIG_PRS200 */
  61. /*
  62. * To select console on PSC1, define CONFIG_PSC_CONSOLE as 1
  63. * and undefine CONFIG_QUART_CONSOLE.
  64. */
  65. #if !defined(CONFIG_PRS200)
  66. /* MCC200 configuration: */
  67. #undef CONFIG_PSC_CONSOLE
  68. #else
  69. /* PRS200 configuration: */
  70. #define CONFIG_PSC_CONSOLE 1 /* console is on PSC1 */
  71. #endif
  72. #if defined(CONFIG_QUART_CONSOLE) && defined(CONFIG_PSC_CONSOLE)
  73. #error "Select only one console device!"
  74. #endif
  75. #define CONFIG_BAUDRATE 115200
  76. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  77. #define CONFIG_MII 1
  78. #define CONFIG_DOS_PARTITION
  79. /* USB */
  80. #define CONFIG_USB_OHCI
  81. #define ADD_USB_CMD CFG_CMD_USB | CFG_CMD_FAT
  82. #define CONFIG_USB_STORAGE
  83. /*
  84. * Supported commands
  85. */
  86. #define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
  87. ADD_USB_CMD | \
  88. CFG_CMD_BEDBUG | \
  89. CFG_CMD_FAT | \
  90. CFG_CMD_I2C)
  91. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  92. #include <cmd_confdefs.h>
  93. /*
  94. * Autobooting
  95. */
  96. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  97. #define CONFIG_PREBOOT "echo;" \
  98. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  99. "echo"
  100. #undef CONFIG_BOOTARGS
  101. #define XMK_STR(x) #x
  102. #define MK_STR(x) XMK_STR(x)
  103. #ifdef CONFIG_PRS200
  104. # define CFG__BOARDNAME "prs200"
  105. #else
  106. # define CFG__BOARDNAME "mcc200"
  107. #endif
  108. #define CONFIG_EXTRA_ENV_SETTINGS \
  109. "netdev=eth0\0" \
  110. "hostname=" CFG__BOARDNAME "\0" \
  111. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  112. "nfsroot=${serverip}:${rootpath}\0" \
  113. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  114. "addip=setenv bootargs ${bootargs} " \
  115. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  116. ":${hostname}:${netdev}:off panic=1\0" \
  117. "addcons=etenv bootargs ${bootargs} " \
  118. "console=${console},${baudrate}\0" \
  119. "flash_nfs=run nfsargs addip addcons;" \
  120. "bootm ${kernel_addr}\0" \
  121. "flash_self=run ramargs addip addcons;" \
  122. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  123. "net_nfs=tftp 200000 ${bootfile};" \
  124. "run nfsargs addip addcons;bootm\0" \
  125. "console=ttyS0\0" \
  126. "rootpath=/opt/eldk/ppc_6xx\0" \
  127. "bootfile=/tftpboot/" CFG__BOARDNAME "/uImage\0" \
  128. "load=tftp 200000 /tftpboot/" CFG__BOARDNAME "/u-boot.bin\0" \
  129. "text_base=" MK_STR(TEXT_BASE) "\0" \
  130. "update=protect off ${text_base} +${filesize};" \
  131. "era ${text_base} +${filesize};" \
  132. "cp.b 200000 ${text_base} ${filesize}\0" \
  133. "unlock=yes\0" \
  134. ""
  135. #undef MK_STR
  136. #undef XMK_STR
  137. #define CONFIG_BOOTCOMMAND "run flash_self"
  138. #define CFG_HUSH_PARSER 1 /* use "hush" command parser */
  139. #define CFG_PROMPT_HUSH_PS2 "> "
  140. /*
  141. * IPB Bus clocking configuration.
  142. */
  143. #define CFG_IPBSPEED_133 /* define for 133MHz speed */
  144. /*
  145. * I2C configuration
  146. */
  147. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  148. #define CFG_I2C_MODULE 1 /* Select I2C module #1 or #2 */
  149. #define CFG_I2C_SPEED 100000 /* 100 kHz */
  150. #define CFG_I2C_SLAVE 0x7F
  151. /*
  152. * Flash configuration (8,16 or 32 MB)
  153. * TEXT base always at 0xFFF00000
  154. * ENV_ADDR always at 0xFFF40000
  155. * FLASH_BASE at 0xFC000000 for 64 MB (only 32MB are supported, not enough addr lines!!!)
  156. * 0xFE000000 for 32 MB
  157. * 0xFF000000 for 16 MB
  158. * 0xFF800000 for 8 MB
  159. */
  160. #define CFG_FLASH_BASE 0xfc000000
  161. #define CFG_FLASH_SIZE 0x04000000
  162. #define CFG_FLASH_CFI /* The flash is CFI compatible */
  163. #define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */
  164. #define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE }
  165. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  166. #define CFG_MAX_FLASH_SECT 512 /* max number of sectors on one chip */
  167. #define CFG_FLASH_USE_BUFFER_WRITE 1 /* use buffered writes (20x faster) */
  168. #define CFG_FLASH_PROTECTION 1 /* hardware flash protection */
  169. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  170. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  171. #define CFG_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */
  172. #define CFG_FLASH_QUIET_TEST 1 /* don't warn upon unknown flash */
  173. #define CFG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */
  174. #define CFG_ENV_SECT_SIZE 0x40000 /* size of one complete sector */
  175. #define CFG_ENV_ADDR (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
  176. #define CFG_ENV_SIZE 0x2000 /* Total Size of Environment Sector */
  177. /* Address and size of Redundant Environment Sector */
  178. #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
  179. #define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  180. #define CONFIG_ENV_OVERWRITE 1 /* allow modification of vendor params */
  181. #if TEXT_BASE == CFG_FLASH_BASE
  182. #define CFG_LOWBOOT 1
  183. #endif
  184. /*
  185. * Memory map
  186. */
  187. #define CFG_MBAR 0xf0000000
  188. #define CFG_SDRAM_BASE 0x00000000
  189. #define CFG_DEFAULT_MBAR 0x80000000
  190. /* Use SRAM until RAM will be available */
  191. #define CFG_INIT_RAM_ADDR MPC5XXX_SRAM
  192. #define CFG_INIT_RAM_END MPC5XXX_SRAM_SIZE /* End of used area in DPRAM */
  193. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  194. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  195. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  196. #define CFG_MONITOR_BASE TEXT_BASE
  197. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  198. # define CFG_RAMBOOT 1
  199. #endif
  200. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  201. #define CFG_MALLOC_LEN (512 << 10) /* Reserve 512 kB for malloc() */
  202. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  203. /*
  204. * Ethernet configuration
  205. */
  206. #define CONFIG_MPC5xxx_FEC 1
  207. /*
  208. * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
  209. */
  210. /* #define CONFIG_FEC_10MBIT 1 */
  211. #define CONFIG_PHY_ADDR 1
  212. /*
  213. * GPIO configuration
  214. */
  215. /* 0x10000004 = 32MB SDRAM */
  216. /* 0x90000004 = 64MB SDRAM */
  217. #define CFG_GPS_PORT_CONFIG 0x00000004
  218. /*
  219. * Miscellaneous configurable options
  220. */
  221. #define CFG_LONGHELP /* undef to save memory */
  222. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  223. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  224. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  225. #else
  226. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  227. #endif
  228. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  229. #define CFG_MAXARGS 16 /* max number of command args */
  230. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  231. #define CFG_MEMTEST_START 0x00100000 /* memtest works on */
  232. #define CFG_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  233. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  234. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  235. /*
  236. * Various low-level settings
  237. */
  238. #define CFG_HID0_INIT HID0_ICE | HID0_ICFI
  239. #define CFG_HID0_FINAL HID0_ICE
  240. #define CFG_BOOTCS_START CFG_FLASH_BASE
  241. #define CFG_BOOTCS_SIZE CFG_FLASH_SIZE
  242. #define CFG_BOOTCS_CFG 0x0004fb00
  243. #define CFG_CS0_START CFG_FLASH_BASE
  244. #define CFG_CS0_SIZE CFG_FLASH_SIZE
  245. /* Quad UART @0x80000000 (MBAR is relocated to 0xF0000000) */
  246. #define CFG_CS2_START 0x80000000
  247. #define CFG_CS2_SIZE 0x00001000
  248. #define CFG_CS2_CFG 0x1d300
  249. /* Second Quad UART @0x80010000 */
  250. #define CFG_CS1_START 0x80010000
  251. #define CFG_CS1_SIZE 0x00001000
  252. #define CFG_CS1_CFG 0x1d300
  253. /*
  254. * Select one of quarts as a default
  255. * console. If undefined - PSC console
  256. * wil be default
  257. */
  258. #define CFG_CS_BURST 0x00000000
  259. #define CFG_CS_DEADCYCLE 0x33333333
  260. #define CFG_RESET_ADDRESS 0xff000000
  261. /*
  262. * QUART Expanders support
  263. */
  264. #if defined(CONFIG_QUART_CONSOLE)
  265. /*
  266. * We'll use NS16550 chip routines,
  267. */
  268. #define CFG_NS16550 1
  269. #define CFG_NS16550_SERIAL 1
  270. #define CONFIG_CONS_INDEX 1
  271. /*
  272. * To achieve necessary offset on SC16C554
  273. * A0-A2 (register select) pins with NS16550
  274. * functions (in struct NS16550), REG_SIZE
  275. * should be 4, because A0-A2 pins are connected
  276. * to DA2-DA4 address bus lines.
  277. */
  278. #define CFG_NS16550_REG_SIZE 4
  279. /*
  280. * LocalPlus Bus already inited in cpu_init_f(),
  281. * so can work with QUART's chip selects.
  282. * One of four SC16C554 UARTs is selected with
  283. * A3-A4 (DA5-DA6) lines.
  284. */
  285. #if (CONFIG_QUART_CONSOLE > 0) && (CONFIG_QUART_CONSOLE < 5) && !defined(CONFIG_PRS200)
  286. #define CFG_NS16550_COM1 (CFG_CS2_START | (CONFIG_QUART_CONSOLE - 1)<<5)
  287. #elif (CONFIG_QUART_CONSOLE > 4) && (CONFIG_QUART_CONSOLE < 9)
  288. #define CFG_NS16550_COM1 (CFG_CS1_START | (CONFIG_QUART_CONSOLE - 5)<<5)
  289. #elif
  290. #error "Wrong QUART expander number."
  291. #endif
  292. /*
  293. * SC16C554 chip's external crystal oscillator frequency
  294. * is 7.3728 MHz
  295. */
  296. #define CFG_NS16550_CLK 7372800
  297. #endif /* CONFIG_QUART_CONSOLE */
  298. /*-----------------------------------------------------------------------
  299. * USB stuff
  300. *-----------------------------------------------------------------------
  301. */
  302. #define CONFIG_USB_CLOCK 0x0001BBBB
  303. #define CONFIG_USB_CONFIG 0x00005000
  304. #endif /* __CONFIG_H */