grsim.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /* Configuration header file for LEON3 GRSIM, trying to be similar
  2. * to Gaisler's GR-XC3S-1500 board.
  3. *
  4. * (C) Copyright 2003-2005
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * (C) Copyright 2007
  8. * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef __CONFIG_H__
  13. #define __CONFIG_H__
  14. /*
  15. * High Level Configuration Options
  16. * (easy to change)
  17. *
  18. * Select between TSIM or GRSIM by setting CONFIG_GRSIM or CONFIG_TSIM to 1.
  19. *
  20. * TSIM command:
  21. * $ tsim-leon3 -sdram 32768 -ram 4096 -rom 2048 -mmu -cas
  22. *
  23. * In the evaluation version of TSIM, the -sdram/-ram/-rom arguments are
  24. * hard-coded to these values and need not be specified. (see below)
  25. *
  26. * Get TSIM from http://www.gaisler.com/index.php/downloads/simulators
  27. */
  28. #define CONFIG_GRSIM 0 /* ... not running on GRSIM */
  29. #define CONFIG_TSIM 1 /* ... running on TSIM */
  30. /* CPU / AMBA BUS configuration */
  31. #define CONFIG_SYS_CLK_FREQ 40000000 /* 40MHz */
  32. /*
  33. * Serial console configuration
  34. */
  35. #define CONFIG_BAUDRATE 38400 /* ... at 38400 bps */
  36. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  37. /* Partitions */
  38. #define CONFIG_DOS_PARTITION
  39. #define CONFIG_MAC_PARTITION
  40. #define CONFIG_ISO_PARTITION
  41. /*
  42. * Supported commands
  43. */
  44. #define CONFIG_CMD_DIAG
  45. #define CONFIG_CMD_FPGA_LOADMK
  46. #define CONFIG_CMD_IRQ
  47. #define CONFIG_CMD_REGINFO
  48. /*
  49. * Autobooting
  50. */
  51. #define CONFIG_PREBOOT "echo;" \
  52. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  53. "echo"
  54. #undef CONFIG_BOOTARGS
  55. #define CONFIG_EXTRA_ENV_SETTINGS \
  56. "netdev=eth0\0" \
  57. "nfsargs=setenv bootargs root=/dev/nfs rw " \
  58. "nfsroot=${serverip}:${rootpath}\0" \
  59. "ramargs=setenv bootargs root=/dev/ram rw\0" \
  60. "addip=setenv bootargs ${bootargs} " \
  61. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  62. ":${hostname}:${netdev}:off panic=1\0" \
  63. "flash_nfs=run nfsargs addip;" \
  64. "bootm ${kernel_addr}\0" \
  65. "flash_self=run ramargs addip;" \
  66. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  67. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  68. "rootpath=/export/roofs\0" \
  69. "scratch=40000000\0" \
  70. "getkernel=tftpboot $(scratch) $(bootfile)\0" \
  71. "bootargs=console=ttyS0,38400" \
  72. ""
  73. #define CONFIG_NETMASK 255.255.255.0
  74. #define CONFIG_GATEWAYIP 192.168.0.1
  75. #define CONFIG_SERVERIP 192.168.0.81
  76. #define CONFIG_IPADDR 192.168.0.80
  77. #define CONFIG_ROOTPATH "/export/rootfs"
  78. #define CONFIG_HOSTNAME grxc3s1500
  79. #define CONFIG_BOOTFILE "/uImage"
  80. #define CONFIG_BOOTCOMMAND "run flash_self"
  81. /* Memory MAP
  82. *
  83. * Flash:
  84. * |--------------------------------|
  85. * | 0x00000000 Text & Data & BSS | *
  86. * | for Monitor | *
  87. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  88. * | UNUSED / Growth | * 256kb
  89. * |--------------------------------|
  90. * | 0x00050000 Base custom area | *
  91. * | kernel / FS | *
  92. * | | * Rest of Flash
  93. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  94. * | END-0x00008000 Environment | * 32kb
  95. * |--------------------------------|
  96. *
  97. *
  98. *
  99. * Main Memory:
  100. * |--------------------------------|
  101. * | UNUSED / scratch area |
  102. * | |
  103. * | |
  104. * | |
  105. * | |
  106. * |--------------------------------|
  107. * | Monitor .Text / .DATA / .BSS | * 256kb
  108. * | Relocated! | *
  109. * |--------------------------------|
  110. * | Monitor Malloc | * 128kb (contains relocated environment)
  111. * |--------------------------------|
  112. * | Monitor/kernel STACK | * 64kb
  113. * |--------------------------------|
  114. * | Page Table for MMU systems | * 2k
  115. * |--------------------------------|
  116. * | PROM Code accessed from Linux | * 6kb-128b
  117. * |--------------------------------|
  118. * | Global data (avail from kernel)| * 128b
  119. * |--------------------------------|
  120. *
  121. */
  122. /*
  123. * Flash configuration (8,16 or 32 MB)
  124. * TEXT base always at 0xFFF00000
  125. * ENV_ADDR always at 0xFFF40000
  126. * FLASH_BASE at 0xFC000000 for 64 MB
  127. * 0xFE000000 for 32 MB
  128. * 0xFF000000 for 16 MB
  129. * 0xFF800000 for 8 MB
  130. */
  131. #define CONFIG_SYS_NO_FLASH 1
  132. #define CONFIG_SYS_FLASH_BASE 0x00000000
  133. #define CONFIG_SYS_FLASH_SIZE 0x00800000
  134. #define CONFIG_ENV_SIZE 0x8000
  135. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE+CONFIG_SYS_FLASH_SIZE-CONFIG_ENV_SIZE)
  136. #define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors */
  137. #define CONFIG_SYS_MAX_FLASH_SECT 64 /* max num of sects on one chip */
  138. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */
  139. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  140. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  141. #define CONFIG_SYS_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  142. #define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  143. #ifdef ENABLE_FLASH_SUPPORT
  144. /* For use with grsim FLASH emulation extension */
  145. #define CONFIG_SYS_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  146. #undef CONFIG_FLASH_8BIT /* Flash is 32-bit */
  147. /*** CFI CONFIG ***/
  148. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  149. #define CONFIG_FLASH_CFI_DRIVER
  150. #define CONFIG_SYS_FLASH_CFI
  151. #endif
  152. /*
  153. * Environment settings
  154. */
  155. #define CONFIG_ENV_IS_NOWHERE 1
  156. /*#define CONFIG_ENV_IS_IN_FLASH*/
  157. /*#define CONFIG_ENV_SIZE 0x8000*/
  158. #define CONFIG_ENV_SECT_SIZE 0x40000
  159. #define CONFIG_ENV_OVERWRITE 1
  160. /*
  161. * Memory map
  162. */
  163. #define CONFIG_SYS_SDRAM_BASE 0x60000000
  164. #define CONFIG_SYS_SDRAM_SIZE 0x02000000 /* 32MiB SDRAM */
  165. #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE)
  166. #define CONFIG_SYS_SRAM_BASE 0x40000000
  167. #define CONFIG_SYS_SRAM_SIZE 0x00400000 /* 4MiB SRAM */
  168. #define CONFIG_SYS_SRAM_END (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_SRAM_SIZE)
  169. /* Always Run U-Boot from SDRAM */
  170. #define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE
  171. #define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE
  172. #define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END
  173. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_RAM_END - GENERATED_GBL_DATA_SIZE)
  174. #define CONFIG_SYS_PROM_SIZE (8192-GENERATED_GBL_DATA_SIZE)
  175. #define CONFIG_SYS_PROM_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET-CONFIG_SYS_PROM_SIZE)
  176. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_PROM_OFFSET-32)
  177. #define CONFIG_SYS_STACK_SIZE (0x10000-32)
  178. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  179. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
  180. # define CONFIG_SYS_RAMBOOT 1
  181. #endif
  182. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  183. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  184. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  185. #define CONFIG_SYS_MALLOC_END (CONFIG_SYS_INIT_SP_OFFSET-CONFIG_SYS_STACK_SIZE)
  186. #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MALLOC_END-CONFIG_SYS_MALLOC_LEN)
  187. /* relocated monitor area */
  188. #define CONFIG_SYS_RELOC_MONITOR_MAX_END CONFIG_SYS_MALLOC_BASE
  189. #define CONFIG_SYS_RELOC_MONITOR_BASE (CONFIG_SYS_RELOC_MONITOR_MAX_END-CONFIG_SYS_MONITOR_LEN)
  190. /* make un relocated address from relocated address */
  191. #define UN_RELOC(address) (address-(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE))
  192. #ifdef CONFIG_CMD_NET
  193. /*
  194. * Ethernet configuration
  195. */
  196. #define CONFIG_GRETH 1
  197. /*
  198. * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s
  199. */
  200. /* #define CONFIG_GRETH_10MBIT 1 */
  201. #define CONFIG_PHY_ADDR 0x00
  202. #endif /* CONFIG_CMD_NET */
  203. /*
  204. * Miscellaneous configurable options
  205. */
  206. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  207. #if defined(CONFIG_CMD_KGDB)
  208. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  209. #else
  210. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  211. #endif
  212. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  213. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  214. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  215. #define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */
  216. #define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  217. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  218. /***** Gaisler GRLIB IP-Cores Config ********/
  219. #define CONFIG_SYS_GRLIB_SDRAM 0
  220. #define CONFIG_SYS_GRLIB_MEMCFG1 (0x000000ff | (1<<11))
  221. /* No SDRAM Configuration */
  222. #undef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
  223. /* LEON2 MCTRL configuration */
  224. #define CONFIG_SYS_GRLIB_ESA_MCTRL1
  225. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG1 (0x000000ff | (1<<11))
  226. #if CONFIG_GRSIM
  227. /* GRSIM configuration */
  228. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x82206000
  229. #else
  230. /* TSIM configuration */
  231. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x81805220
  232. #endif
  233. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG3 0x00136000
  234. /* GRLIB FT-MCTRL configuration */
  235. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
  236. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG1 (0x000000ff | (1<<11))
  237. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2 0x82206000
  238. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG3 0x00136000
  239. /* no DDR controller */
  240. #undef CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
  241. /* no DDR2 Controller */
  242. #undef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
  243. /* default kernel command line */
  244. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  245. /* TSIM command:
  246. * $ ./tsim-leon3 -mmu -cas
  247. *
  248. * This TSIM evaluation version will expire 2015-04-02
  249. *
  250. *
  251. * TSIM/LEON3 SPARC simulator, version 2.0.35 (evaluation version)
  252. *
  253. * Copyright (C) 2014, Aeroflex Gaisler - all rights reserved.
  254. * This software may only be used with a valid license.
  255. * For latest updates, go to http://www.gaisler.com/
  256. * Comments or bug-reports to support@gaisler.com
  257. *
  258. * serial port A on stdin/stdout
  259. * allocated 4096 K SRAM memory, in 1 bank
  260. * allocated 32 M SDRAM memory, in 1 bank
  261. * allocated 2048 K ROM memory
  262. * icache: 1 * 4 kbytes, 16 bytes/line (4 kbytes total)
  263. * dcache: 1 * 4 kbytes, 16 bytes/line (4 kbytes total)
  264. * tsim> leon
  265. * 0x80000000 Memory configuration register 1 0x000002ff
  266. * 0x80000004 Memory configuration register 2 0x81805220
  267. * 0x80000008 Memory configuration register 3 0x00000000
  268. */
  269. #endif /* __CONFIG_H */