mcu25.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. /*
  2. *(C) Copyright 2005-2007 Netstal Maschinen AG
  3. * Niklaus Giger (Niklaus.Giger@netstal.com)
  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. /************************************************************************
  24. * mcu25.h - configuration for MCU25 board (similar to hcu4.h)
  25. ***********************************************************************/
  26. #ifndef __CONFIG_H
  27. #define __CONFIG_H
  28. /*-----------------------------------------------------------------------
  29. * High Level Configuration Options
  30. *----------------------------------------------------------------------*/
  31. #define CONFIG_MCU25 1 /* Board is MCU25 */
  32. #define CONFIG_4xx 1 /* ... PPC4xx family */
  33. #define CONFIG_405GP 1
  34. #define CONFIG_4xx 1
  35. #define CONFIG_SYS_CLK_FREQ 33333333 /* external freq to pll */
  36. #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */
  37. #define CONFIG_MISC_INIT_R 1 /* Call misc_init_r */
  38. /*-----------------------------------------------------------------------
  39. * Base addresses -- Note these are effective addresses where the
  40. * actual resources get mapped (not physical addresses)
  41. *----------------------------------------------------------------------*/
  42. #define CFG_MONITOR_LEN (320 * 1024) /* Reserve 320 kB for Monitor */
  43. #define CFG_MALLOC_LEN (256 * 1024) /* Reserve 256 kB for malloc() */
  44. #define CFG_SDRAM_BASE 0x00000000 /* _must_ be 0 */
  45. #define CFG_FLASH_BASE 0xfff80000 /* start of FLASH */
  46. #define CFG_MONITOR_BASE TEXT_BASE
  47. /* ... with on-chip memory here (4KBytes) */
  48. #define CFG_OCM_DATA_ADDR 0xF4000000
  49. #define CFG_OCM_DATA_SIZE 0x00001000
  50. /* Do not set up locked dcache as init ram. */
  51. #undef CFG_INIT_DCACHE_CS
  52. /* Use the On-Chip-Memory (OCM) as a temporary stack for the startup code. */
  53. #define CFG_TEMP_STACK_OCM 1
  54. #define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* OCM */
  55. #define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE
  56. #define CFG_GBL_DATA_SIZE 256 /* num bytes initial data */
  57. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  58. #define CFG_INIT_SP_OFFSET CFG_POST_WORD_ADDR
  59. /*-----------------------------------------------------------------------
  60. * Serial Port
  61. *----------------------------------------------------------------------*/
  62. /*
  63. * If CFG_EXT_SERIAL_CLOCK, then the UART divisor is 1.
  64. * If CFG_405_UART_ERRATA_59, then UART divisor is 31.
  65. * Otherwise, UART divisor is determined by CPU Clock and CFG_BASE_BAUD value.
  66. * The Linux BASE_BAUD define should match this configuration.
  67. * baseBaud = cpuClock/(uartDivisor*16)
  68. * If CFG_405_UART_ERRATA_59 and 200MHz CPU clock,
  69. * set Linux BASE_BAUD to 403200.
  70. */
  71. #undef CFG_EXT_SERIAL_CLOCK /* external serial clock */
  72. #define CONFIG_SERIAL_MULTI 1
  73. /* needed to be able to define CONFIG_SERIAL_SOFTWARE_FIFO */
  74. #undef CFG_405_UART_ERRATA_59 /* 405GP/CR Rev. D silicon */
  75. #define CFG_BASE_BAUD 691200
  76. /* Size (bytes) of interrupt driven serial port buffer.
  77. * Set to 0 to use polling instead of interrupts.
  78. * Setting to 0 will also disable RTS/CTS handshaking.
  79. */
  80. #undef CONFIG_SERIAL_SOFTWARE_FIFO
  81. /* Set console baudrate to 9600 */
  82. #define CONFIG_BAUDRATE 9600
  83. #define CFG_BAUDRATE_TABLE \
  84. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
  85. /*-----------------------------------------------------------------------
  86. * Flash
  87. *----------------------------------------------------------------------*/
  88. /* Use common CFI driver */
  89. #define CFG_FLASH_CFI
  90. #define CONFIG_FLASH_CFI_DRIVER
  91. /* board provides its own flash_init code */
  92. #define CONFIG_FLASH_CFI_LEGACY 1
  93. #define CFG_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  94. #define CFG_FLASH_LEGACY_512Kx8 1
  95. /* print 'E' for empty sector on flinfo */
  96. #define CFG_FLASH_EMPTY_INFO
  97. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  98. #define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  99. /*-----------------------------------------------------------------------
  100. * Environment
  101. *----------------------------------------------------------------------*/
  102. #undef CONFIG_ENV_IS_IN_NVRAM
  103. #define CFG_ENV_IS_IN_FLASH
  104. #undef CONFIG_ENV_IS_NOWHERE
  105. #ifdef CONFIG_ENV_IS_IN_EEPROM
  106. /* Put the environment after the SDRAM configuration */
  107. #define PROM_SIZE 2048
  108. #define CFG_ENV_OFFSET 512
  109. #define CFG_ENV_SIZE (PROM_SIZE-CFG_ENV_OFFSET)
  110. #endif
  111. #ifdef CFG_ENV_IS_IN_FLASH
  112. /* Put the environment in Flash */
  113. #define CFG_ENV_SECT_SIZE 0x10000 /* size of one complete sector */
  114. #define CFG_ENV_ADDR ((-CFG_MONITOR_LEN)-CFG_ENV_SECT_SIZE)
  115. #define CFG_ENV_SIZE 8*1024 /* 8 KB Environment Sector */
  116. /* Address and size of Redundant Environment Sector */
  117. #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)
  118. #define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
  119. #endif
  120. /*-----------------------------------------------------------------------
  121. * I2C stuff for a ATMEL AT24C16 (2kB holding ENV, we are using the
  122. * the first internal I2C controller of the PPC440EPx
  123. *----------------------------------------------------------------------*/
  124. #define CFG_SPD_BUS_NUM 0
  125. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  126. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  127. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address */
  128. #define CFG_I2C_SLAVE 0x7F
  129. /* This is the 7bit address of the device, not including P. */
  130. #define CFG_I2C_EEPROM_ADDR 0x50
  131. #define CFG_I2C_EEPROM_ADDR_LEN 1
  132. /* The EEPROM can do 16byte ( 1 << 4 ) page writes. */
  133. #define CFG_I2C_EEPROM_ADDR_OVERFLOW 0x07
  134. #define CFG_EEPROM_PAGE_WRITE_BITS 4
  135. #define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10
  136. #define CFG_EEPROM_PAGE_WRITE_ENABLE
  137. #undef CFG_I2C_MULTI_EEPROMS
  138. #define CONFIG_PREBOOT "echo;" \
  139. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  140. "echo"
  141. #undef CONFIG_BOOTARGS
  142. /* Setup some board specific values for the default environment variables */
  143. #define CONFIG_HOSTNAME mcu25
  144. #define CONFIG_IPADDR 172.25.1.99
  145. #define CONFIG_ETHADDR 00:60:13:00:00:00 /* Netstal Machines AG MAC */
  146. #define CONFIG_OVERWRITE_ETHADDR_ONCE
  147. #define CONFIG_SERVERIP 172.25.1.3
  148. #define CFG_TFTP_LOADADDR 0x01000000 /* @16 MB */
  149. #define CONFIG_EXTRA_ENV_SETTINGS \
  150. "netdev=eth0\0" \
  151. "loadaddr=0x01000000\0" \
  152. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  153. "nfsroot=${serverip}:${rootpath}\0" \
  154. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  155. "addip=setenv bootargs ${bootargs} " \
  156. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  157. ":${hostname}:${netdev}:off panic=1\0" \
  158. "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
  159. "nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;" \
  160. "bootm\0" \
  161. "rootpath=/home/diagnose/eldk/ppc_4xx\0" \
  162. "bootfile=/tftpboot/mcu25/uImage\0" \
  163. "load=tftp 100000 mcu25/u-boot.bin\0" \
  164. "update=protect off FFFB0000 FFFFFFFF;era FFFB0000 FFFFFFFF;" \
  165. "cp.b 100000 FFFB0000 50000\0" \
  166. "upd=run load;run update\0" \
  167. "vx_rom=mcu25/mcu25_vx_rom\0" \
  168. "vx=tftp ${loadaddr} ${vx_rom};run vxargs; bootvx\0" \
  169. "vxargs=setenv bootargs emac(0,0)c:${vx_rom} e=${ipaddr}" \
  170. " h=${serverip} u=dpu pw=netstal8752 tn=hcu5 f=0x3008\0" \
  171. ""
  172. #define CONFIG_BOOTCOMMAND "run vx"
  173. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  174. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  175. #define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  176. #define CONFIG_MII 1 /* MII PHY management */
  177. #define CONFIG_PHY_ADDR 1 /* PHY address */
  178. #define CONFIG_PHY_RESET 1 /* reset phy upon startup */
  179. #define CONFIG_HAS_ETH0
  180. #define CFG_RX_ETH_BUFFER 16 /* Number of ethernet rx buffers & descr */
  181. /*
  182. * BOOTP options
  183. */
  184. #define CONFIG_BOOTP_BOOTFILESIZE
  185. #define CONFIG_BOOTP_BOOTPATH
  186. #define CONFIG_BOOTP_GATEWAY
  187. #define CONFIG_BOOTP_HOSTNAME
  188. /*
  189. * Command line configuration.
  190. */
  191. #include <config_cmd_default.h>
  192. #define CONFIG_CMD_ASKENV
  193. #define CONFIG_CMD_CACHE
  194. #define CONFIG_CMD_DHCP
  195. #define CONFIG_CMD_DIAG
  196. #define CONFIG_CMD_EEPROM
  197. #define CONFIG_CMD_ELF
  198. #define CONFIG_CMD_FLASH
  199. #define CONFIG_CMD_I2C
  200. #define CONFIG_CMD_IMMAP
  201. #define CONFIG_CMD_IRQ
  202. #define CONFIG_CMD_MII
  203. #define CONFIG_CMD_NET
  204. #define CONFIG_CMD_PING
  205. #define CONFIG_CMD_REGINFO
  206. #define CONFIG_CMD_SDRAM
  207. /* SPD EEPROM (sdram speed config) disabled */
  208. #define CONFIG_SPD_EEPROM 1
  209. #define SPD_EEPROM_ADDRESS 0x50
  210. /* POST support */
  211. #define CONFIG_POST (CFG_POST_MEMORY | \
  212. CFG_POST_CPU | \
  213. CFG_POST_UART | \
  214. CFG_POST_I2C | \
  215. CFG_POST_CACHE | \
  216. CFG_POST_ETHER | \
  217. CFG_POST_SPR)
  218. #define CFG_POST_UART_TABLE {UART0_BASE}
  219. #define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 0x4)
  220. #undef CONFIG_LOGBUFFER
  221. #define CFG_POST_CACHE_ADDR 0x00800000 /* free virtual address */
  222. #define CFG_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
  223. /*-----------------------------------------------------------------------
  224. * Miscellaneous configurable options
  225. *----------------------------------------------------------------------*/
  226. #define CFG_LONGHELP /* undef to save memory */
  227. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  228. #if defined(CONFIG_CMD_KGDB)
  229. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  230. #else
  231. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  232. #endif
  233. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  234. #define CFG_MAXARGS 16 /* max number of command args */
  235. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  236. #define CFG_MEMTEST_START 0x0400000 /* memtest works on */
  237. #define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  238. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  239. #define CFG_EXTBDINFO 1 /* To use extended board_into (bd_t) */
  240. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  241. #define CONFIG_CMDLINE_EDITING 1 /* add command line history */
  242. #define CONFIG_LOOPW 1 /* enable loopw command */
  243. #define CONFIG_VERSION_VARIABLE 1 /* include version env variable */
  244. /*-----------------------------------------------------------------------
  245. * External Bus Controller (EBC) Setup
  246. */
  247. #define CFG_EBC_CFG 0x98400000
  248. /* Memory Bank 0 (Flash Bank 0) initialization */
  249. #define CFG_EBC_PB0AP 0x02005400
  250. #define CFG_EBC_PB0CR 0xFFF18000 /* BAS=0xFFF,BS=1MB,BU=R/W,BW=8bit*/
  251. #define CFG_EBC_PB1AP 0x03041200
  252. #define CFG_EBC_PB1CR 0x7009A000 /* BAS=,BS=MB,BU=R/W,BW=bit */
  253. #define CFG_EBC_PB2AP 0x01845200u /* BAS=,BS=MB,BU=R/W,BW=bit */
  254. #define CFG_EBC_PB2CR 0x7A09A000u
  255. #define CFG_EBC_PB3AP 0x01845200u /* BAS=,BS=MB,BU=R/W,BW=bit */
  256. #define CFG_EBC_PB3CR 0x7B09A000u
  257. #define CFG_EBC_PB4AP 0x01845200u /* BAS=,BS=MB,BU=R/W,BW=bit */
  258. #define CFG_EBC_PB4CR 0x7C09A000u
  259. #define CFG_EBC_PB5AP 0x00800200u
  260. #define CFG_EBC_PB5CR 0x7D81A000u
  261. #define CFG_EBC_PB6AP 0x01040200u
  262. #define CFG_EBC_PB6CR 0x7D91A000u
  263. #define CFG_GPIO0_OR 0x087FFFFF /* GPIO value */
  264. #define CFG_GPIO0_TCR 0x7FFF8000 /* GPIO value */
  265. #define CFG_GPIO0_ODR 0xFFFF0000 /* GPIO value */
  266. /*
  267. * For booting Linux, the board info and command line data
  268. * have to be in the first 8 MB of memory, since this is
  269. * the maximum mapped by the Linux kernel during initialization.
  270. */
  271. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  272. /* Init Memory Controller:
  273. *
  274. * BR0/1 and OR0/1 (FLASH)
  275. */
  276. #define FLASH_BASE0_PRELIM CFG_FLASH_BASE /* FLASH bank #0 */
  277. #define FLASH_BASE1_PRELIM 0 /* FLASH bank #1 */
  278. /* Configuration Port location */
  279. #define CONFIG_PORT_ADDR 0xF0000500
  280. #define CFG_HUSH_PARSER /* use "hush" command parser */
  281. #ifdef CFG_HUSH_PARSER
  282. #define CFG_PROMPT_HUSH_PS2 "> "
  283. #endif
  284. #if defined(CONFIG_CMD_KGDB)
  285. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  286. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  287. #endif
  288. /* pass open firmware flat tree */
  289. #define CONFIG_OF_LIBFDT 1
  290. #define CONFIG_OF_BOARD_SETUP 1
  291. #endif /* __CONFIG_H */