grsim_leon2.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. /* Configuration header file for LEON2 GRSIM.
  2. *
  3. * (C) Copyright 2003-2005
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. *
  6. * (C) Copyright 2007
  7. * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
  8. *
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. #ifndef __CONFIG_H__
  28. #define __CONFIG_H__
  29. /*
  30. * High Level Configuration Options
  31. * (easy to change)
  32. *
  33. * Select between TSIM or GRSIM by setting CONFIG_GRSIM or CONFIG_TSIM to 1.
  34. *
  35. * TSIM command
  36. * tsim-leon -sdram 0 -ram 32000 -rom 8192 -mmu
  37. *
  38. */
  39. #define CONFIG_LEON2 /* This is an LEON2 CPU */
  40. #define CONFIG_LEON 1 /* This is an LEON CPU */
  41. #define CONFIG_GRSIM 0 /* ... not running on GRSIM */
  42. #define CONFIG_TSIM 1 /* ... running on TSIM */
  43. /* CPU / AMBA BUS configuration */
  44. #define CONFIG_SYS_CLK_FREQ 40000000 /* 40MHz */
  45. /* Number of SPARC register windows */
  46. #define CFG_SPARC_NWINDOWS 8
  47. /*
  48. * Serial console configuration
  49. */
  50. #define CONFIG_BAUDRATE 38400 /* ... at 38400 bps */
  51. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  52. /* Partitions */
  53. #define CONFIG_DOS_PARTITION
  54. #define CONFIG_MAC_PARTITION
  55. #define CONFIG_ISO_PARTITION
  56. /*
  57. * Supported commands
  58. */
  59. #define CONFIG_CMD_AUTOSCRIPT /* Autoscript Support */
  60. #define CONFIG_CMD_BDI /* bdinfo */
  61. #define CONFIG_CMD_CONSOLE /* coninfo */
  62. #define CONFIG_CMD_DIAG
  63. #define CONFIG_CMD_ECHO /* echo arguments */
  64. #define CONFIG_CMD_FPGA /* FPGA configuration Support */
  65. #define CONFIG_CMD_IRQ
  66. #define CONFIG_CMD_ITEST /* Integer (and string) test */
  67. #define CONFIG_CMD_LOADB /* loadb */
  68. #define CONFIG_CMD_LOADS /* loads */
  69. #define CONFIG_CMD_MISC /* Misc functions like sleep etc */
  70. #define CONFIG_CMD_REGINFO
  71. #define CONFIG_CMD_RUN /* run command in env variable */
  72. #define CONFIG_CMD_SETGETDCR /* DCR support on 4xx */
  73. #define CONFIG_CMD_XIMG /* Load part of Multi Image */
  74. /*
  75. * Autobooting
  76. */
  77. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  78. #define CONFIG_PREBOOT "echo;" \
  79. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  80. "echo"
  81. #undef CONFIG_BOOTARGS
  82. /*#define CFG_HUSH_PARSER 0*/
  83. #ifdef CFG_HUSH_PARSER
  84. #define CFG_PROMPT_HUSH_PS2 "> "
  85. #endif
  86. #define CONFIG_EXTRA_ENV_SETTINGS \
  87. "netdev=eth0\0" \
  88. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  89. "nfsroot=${serverip}:${rootpath}\0" \
  90. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  91. "addip=setenv bootargs ${bootargs} " \
  92. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  93. ":${hostname}:${netdev}:off panic=1\0" \
  94. "flash_nfs=run nfsargs addip;" \
  95. "bootm ${kernel_addr}\0" \
  96. "flash_self=run ramargs addip;" \
  97. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  98. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  99. "rootpath=/export/roofs\0" \
  100. "scratch=40000000\0" \
  101. "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
  102. "ethaddr=00:00:7A:CC:00:12\0" \
  103. "bootargs=console=ttyS0,38400" \
  104. ""
  105. #define CONFIG_NETMASK 255.255.255.0
  106. #define CONFIG_GATEWAYIP 192.168.0.1
  107. #define CONFIG_SERVERIP 192.168.0.81
  108. #define CONFIG_IPADDR 192.168.0.80
  109. #define CONFIG_ROOTPATH /export/rootfs
  110. #define CONFIG_HOSTNAME grxc3s1500
  111. #define CONFIG_BOOTFILE /uImage
  112. #define CONFIG_BOOTCOMMAND "run flash_self"
  113. /* Memory MAP
  114. *
  115. * Flash:
  116. * |--------------------------------|
  117. * | 0x00000000 Text & Data & BSS | *
  118. * | for Monitor | *
  119. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  120. * | UNUSED / Growth | * 256kb
  121. * |--------------------------------|
  122. * | 0x00050000 Base custom area | *
  123. * | kernel / FS | *
  124. * | | * Rest of Flash
  125. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  126. * | END-0x00008000 Environment | * 32kb
  127. * |--------------------------------|
  128. *
  129. *
  130. *
  131. * Main Memory:
  132. * |--------------------------------|
  133. * | UNUSED / scratch area |
  134. * | |
  135. * | |
  136. * | |
  137. * | |
  138. * |--------------------------------|
  139. * | Monitor .Text / .DATA / .BSS | * 256kb
  140. * | Relocated! | *
  141. * |--------------------------------|
  142. * | Monitor Malloc | * 128kb (contains relocated environment)
  143. * |--------------------------------|
  144. * | Monitor/kernel STACK | * 64kb
  145. * |--------------------------------|
  146. * | Page Table for MMU systems | * 2k
  147. * |--------------------------------|
  148. * | PROM Code accessed from Linux | * 6kb-128b
  149. * |--------------------------------|
  150. * | Global data (avail from kernel)| * 128b
  151. * |--------------------------------|
  152. *
  153. */
  154. /*
  155. * Flash configuration (8,16 or 32 MB)
  156. * TEXT base always at 0xFFF00000
  157. * ENV_ADDR always at 0xFFF40000
  158. * FLASH_BASE at 0xFC000000 for 64 MB
  159. * 0xFE000000 for 32 MB
  160. * 0xFF000000 for 16 MB
  161. * 0xFF800000 for 8 MB
  162. */
  163. #define CFG_NO_FLASH 1
  164. #define CFG_FLASH_BASE 0x00000000
  165. #define CFG_FLASH_SIZE 0x00800000
  166. #define CFG_ENV_SIZE 0x8000
  167. #define CFG_ENV_ADDR (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SIZE)
  168. #define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors */
  169. #define CFG_MAX_FLASH_SECT 64 /* max num of sects on one chip */
  170. #define CFG_MAX_FLASH_BANKS 1 /* max num of memory banks */
  171. #define CFG_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  172. #define CFG_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  173. #define CFG_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  174. #define CFG_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  175. #ifdef ENABLE_FLASH_SUPPORT
  176. /* For use with grsim FLASH emulation extension */
  177. #define CFG_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  178. #undef CONFIG_FLASH_8BIT /* Flash is 32-bit */
  179. /*** CFI CONFIG ***/
  180. #define CFG_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  181. #define CFG_FLASH_CFI_DRIVER
  182. #define CFG_FLASH_CFI
  183. #endif
  184. /*
  185. * Environment settings
  186. */
  187. #define CFG_ENV_IS_NOWHERE 1
  188. /*#define CFG_ENV_IS_IN_FLASH 0*/
  189. /*#define CFG_ENV_SIZE 0x8000*/
  190. #define CFG_ENV_SECT_SIZE 0x40000
  191. #define CONFIG_ENV_OVERWRITE 1
  192. /*
  193. * Memory map
  194. */
  195. #define CFG_SDRAM_BASE 0x40000000
  196. #define CFG_SDRAM_SIZE 0x00800000
  197. #define CFG_SDRAM_END (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
  198. /* no SRAM available */
  199. #undef CFG_SRAM_BASE
  200. #undef CFG_SRAM_SIZE
  201. /* Always Run U-Boot from SDRAM */
  202. #define CFG_RAM_BASE CFG_SDRAM_BASE
  203. #define CFG_RAM_SIZE CFG_SDRAM_SIZE
  204. #define CFG_RAM_END CFG_SDRAM_END
  205. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  206. #define CFG_GBL_DATA_OFFSET (CFG_RAM_END - CFG_GBL_DATA_SIZE)
  207. #define CFG_PROM_SIZE (8192-CFG_GBL_DATA_SIZE)
  208. #define CFG_PROM_OFFSET (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
  209. #define CFG_INIT_SP_OFFSET (CFG_PROM_OFFSET-32)
  210. #define CFG_STACK_SIZE (0x10000-32)
  211. #define CFG_MONITOR_BASE TEXT_BASE
  212. #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
  213. # define CFG_RAMBOOT 1
  214. #endif
  215. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  216. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  217. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  218. #define CFG_MALLOC_END (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
  219. #define CFG_MALLOC_BASE (CFG_MALLOC_END-CFG_MALLOC_LEN)
  220. /* relocated monitor area */
  221. #define CFG_RELOC_MONITOR_MAX_END CFG_MALLOC_BASE
  222. #define CFG_RELOC_MONITOR_BASE (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
  223. /* make un relocated address from relocated address */
  224. #define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
  225. /*
  226. * Ethernet configuration
  227. */
  228. /*#define CONFIG_GRETH 1*/
  229. /*#define CONFIG_NET_MULTI 1*/
  230. /* Default HARDWARE address */
  231. #define GRETH_HWADDR_0 0x00
  232. #define GRETH_HWADDR_1 0x00
  233. #define GRETH_HWADDR_2 0x7A
  234. #define GRETH_HWADDR_3 0xcc
  235. #define GRETH_HWADDR_4 0x00
  236. #define GRETH_HWADDR_5 0x12
  237. #define CONFIG_ETHADDR 00:00:7a:cc:00:12
  238. /*
  239. * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s
  240. */
  241. /* #define CONFIG_GRETH_10MBIT 1 */
  242. #define CONFIG_PHY_ADDR 0x00
  243. /*
  244. * Miscellaneous configurable options
  245. */
  246. #define CFG_LONGHELP /* undef to save memory */
  247. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  248. #if defined(CONFIG_CMD_KGDB)
  249. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  250. #else
  251. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  252. #endif
  253. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  254. #define CFG_MAXARGS 16 /* max number of command args */
  255. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  256. #define CFG_MEMTEST_START 0x00100000 /* memtest works on */
  257. #define CFG_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  258. #define CFG_LOAD_ADDR 0x100000 /* default load address */
  259. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  260. /***** Gaisler GRLIB IP-Cores Config ********/
  261. #define CFG_GRLIB_SDRAM 0
  262. #define CFG_GRLIB_MEMCFG1 (0x000000ff | (1<<11))
  263. #if CONFIG_GRSIM
  264. #define CFG_GRLIB_MEMCFG2 0x82206000
  265. #else
  266. #define CFG_GRLIB_MEMCFG2 0x00001820
  267. #endif
  268. #define CFG_GRLIB_MEMCFG3 0x00136000
  269. /*** LEON2 UART 1 ***/
  270. #define CFG_LEON2_UART1_SCALER \
  271. ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
  272. /* UART1 Define to 1 or 0 */
  273. #define LEON2_UART1_LOOPBACK_ENABLE 0
  274. #define LEON2_UART1_FLOWCTRL_ENABLE 0
  275. #define LEON2_UART1_PARITY_ENABLE 0
  276. #define LEON2_UART1_ODDPAR_ENABLE 0
  277. /*** LEON2 UART 2 ***/
  278. #define CFG_LEON2_UART2_SCALER \
  279. ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
  280. /* UART2 Define to 1 or 0 */
  281. #define LEON2_UART2_LOOPBACK_ENABLE 0
  282. #define LEON2_UART2_FLOWCTRL_ENABLE 0
  283. #define LEON2_UART2_PARITY_ENABLE 0
  284. #define LEON2_UART2_ODDPAR_ENABLE 0
  285. #define LEON_CONSOLE_UART1 1
  286. #define LEON_CONSOLE_UART2 2
  287. /* Use UART2 as console */
  288. #define LEON2_CONSOLE_SELECT LEON_CONSOLE_UART1
  289. /* LEON2 I/O Port */
  290. /*#define LEON2_IO_PORT_DIR 0x0000aa00*/
  291. /* default kernel command line */
  292. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  293. #define CONFIG_IDENT_STRING "Gaisler GRSIM LEON2"
  294. #endif /* __CONFIG_H */