gr_xc3s_1500.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /* Configuration header file for Gaisler GR-XC3S-1500
  2. * spartan 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. #define CONFIG_GRXC3S1500 1 /* ... on GR-XC3S-1500 board */
  19. /* CPU / AMBA BUS configuration */
  20. #define CONFIG_SYS_CLK_FREQ 40000000 /* 40MHz */
  21. /*
  22. * Serial console configuration
  23. */
  24. #define CONFIG_BAUDRATE 38400 /* ... at 38400 bps */
  25. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  26. /* Partitions */
  27. #define CONFIG_DOS_PARTITION
  28. #define CONFIG_MAC_PARTITION
  29. #define CONFIG_ISO_PARTITION
  30. /*
  31. * Supported commands
  32. */
  33. #define CONFIG_CMD_REGINFO
  34. #define CONFIG_CMD_DIAG
  35. #define CONFIG_CMD_IRQ
  36. /*
  37. * Autobooting
  38. */
  39. #define CONFIG_PREBOOT "echo;" \
  40. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  41. "echo"
  42. #undef CONFIG_BOOTARGS
  43. #define CONFIG_EXTRA_ENV_SETTINGS \
  44. "netdev=eth0\0" \
  45. "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
  46. "nfsroot=${serverip}:${rootpath}\0" \
  47. "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0" \
  48. "addip=setenv bootargs ${bootargs} " \
  49. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  50. ":${hostname}:${netdev}:off panic=1\0" \
  51. "flash_nfs=run nfsargs addip;" \
  52. "bootm ${kernel_addr}\0" \
  53. "flash_self=run ramargs addip;" \
  54. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  55. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  56. "scratch=40200000\0" \
  57. "getkernel=tftpboot $(scratch) $(bootfile)\0" \
  58. "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:grxc3s1500_daniel:eth0\0" \
  59. ""
  60. #define CONFIG_NETMASK 255.255.255.0
  61. #define CONFIG_GATEWAYIP 192.168.0.1
  62. #define CONFIG_SERVERIP 192.168.0.20
  63. #define CONFIG_IPADDR 192.168.0.206
  64. #define CONFIG_ROOTPATH "/export/rootfs"
  65. #define CONFIG_HOSTNAME grxc3s1500
  66. #define CONFIG_BOOTFILE "/uImage"
  67. #define CONFIG_BOOTCOMMAND "run flash_self"
  68. /* Memory MAP
  69. *
  70. * Flash:
  71. * |--------------------------------|
  72. * | 0x00000000 Text & Data & BSS | *
  73. * | for Monitor | *
  74. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  75. * | UNUSED / Growth | * 256kb
  76. * |--------------------------------|
  77. * | 0x00050000 Base custom area | *
  78. * | kernel / FS | *
  79. * | | * Rest of Flash
  80. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  81. * | END-0x00008000 Environment | * 32kb
  82. * |--------------------------------|
  83. *
  84. *
  85. *
  86. * Main Memory:
  87. * |--------------------------------|
  88. * | UNUSED / scratch area |
  89. * | |
  90. * | |
  91. * | |
  92. * | |
  93. * |--------------------------------|
  94. * | Monitor .Text / .DATA / .BSS | * 256kb
  95. * | Relocated! | *
  96. * |--------------------------------|
  97. * | Monitor Malloc | * 128kb (contains relocated environment)
  98. * |--------------------------------|
  99. * | Monitor/kernel STACK | * 64kb
  100. * |--------------------------------|
  101. * | Page Table for MMU systems | * 2k
  102. * |--------------------------------|
  103. * | PROM Code accessed from Linux | * 6kb-128b
  104. * |--------------------------------|
  105. * | Global data (avail from kernel)| * 128b
  106. * |--------------------------------|
  107. *
  108. */
  109. /*
  110. * Flash configuration (8,16 or 32 MB)
  111. * TEXT base always at 0xFFF00000
  112. * ENV_ADDR always at 0xFFF40000
  113. * FLASH_BASE at 0xFC000000 for 64 MB
  114. * 0xFE000000 for 32 MB
  115. * 0xFF000000 for 16 MB
  116. * 0xFF800000 for 8 MB
  117. */
  118. /*#define CONFIG_SYS_NO_FLASH 1*/
  119. #define CONFIG_SYS_FLASH_BASE 0x00000000
  120. #define CONFIG_SYS_FLASH_SIZE 0x00800000
  121. #define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors */
  122. #define CONFIG_SYS_MAX_FLASH_SECT 64 /* max num of sects on one chip */
  123. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */
  124. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  125. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  126. #define CONFIG_SYS_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  127. #define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  128. #define CONFIG_SYS_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  129. /*** CFI CONFIG ***/
  130. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  131. #define CONFIG_FLASH_CFI_DRIVER
  132. #define CONFIG_SYS_FLASH_CFI
  133. /* Bypass cache when reading regs from flash memory */
  134. #define CONFIG_SYS_FLASH_CFI_BYPASS_READ
  135. /* Buffered writes (32byte/go) instead of single accesses */
  136. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  137. /*
  138. * Environment settings
  139. */
  140. /*#define CONFIG_ENV_IS_NOWHERE 1*/
  141. #define CONFIG_ENV_IS_IN_FLASH 1
  142. /* CONFIG_ENV_ADDR need to be at sector boundary */
  143. #define CONFIG_ENV_SIZE 0x8000
  144. #define CONFIG_ENV_SECT_SIZE 0x20000
  145. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE+CONFIG_SYS_FLASH_SIZE-CONFIG_ENV_SECT_SIZE)
  146. #define CONFIG_ENV_OVERWRITE 1
  147. /*
  148. * Memory map
  149. */
  150. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  151. #define CONFIG_SYS_SDRAM_SIZE 0x4000000
  152. #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_SDRAM_SIZE)
  153. /* no SRAM available */
  154. #undef CONFIG_SYS_SRAM_BASE
  155. #undef CONFIG_SYS_SRAM_SIZE
  156. /* Always Run U-Boot from SDRAM */
  157. #define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE
  158. #define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE
  159. #define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END
  160. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_RAM_END - GENERATED_GBL_DATA_SIZE)
  161. #define CONFIG_SYS_PROM_SIZE (8192-GENERATED_GBL_DATA_SIZE)
  162. #define CONFIG_SYS_PROM_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET-CONFIG_SYS_PROM_SIZE)
  163. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_PROM_OFFSET-32)
  164. #define CONFIG_SYS_STACK_SIZE (0x10000-32)
  165. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  166. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
  167. # define CONFIG_SYS_RAMBOOT 1
  168. #endif
  169. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  170. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  171. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  172. #define CONFIG_SYS_MALLOC_END (CONFIG_SYS_INIT_SP_OFFSET-CONFIG_SYS_STACK_SIZE)
  173. #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MALLOC_END-CONFIG_SYS_MALLOC_LEN)
  174. /* relocated monitor area */
  175. #define CONFIG_SYS_RELOC_MONITOR_MAX_END CONFIG_SYS_MALLOC_BASE
  176. #define CONFIG_SYS_RELOC_MONITOR_BASE (CONFIG_SYS_RELOC_MONITOR_MAX_END-CONFIG_SYS_MONITOR_LEN)
  177. /* make un relocated address from relocated address */
  178. #define UN_RELOC(address) (address-(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE))
  179. /*
  180. * Ethernet configuration
  181. */
  182. #define CONFIG_GRETH 1
  183. #define CONFIG_PHY_ADDR 0x00
  184. /*
  185. * Miscellaneous configurable options
  186. */
  187. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  188. #if defined(CONFIG_CMD_KGDB)
  189. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  190. #else
  191. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  192. #endif
  193. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  194. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  195. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  196. #define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */
  197. #define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  198. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  199. /*
  200. * Various low-level settings
  201. */
  202. /*-----------------------------------------------------------------------
  203. * USB stuff
  204. *-----------------------------------------------------------------------
  205. */
  206. #define CONFIG_USB_CLOCK 0x0001BBBB
  207. #define CONFIG_USB_CONFIG 0x00005000
  208. /***** Gaisler GRLIB IP-Cores Config ********/
  209. #define CONFIG_SYS_GRLIB_SDRAM 0
  210. /* No SDRAM Configuration */
  211. #undef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
  212. /* See, GRLIB Docs (grip.pdf) on how to set up
  213. * These the memory controller registers.
  214. */
  215. #define CONFIG_SYS_GRLIB_ESA_MCTRL1
  216. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG1 (0x000000ff | (1<<11))
  217. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x82206000
  218. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG3 0x00136000
  219. /* GRLIB FT-MCTRL configuration */
  220. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
  221. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG1 (0x000000ff | (1<<11))
  222. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2 0x82206000
  223. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG3 0x00136000
  224. /* no DDR controller */
  225. #undef CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
  226. /* no DDR2 Controller */
  227. #undef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
  228. /* default kernel command line */
  229. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  230. #endif /* __CONFIG_H */