gr_ep2s60.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /* Configuration header file for Gaisler Research AB's Template
  2. * design (GPL Open Source SPARC/LEON3 96MHz) for Altera NIOS
  3. * Development board Stratix II edition, with the FPGA device
  4. * EP2S60.
  5. *
  6. * (C) Copyright 2003-2005
  7. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  8. *
  9. * (C) Copyright 2008
  10. * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
  11. *
  12. * SPDX-License-Identifier: GPL-2.0+
  13. */
  14. #ifndef __CONFIG_H__
  15. #define __CONFIG_H__
  16. /*
  17. * High Level Configuration Options
  18. * (easy to change)
  19. */
  20. /* Altera NIOS Development board, Stratix II board */
  21. #define CONFIG_GR_EP2S60 1
  22. /* CPU / AMBA BUS configuration */
  23. #define CONFIG_SYS_CLK_FREQ 96000000 /* 96MHz */
  24. /* Define this is the GR-2S60-MEZZ mezzanine is available and you
  25. * want to use the USB and GRETH functionality of the board
  26. */
  27. #undef GR_2S60_MEZZ
  28. #ifdef GR_2S60_MEZZ
  29. #define USE_GRETH 1
  30. #define USE_GRUSB 1
  31. #endif
  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_REGINFO
  45. #define CONFIG_CMD_DIAG
  46. #define CONFIG_CMD_IRQ
  47. /* USB support */
  48. #if USE_GRUSB
  49. #define CONFIG_USB_UHCI
  50. /* Enable needed helper functions */
  51. #endif
  52. /*
  53. * Autobooting
  54. */
  55. #define CONFIG_PREBOOT "echo;" \
  56. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  57. "echo"
  58. #undef CONFIG_BOOTARGS
  59. #define CONFIG_EXTRA_ENV_SETTINGS \
  60. "netdev=eth0\0" \
  61. "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
  62. "nfsroot=${serverip}:${rootpath}\0" \
  63. "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0" \
  64. "addip=setenv bootargs ${bootargs} " \
  65. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  66. ":${hostname}:${netdev}:off panic=1\0" \
  67. "flash_nfs=run nfsargs addip;" \
  68. "bootm ${kernel_addr}\0" \
  69. "flash_self=run ramargs addip;" \
  70. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  71. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  72. "scratch=40800000\0" \
  73. "getkernel=tftpboot $(scratch) $(bootfile)\0" \
  74. "bootargs=console=ttyS0,38400 root=/dev/nfs rw nfsroot=192.168.0.20:/export/rootfs ip=192.168.0.207:192.168.0.20:192.168.0.1:255.255.255.0:ml401:eth0\0" \
  75. ""
  76. #define CONFIG_NETMASK 255.255.255.0
  77. #define CONFIG_GATEWAYIP 192.168.0.1
  78. #define CONFIG_SERVERIP 192.168.0.20
  79. #define CONFIG_IPADDR 192.168.0.207
  80. #define CONFIG_ROOTPATH "/export/rootfs"
  81. #define CONFIG_HOSTNAME ml401
  82. #define CONFIG_BOOTFILE "/uImage"
  83. #define CONFIG_BOOTCOMMAND "run flash_self"
  84. /* Memory MAP
  85. *
  86. * Flash:
  87. * |--------------------------------|
  88. * | 0x00000000 Text & Data & BSS | *
  89. * | for Monitor | *
  90. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  91. * | UNUSED / Growth | * 256kb
  92. * |--------------------------------|
  93. * | 0x00050000 Base custom area | *
  94. * | kernel / FS | *
  95. * | | * Rest of Flash
  96. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  97. * | END-0x00008000 Environment | * 32kb
  98. * |--------------------------------|
  99. *
  100. *
  101. *
  102. * Main Memory:
  103. * |--------------------------------|
  104. * | UNUSED / scratch area |
  105. * | |
  106. * | |
  107. * | |
  108. * | |
  109. * |--------------------------------|
  110. * | Monitor .Text / .DATA / .BSS | * 512kb
  111. * | Relocated! | *
  112. * |--------------------------------|
  113. * | Monitor Malloc | * 128kb (contains relocated environment)
  114. * |--------------------------------|
  115. * | Monitor/kernel STACK | * 64kb
  116. * |--------------------------------|
  117. * | Page Table for MMU systems | * 2k
  118. * |--------------------------------|
  119. * | PROM Code accessed from Linux | * 6kb-128b
  120. * |--------------------------------|
  121. * | Global data (avail from kernel)| * 128b
  122. * |--------------------------------|
  123. *
  124. */
  125. /*
  126. * Flash configuration (8,16 or 32 MB)
  127. * TEXT base always at 0xFFF00000
  128. * ENV_ADDR always at 0xFFF40000
  129. * FLASH_BASE at 0xFC000000 for 64 MB
  130. * 0xFE000000 for 32 MB
  131. * 0xFF000000 for 16 MB
  132. * 0xFF800000 for 8 MB
  133. */
  134. /*#define CONFIG_SYS_NO_FLASH 1*/
  135. #define CONFIG_SYS_FLASH_BASE 0x00000000
  136. #define CONFIG_SYS_FLASH_SIZE 0x00400000 /* FPGA Bit file is in top of FLASH, we only ues the bottom 4Mb */
  137. #define PHYS_FLASH_SECT_SIZE 0x00010000 /* 64 KB sectors */
  138. #define CONFIG_SYS_MAX_FLASH_SECT 256 /* max num of sects on one chip */
  139. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */
  140. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  141. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  142. #define CONFIG_SYS_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  143. #define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  144. #define CONFIG_SYS_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  145. /*** CFI CONFIG ***/
  146. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  147. #define CONFIG_FLASH_CFI_DRIVER
  148. #define CONFIG_SYS_FLASH_CFI
  149. /* Bypass cache when reading regs from flash memory */
  150. #define CONFIG_SYS_FLASH_CFI_BYPASS_READ
  151. /* Buffered writes (32byte/go) instead of single accesses */
  152. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  153. /*
  154. * Environment settings
  155. */
  156. /*#define CONFIG_ENV_IS_NOWHERE 1*/
  157. #define CONFIG_ENV_IS_IN_FLASH 1
  158. /* CONFIG_ENV_ADDR need to be at sector boundary */
  159. #define CONFIG_ENV_SIZE 0x8000
  160. #define CONFIG_ENV_SECT_SIZE 0x20000
  161. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE+CONFIG_SYS_FLASH_SIZE-CONFIG_ENV_SECT_SIZE)
  162. #define CONFIG_ENV_OVERWRITE 1
  163. /*
  164. * Memory map
  165. */
  166. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  167. #define CONFIG_SYS_SDRAM_SIZE 0x02000000
  168. #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_SDRAM_SIZE)
  169. /* no SRAM available */
  170. #undef CONFIG_SYS_SRAM_BASE
  171. #undef CONFIG_SYS_SRAM_SIZE
  172. #define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE
  173. #define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE
  174. #define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END
  175. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_SDRAM_END - GENERATED_GBL_DATA_SIZE)
  176. #define CONFIG_SYS_PROM_SIZE (8192-GENERATED_GBL_DATA_SIZE)
  177. #define CONFIG_SYS_PROM_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET-CONFIG_SYS_PROM_SIZE)
  178. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_PROM_OFFSET-32)
  179. #define CONFIG_SYS_STACK_SIZE (0x10000-32)
  180. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  181. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
  182. # define CONFIG_SYS_RAMBOOT 1
  183. #endif
  184. #define CONFIG_SYS_MONITOR_LEN (512 << 10) /* Reserve 512 kB for Monitor */
  185. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  186. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  187. #define CONFIG_SYS_MALLOC_END (CONFIG_SYS_INIT_SP_OFFSET-CONFIG_SYS_STACK_SIZE)
  188. #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MALLOC_END-CONFIG_SYS_MALLOC_LEN)
  189. /* relocated monitor area */
  190. #define CONFIG_SYS_RELOC_MONITOR_MAX_END CONFIG_SYS_MALLOC_BASE
  191. #define CONFIG_SYS_RELOC_MONITOR_BASE (CONFIG_SYS_RELOC_MONITOR_MAX_END-CONFIG_SYS_MONITOR_LEN)
  192. /* make un relocated address from relocated address */
  193. #define UN_RELOC(address) (address-(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE))
  194. /*
  195. * Ethernet configuration uses on board SMC91C111, however if a mezzanine
  196. * with a PHY is attached the GRETH can be used on this board.
  197. * Define USE_GRETH in order to use the mezzanine provided PHY with the
  198. * onchip GRETH network MAC, note that this is not supported by the
  199. * template design.
  200. */
  201. #ifndef USE_GRETH
  202. /* USE SMC91C111 MAC */
  203. #define CONFIG_SMC91111 1
  204. #define CONFIG_SMC91111_BASE 0x20000300 /* chip select 3 */
  205. #define CONFIG_SMC_USE_32_BIT 1 /* 32 bit bus */
  206. #undef CONFIG_SMC_91111_EXT_PHY /* we use internal phy */
  207. /*#define CONFIG_SHOW_ACTIVITY*/
  208. #define CONFIG_NET_RETRY_COUNT 10 /* # of retries */
  209. #else
  210. /* USE GRETH Ethernet Driver */
  211. #define CONFIG_GRETH 1
  212. #endif
  213. #define CONFIG_PHY_ADDR 0x00
  214. /*
  215. * Miscellaneous configurable options
  216. */
  217. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  218. #if defined(CONFIG_CMD_KGDB)
  219. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  220. #else
  221. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  222. #endif
  223. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  224. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  225. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  226. #define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */
  227. #define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  228. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  229. /*-----------------------------------------------------------------------
  230. * USB stuff
  231. *-----------------------------------------------------------------------
  232. */
  233. #define CONFIG_USB_CLOCK 0x0001BBBB
  234. #define CONFIG_USB_CONFIG 0x00005000
  235. /***** Gaisler GRLIB IP-Cores Config ********/
  236. #define CONFIG_SYS_GRLIB_SDRAM 0
  237. /* No SDRAM Configuration */
  238. #undef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
  239. /* See, GRLIB Docs (grip.pdf) on how to set up
  240. * These the memory controller registers.
  241. */
  242. #define CONFIG_SYS_GRLIB_ESA_MCTRL1
  243. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG1 (0x10f800ff | (1<<11))
  244. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x00000000
  245. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG3 0x00000000
  246. /* GRLIB FT-MCTRL configuration */
  247. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
  248. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG1 (0x10f800ff | (1<<11))
  249. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2 0x00000000
  250. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG3 0x00000000
  251. /* DDR controller */
  252. #define CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
  253. #define CONFIG_SYS_GRLIB_GAISLER_DDRSPA1_CTRL 0xa900830a
  254. /* no DDR2 Controller */
  255. #undef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
  256. /* default kernel command line */
  257. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  258. #endif /* __CONFIG_H */