hcu4.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /*
  2. *(C) Copyright 2005-2008 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. * hcu4.h - configuration for HCU4 board (similar to hcu5.h)
  25. ***********************************************************************/
  26. #ifndef __CONFIG_H
  27. #define __CONFIG_H
  28. /*-----------------------------------------------------------------------
  29. * High Level Configuration Options
  30. *----------------------------------------------------------------------*/
  31. #define CONFIG_HCU4 1 /* Board is HCU4 */
  32. #define CONFIG_4xx 1 /* ... PPC4xx family */
  33. #define CONFIG_405GP 1
  34. #define CONFIG_4xx 1
  35. #define CONFIG_HOSTNAME hcu4
  36. #define CONFIG_SYS_TEXT_BASE 0xFFFB0000
  37. /*
  38. * Include common defines/options for all boards produced by Netstal Maschinen
  39. */
  40. #include "netstal-common.h"
  41. #define CONFIG_SYS_CLK_FREQ 33333333 /* external freq to pll */
  42. #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */
  43. #define CONFIG_MISC_INIT_R 1 /* Call misc_init_r */
  44. /*-----------------------------------------------------------------------
  45. * Base addresses -- Note these are effective addresses where the
  46. * actual resources get mapped (not physical addresses)
  47. *----------------------------------------------------------------------*/
  48. #define CONFIG_SYS_MONITOR_LEN (320 * 1024) /* Reserve 320 kB for Monitor */
  49. #define CONFIG_SYS_MALLOC_LEN (256 * 1024) /* Reserve 256 kB for malloc() */
  50. #define CONFIG_SYS_SDRAM_BASE 0x00000000 /* _must_ be 0 */
  51. #define CONFIG_SYS_FLASH_BASE 0xfff80000 /* start of FLASH */
  52. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  53. /* ... with on-chip memory here (4KBytes) */
  54. #define CONFIG_SYS_OCM_DATA_ADDR 0xF4000000
  55. #define CONFIG_SYS_OCM_DATA_SIZE 0x00001000
  56. /* Do not set up locked dcache as init ram. */
  57. #undef CONFIG_SYS_INIT_DCACHE_CS
  58. /* Use the On-Chip-Memory (OCM) as a temporary stack for the startup code. */
  59. #define CONFIG_SYS_TEMP_STACK_OCM 1
  60. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_OCM_DATA_ADDR /* OCM */
  61. #define CONFIG_SYS_INIT_RAM_SIZE CONFIG_SYS_OCM_DATA_SIZE
  62. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  63. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
  64. /*-----------------------------------------------------------------------
  65. * Serial Port
  66. *----------------------------------------------------------------------*/
  67. /*
  68. * If CONFIG_SYS_EXT_SERIAL_CLOCK, then the UART divisor is 1.
  69. * If CONFIG_SYS_405_UART_ERRATA_59, then UART divisor is 31.
  70. * Otherwise, UART divisor is determined by CPU Clock and CONFIG_SYS_BASE_BAUD value.
  71. * The Linux BASE_BAUD define should match this configuration.
  72. * baseBaud = cpuClock/(uartDivisor*16)
  73. * If CONFIG_SYS_405_UART_ERRATA_59 and 200MHz CPU clock,
  74. * set Linux BASE_BAUD to 403200.
  75. */
  76. #undef CONFIG_SYS_405_UART_ERRATA_59 /* 405GP/CR Rev. D silicon */
  77. #define CONFIG_SYS_BASE_BAUD 691200
  78. /* Set console baudrate to 9600 */
  79. #define CONFIG_BAUDRATE 9600
  80. /*-----------------------------------------------------------------------
  81. * Flash
  82. *----------------------------------------------------------------------*/
  83. /* Use common CFI driver */
  84. #define CONFIG_SYS_FLASH_CFI
  85. #define CONFIG_FLASH_CFI_DRIVER
  86. /* board provides its own flash_init code */
  87. #define CONFIG_FLASH_CFI_LEGACY 1
  88. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  89. #define CONFIG_SYS_FLASH_LEGACY_512Kx8 1
  90. /* print 'E' for empty sector on flinfo */
  91. #define CONFIG_SYS_FLASH_EMPTY_INFO
  92. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
  93. #define CONFIG_SYS_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  94. /*-----------------------------------------------------------------------
  95. * Environment
  96. *----------------------------------------------------------------------*/
  97. #undef CONFIG_ENV_IS_IN_NVRAM
  98. #define CONFIG_ENV_IS_IN_FLASH
  99. #undef CONFIG_ENV_IS_NOWHERE
  100. #ifdef CONFIG_ENV_IS_IN_EEPROM
  101. /* Put the environment after the SDRAM configuration */
  102. #define PROM_SIZE 2048
  103. #define CONFIG_ENV_OFFSET 512
  104. #define CONFIG_ENV_SIZE (PROM_SIZE-CONFIG_ENV_OFFSET)
  105. #endif
  106. #ifdef CONFIG_ENV_IS_IN_FLASH
  107. /* Put the environment in Flash */
  108. #define CONFIG_ENV_SECT_SIZE 0x10000 /* size of one complete sector */
  109. #define CONFIG_ENV_ADDR ((-CONFIG_SYS_MONITOR_LEN)-CONFIG_ENV_SECT_SIZE)
  110. #define CONFIG_ENV_SIZE 8*1024 /* 8 KB Environment Sector */
  111. /* Address and size of Redundant Environment Sector */
  112. #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR-CONFIG_ENV_SECT_SIZE)
  113. #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
  114. #endif
  115. /*-----------------------------------------------------------------------
  116. * I2C stuff for a ATMEL AT24C16 (2kB holding ENV, we are using the
  117. * the first internal I2C controller of the PPC440EPx
  118. *----------------------------------------------------------------------*/
  119. #define CONFIG_SYS_SPD_BUS_NUM 0
  120. #define CONFIG_IPADDR 172.25.1.14
  121. #define CONFIG_EXTRA_ENV_SETTINGS \
  122. CONFIG_NETSTAL_DEF_ENV \
  123. CONFIG_NETSTAL_DEF_ENV_POWERPC \
  124. ""
  125. /*
  126. * BOOTP options
  127. */
  128. #define CONFIG_BOOTP_BOOTFILESIZE
  129. #define CONFIG_BOOTP_BOOTPATH
  130. #define CONFIG_BOOTP_GATEWAY
  131. #define CONFIG_BOOTP_HOSTNAME
  132. /*
  133. * Command line configuration.
  134. */
  135. #include <config_cmd_default.h>
  136. #define CONFIG_CMD_ASKENV
  137. #define CONFIG_CMD_CACHE
  138. #define CONFIG_CMD_DHCP
  139. #define CONFIG_CMD_DIAG
  140. #define CONFIG_CMD_EEPROM
  141. #define CONFIG_CMD_ELF
  142. #define CONFIG_CMD_FLASH
  143. #define CONFIG_CMD_I2C
  144. #define CONFIG_CMD_IMMAP
  145. #define CONFIG_CMD_IRQ
  146. #define CONFIG_CMD_MII
  147. #define CONFIG_CMD_NET
  148. #define CONFIG_CMD_PING
  149. #define CONFIG_CMD_REGINFO
  150. #define CONFIG_CMD_SDRAM
  151. /* SPD EEPROM (sdram speed config) disabled */
  152. #define CONFIG_SPD_EEPROM 1
  153. #define SPD_EEPROM_ADDRESS 0x50
  154. /* POST support */
  155. #define CONFIG_POST (CONFIG_SYS_POST_MEMORY | \
  156. CONFIG_SYS_POST_CPU | \
  157. CONFIG_SYS_POST_UART | \
  158. CONFIG_SYS_POST_I2C | \
  159. CONFIG_SYS_POST_CACHE | \
  160. CONFIG_SYS_POST_ETHER | \
  161. CONFIG_SYS_POST_SPR)
  162. #define CONFIG_SYS_POST_UART_TABLE { CONFIG_SYS_NS16550_COM1 }
  163. #undef CONFIG_LOGBUFFER
  164. #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000 /* free virtual address */
  165. #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
  166. /*-----------------------------------------------------------------------
  167. * Miscellaneous configurable options
  168. *----------------------------------------------------------------------*/
  169. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  170. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  171. #if defined(CONFIG_CMD_KGDB)
  172. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  173. #else
  174. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  175. #endif
  176. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  177. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  178. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  179. #define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works on */
  180. #define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  181. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  182. /*-----------------------------------------------------------------------
  183. * External Bus Controller (EBC) Setup
  184. */
  185. #define CONFIG_SYS_EBC_CFG 0x98400000
  186. /* Memory Bank 0 (Flash Bank 0) initialization */
  187. #define CONFIG_SYS_EBC_PB0AP 0x02005400
  188. #define CONFIG_SYS_EBC_PB0CR 0xFFF18000 /* BAS=0xFFF,BS=1MB,BU=R/W,BW=8bit */
  189. #define CONFIG_SYS_EBC_PB1AP 0x03041200
  190. #define CONFIG_SYS_EBC_PB1CR 0x7009A000 /* BAS=,BS=MB,BU=R/W,BW=bit */
  191. #define CONFIG_SYS_EBC_PB2AP 0x02054500
  192. #define CONFIG_SYS_EBC_PB2CR 0x78018000 /* BAS=,BS=MB,BU=R/W,BW=bit */
  193. #define CONFIG_SYS_EBC_PB3AP 0x01840300
  194. #define CONFIG_SYS_EBC_PB3CR 0x7c0ba000 /* BAS=,BS=MB,BU=R/W,BW=bit */
  195. #define CONFIG_SYS_EBC_PB4AP 0x01800300
  196. #define CONFIG_SYS_EBC_PB4CR 0x7e0ba000 /* BAS=,BS=MB,BU=R/W,BW=bit */
  197. #define CONFIG_SYS_GPIO0_OR 0xF27FFFFF /* GPIO value */
  198. #define CONFIG_SYS_GPIO0_TCR 0x7FFE0000 /* GPIO value */
  199. #define CONFIG_SYS_GPIO0_ODR 0x00E897FC /* GPIO value */
  200. /*
  201. * For booting Linux, the board info and command line data
  202. * have to be in the first 8 MB of memory, since this is
  203. * the maximum mapped by the Linux kernel during initialization.
  204. */
  205. #define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */
  206. /* Init Memory Controller:
  207. *
  208. * BR0/1 and OR0/1 (FLASH)
  209. */
  210. #define FLASH_BASE0_PRELIM CONFIG_SYS_FLASH_BASE /* FLASH bank #0 */
  211. #define FLASH_BASE1_PRELIM 0 /* FLASH bank #1 */
  212. /* Configuration Port location */
  213. #define CONFIG_PORT_ADDR 0xF0000500
  214. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  215. #ifdef CONFIG_SYS_HUSH_PARSER
  216. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  217. #endif
  218. #if defined(CONFIG_CMD_KGDB)
  219. #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
  220. #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
  221. #endif
  222. #endif /* __CONFIG_H */