gr_cpci_ax2000.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. /* Configuration header file for Gaisler GR-CPCI-AX2000
  2. * AX board. Note that since the AX is removable the configuration
  3. * for this board must be edited below.
  4. *
  5. * (C) Copyright 2003-2005
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7. *
  8. * (C) Copyright 2008
  9. * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #ifndef __CONFIG_H__
  30. #define __CONFIG_H__
  31. /*
  32. * High Level Configuration Options
  33. * (easy to change)
  34. */
  35. #define CONFIG_LEON3 /* This is an LEON3 CPU */
  36. #define CONFIG_LEON 1 /* This is an LEON CPU */
  37. #define CONFIG_CPCI_AX2000 1 /* ... on GR-CPCI-AX2000 board */
  38. #define CONFIG_LEON_RAM_SRAM 1
  39. #define CONFIG_LEON_RAM_SDRAM 2
  40. #define CONFIG_LEON_RAM_SDRAM_NOSRAM 3
  41. /* Select Memory to run from
  42. *
  43. * SRAM - UBoot is run in SRAM, SRAM-0x40000000, SDRAM-0x60000000
  44. * SDRAM - UBoot is run in SDRAM, SRAM-0x40000000 and SDRAM-0x60000000
  45. * SDRAM_NOSRAM - UBoot is run in SDRAM, SRAM not available, SDRAM at 0x40000000
  46. *
  47. * Note, if Linux is to be used, SDRAM or SDRAM_NOSRAM is required since
  48. * it doesn't fit into the 4Mb SRAM.
  49. *
  50. * SRAM is default since it will work for all systems, however will not
  51. * be able to boot linux.
  52. */
  53. #define CONFIG_LEON_RAM_SELECT CONFIG_LEON_RAM_SRAM
  54. /* CPU / AMBA BUS configuration */
  55. #define CONFIG_SYS_CLK_FREQ 20000000 /* 20MHz */
  56. /* Number of SPARC register windows */
  57. #define CFG_SPARC_NWINDOWS 8
  58. /*
  59. * Serial console configuration
  60. */
  61. #define CONFIG_BAUDRATE 38400 /* ... at 38400 bps */
  62. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  63. /* Partitions */
  64. #define CONFIG_DOS_PARTITION
  65. #define CONFIG_MAC_PARTITION
  66. #define CONFIG_ISO_PARTITION
  67. /*
  68. * Supported commands
  69. */
  70. #include <config_cmd_default.h>
  71. #define CONFIG_CMD_REGINFO
  72. #define CONFIG_CMD_AMBAPP
  73. #define CONFIG_CMD_PING
  74. #define CONFIG_CMD_DIAG
  75. #define CONFIG_CMD_IRQ
  76. /*
  77. * Autobooting
  78. */
  79. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  80. #define CONFIG_PREBOOT "echo;" \
  81. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  82. "echo"
  83. #undef CONFIG_BOOTARGS
  84. #define CONFIG_EXTRA_ENV_SETTINGS_BASE \
  85. "netdev=eth0\0" \
  86. "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
  87. "nfsroot=${serverip}:${rootpath}\0" \
  88. "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0" \
  89. "addip=setenv bootargs ${bootargs} " \
  90. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  91. ":${hostname}:${netdev}:off panic=1\0" \
  92. "flash_nfs=run nfsargs addip;" \
  93. "bootm ${kernel_addr}\0" \
  94. "flash_self=run ramargs addip;" \
  95. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  96. "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
  97. "bootargs=console=ttyS0,38400 root=/dev/nfs rw nfsroot=192.168.0.20:/export/rootfs ip=192.168.0.206:192.168.0.20:192.168.0.1:255.255.255.0:ax2000:eth0\0"
  98. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
  99. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  100. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  101. "scratch=40200000\0" \
  102. ""
  103. #elif CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM
  104. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  105. "net_nfs=tftp 60000000 ${bootfile};run nfsargs addip;bootm\0" \
  106. "scratch=60800000\0" \
  107. ""
  108. #else
  109. /* More than 4Mb is assumed when running from SDRAM */
  110. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  111. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  112. "scratch=40800000\0" \
  113. ""
  114. #endif
  115. #define CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_ENV_SETTINGS_BASE CONFIG_EXTRA_ENV_SETTINGS_SELECT
  116. #define CONFIG_NETMASK 255.255.255.0
  117. #define CONFIG_GATEWAYIP 192.168.0.1
  118. #define CONFIG_SERVERIP 192.168.0.20
  119. #define CONFIG_IPADDR 192.168.0.206
  120. #define CONFIG_ROOTPATH /export/rootfs
  121. #define CONFIG_HOSTNAME ax2000
  122. #define CONFIG_BOOTFILE /uImage
  123. #define CONFIG_BOOTCOMMAND "run flash_self"
  124. /* Memory MAP
  125. *
  126. * Flash:
  127. * |--------------------------------|
  128. * | 0x00000000 Text & Data & BSS | *
  129. * | for Monitor | *
  130. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  131. * | UNUSED / Growth | * 256kb
  132. * |--------------------------------|
  133. * | 0x00050000 Base custom area | *
  134. * | kernel / FS | *
  135. * | | * Rest of Flash
  136. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  137. * | END-0x00008000 Environment | * 32kb
  138. * |--------------------------------|
  139. *
  140. *
  141. *
  142. * Main Memory (4Mb SRAM or XMb SDRAM):
  143. * |--------------------------------|
  144. * | UNUSED / scratch area |
  145. * | |
  146. * | |
  147. * | |
  148. * | |
  149. * |--------------------------------|
  150. * | Monitor .Text / .DATA / .BSS | * 256kb
  151. * | Relocated! | *
  152. * |--------------------------------|
  153. * | Monitor Malloc | * 128kb (contains relocated environment)
  154. * |--------------------------------|
  155. * | Monitor/kernel STACK | * 64kb
  156. * |--------------------------------|
  157. * | Page Table for MMU systems | * 2k
  158. * |--------------------------------|
  159. * | PROM Code accessed from Linux | * 6kb-128b
  160. * |--------------------------------|
  161. * | Global data (avail from kernel)| * 128b
  162. * |--------------------------------|
  163. *
  164. */
  165. /*
  166. * Flash configuration (8,16 or 32 MB)
  167. * TEXT base always at 0xFFF00000
  168. * ENV_ADDR always at 0xFFF40000
  169. * FLASH_BASE at 0xFC000000 for 64 MB
  170. * 0xFE000000 for 32 MB
  171. * 0xFF000000 for 16 MB
  172. * 0xFF800000 for 8 MB
  173. */
  174. /*#define CFG_NO_FLASH 1*/
  175. #define CFG_FLASH_BASE 0x00000000
  176. #define CFG_FLASH_SIZE 0x00800000
  177. #define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors */
  178. #define CFG_MAX_FLASH_SECT 64 /* max num of sects on one chip */
  179. #define CFG_MAX_FLASH_BANKS 1 /* max num of memory banks */
  180. #define CFG_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  181. #define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  182. #define CFG_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  183. #define CFG_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  184. #define CFG_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  185. /*** CFI CONFIG ***/
  186. #define CFG_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  187. #define CFG_FLASH_CFI_DRIVER
  188. #define CFG_FLASH_CFI
  189. /* Bypass cache when reading regs from flash memory */
  190. #define CFG_FLASH_CFI_BYPASS_READ
  191. /* Buffered writes (32byte/go) instead of single accesses */
  192. #define CFG_FLASH_USE_BUFFER_WRITE
  193. /*
  194. * Environment settings
  195. */
  196. /*#define CFG_ENV_IS_NOWHERE 1*/
  197. #define CFG_ENV_IS_IN_FLASH 1
  198. /* CFG_ENV_ADDR need to be at sector boundary */
  199. #define CFG_ENV_SIZE 0x8000
  200. #define CFG_ENV_SECT_SIZE 0x20000
  201. #define CFG_ENV_ADDR (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SECT_SIZE)
  202. #define CONFIG_ENV_OVERWRITE 1
  203. /*
  204. * Memory map
  205. *
  206. * Always 4Mb SRAM available
  207. * SDRAM module may be available on 0x60000000, SDRAM
  208. * is configured as if a 128Mb SDRAM module is available.
  209. */
  210. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  211. #define CFG_SDRAM_BASE 0x40000000
  212. #else
  213. #define CFG_SDRAM_BASE 0x60000000
  214. #endif
  215. #define CFG_SDRAM_SIZE 0x08000000
  216. #define CFG_SDRAM_END (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
  217. /* 4Mb SRAM available */
  218. #if CONFIG_LEON_RAM_SELECT != CONFIG_LEON_RAM_SDRAM_NOSRAM
  219. #define CFG_SRAM_BASE 0x40000000
  220. #define CFG_SRAM_SIZE 0x400000
  221. #define CFG_SRAM_END (CFG_SRAM_BASE+CFG_SRAM_SIZE)
  222. #endif
  223. /* Select RAM used to run U-BOOT from... */
  224. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
  225. #define CFG_RAM_BASE CFG_SRAM_BASE
  226. #define CFG_RAM_SIZE CFG_SRAM_SIZE
  227. #define CFG_RAM_END CFG_SRAM_END
  228. #else
  229. #define CFG_RAM_BASE CFG_SDRAM_BASE
  230. #define CFG_RAM_SIZE CFG_SDRAM_SIZE
  231. #define CFG_RAM_END CFG_SDRAM_END
  232. #endif
  233. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  234. #define CFG_GBL_DATA_OFFSET (CFG_RAM_END - CFG_GBL_DATA_SIZE)
  235. #define CFG_PROM_SIZE (8192-CFG_GBL_DATA_SIZE)
  236. #define CFG_PROM_OFFSET (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
  237. #define CFG_INIT_SP_OFFSET (CFG_PROM_OFFSET-32)
  238. #define CFG_STACK_SIZE (0x10000-32)
  239. #define CFG_MONITOR_BASE TEXT_BASE
  240. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  241. # define CFG_RAMBOOT 1
  242. #endif
  243. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  244. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  245. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  246. #define CFG_MALLOC_END (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
  247. #define CFG_MALLOC_BASE (CFG_MALLOC_END-CFG_MALLOC_LEN)
  248. /* relocated monitor area */
  249. #define CFG_RELOC_MONITOR_MAX_END CFG_MALLOC_BASE
  250. #define CFG_RELOC_MONITOR_BASE (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
  251. /* make un relocated address from relocated address */
  252. #define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
  253. /*
  254. * Ethernet configuration uses on board SMC91C111
  255. */
  256. #define CONFIG_DRIVER_SMC91111 1
  257. #define CONFIG_SMC91111_BASE 0x20000300 /* chip select 3 */
  258. #define CONFIG_SMC_USE_32_BIT 1 /* 32 bit bus */
  259. #undef CONFIG_SMC_91111_EXT_PHY /* we use internal phy */
  260. /*#define CONFIG_SHOW_ACTIVITY*/
  261. #define CONFIG_NET_RETRY_COUNT 10 /* # of retries */
  262. #define CONFIG_ETHADDR 00:00:7a:cc:00:13
  263. #define CONFIG_PHY_ADDR 0x00
  264. /*
  265. * Miscellaneous configurable options
  266. */
  267. #define CFG_LONGHELP /* undef to save memory */
  268. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  269. #if defined(CONFIG_CMD_KGDB)
  270. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  271. #else
  272. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  273. #endif
  274. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  275. #define CFG_MAXARGS 16 /* max number of command args */
  276. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  277. #define CFG_MEMTEST_START 0x00100000 /* memtest works on */
  278. #define CFG_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  279. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  280. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  281. /*
  282. * Various low-level settings
  283. */
  284. /*-----------------------------------------------------------------------
  285. * USB stuff
  286. *-----------------------------------------------------------------------
  287. */
  288. #define CONFIG_USB_CLOCK 0x0001BBBB
  289. #define CONFIG_USB_CONFIG 0x00005000
  290. /***** Gaisler GRLIB IP-Cores Config ********/
  291. /* AMBA Plug & Play info display on startup */
  292. /*#define CFG_AMBAPP_PRINT_ON_STARTUP*/
  293. #define CFG_GRLIB_SDRAM 0
  294. /* See, GRLIB Docs (grip.pdf) on how to set up
  295. * These the memory controller registers.
  296. */
  297. #define CFG_GRLIB_MEMCFG1 (0x10f800ff | (1<<11))
  298. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  299. #define CFG_GRLIB_MEMCFG2 0x82206000
  300. #else
  301. #define CFG_GRLIB_MEMCFG2 0x82205260
  302. #endif
  303. #define CFG_GRLIB_MEMCFG3 0x0809a000
  304. #define CFG_GRLIB_FT_MEMCFG1 (0x10f800ff | (1<<11))
  305. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  306. #define CFG_GRLIB_FT_MEMCFG2 0x82206000
  307. #else
  308. #define CFG_GRLIB_FT_MEMCFG2 0x82205260
  309. #endif
  310. #define CFG_GRLIB_FT_MEMCFG3 0x0809a000
  311. /* no DDR controller */
  312. #define CFG_GRLIB_DDR_CFG 0x00000000
  313. /* no DDR2 Controller */
  314. #define CFG_GRLIB_DDR2_CFG1 0x00000000
  315. #define CFG_GRLIB_DDR2_CFG3 0x00000000
  316. /* Calculate scaler register value from default baudrate */
  317. #define CFG_GRLIB_APBUART_SCALER \
  318. ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
  319. /* Identification string */
  320. #define CONFIG_IDENT_STRING "GAISLER LEON3 GR-CPCI-AX2000"
  321. /* default kernel command line */
  322. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  323. #endif /* __CONFIG_H */