gr_cpci_ax2000.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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. * SPDX-License-Identifier: GPL-2.0+
  12. */
  13. #ifndef __CONFIG_H__
  14. #define __CONFIG_H__
  15. /*
  16. * High Level Configuration Options
  17. * (easy to change)
  18. */
  19. #define CONFIG_CPCI_AX2000 1 /* ... on GR-CPCI-AX2000 board */
  20. #define CONFIG_LEON_RAM_SRAM 1
  21. #define CONFIG_LEON_RAM_SDRAM 2
  22. #define CONFIG_LEON_RAM_SDRAM_NOSRAM 3
  23. /* Select Memory to run from
  24. *
  25. * SRAM - UBoot is run in SRAM, SRAM-0x40000000, SDRAM-0x60000000
  26. * SDRAM - UBoot is run in SDRAM, SRAM-0x40000000 and SDRAM-0x60000000
  27. * SDRAM_NOSRAM - UBoot is run in SDRAM, SRAM not available, SDRAM at 0x40000000
  28. *
  29. * Note, if Linux is to be used, SDRAM or SDRAM_NOSRAM is required since
  30. * it doesn't fit into the 4Mb SRAM.
  31. *
  32. * SRAM is default since it will work for all systems, however will not
  33. * be able to boot linux.
  34. */
  35. #define CONFIG_LEON_RAM_SELECT CONFIG_LEON_RAM_SRAM
  36. /* CPU / AMBA BUS configuration */
  37. #define CONFIG_SYS_CLK_FREQ 20000000 /* 20MHz */
  38. /*
  39. * Serial console configuration
  40. */
  41. #define CONFIG_BAUDRATE 38400 /* ... at 38400 bps */
  42. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  43. /* Partitions */
  44. #define CONFIG_DOS_PARTITION
  45. #define CONFIG_MAC_PARTITION
  46. #define CONFIG_ISO_PARTITION
  47. /*
  48. * Supported commands
  49. */
  50. #define CONFIG_CMD_REGINFO
  51. #define CONFIG_CMD_DIAG
  52. #define CONFIG_CMD_IRQ
  53. /*
  54. * Autobooting
  55. */
  56. #define CONFIG_PREBOOT "echo;" \
  57. "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
  58. "echo"
  59. #undef CONFIG_BOOTARGS
  60. #define CONFIG_EXTRA_ENV_SETTINGS_BASE \
  61. "netdev=eth0\0" \
  62. "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
  63. "nfsroot=${serverip}:${rootpath}\0" \
  64. "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0" \
  65. "addip=setenv bootargs ${bootargs} " \
  66. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
  67. ":${hostname}:${netdev}:off panic=1\0" \
  68. "flash_nfs=run nfsargs addip;" \
  69. "bootm ${kernel_addr}\0" \
  70. "flash_self=run ramargs addip;" \
  71. "bootm ${kernel_addr} ${ramdisk_addr}\0" \
  72. "getkernel=tftpboot $(scratch) $(bootfile)\0" \
  73. "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"
  74. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
  75. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  76. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  77. "scratch=40200000\0" \
  78. ""
  79. #elif CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM
  80. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  81. "net_nfs=tftp 60000000 ${bootfile};run nfsargs addip;bootm\0" \
  82. "scratch=60800000\0" \
  83. ""
  84. #else
  85. /* More than 4Mb is assumed when running from SDRAM */
  86. #define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
  87. "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \
  88. "scratch=40800000\0" \
  89. ""
  90. #endif
  91. #define CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_ENV_SETTINGS_BASE CONFIG_EXTRA_ENV_SETTINGS_SELECT
  92. #define CONFIG_NETMASK 255.255.255.0
  93. #define CONFIG_GATEWAYIP 192.168.0.1
  94. #define CONFIG_SERVERIP 192.168.0.20
  95. #define CONFIG_IPADDR 192.168.0.206
  96. #define CONFIG_ROOTPATH "/export/rootfs"
  97. #define CONFIG_HOSTNAME ax2000
  98. #define CONFIG_BOOTFILE "/uImage"
  99. #define CONFIG_BOOTCOMMAND "run flash_self"
  100. /* Memory MAP
  101. *
  102. * Flash:
  103. * |--------------------------------|
  104. * | 0x00000000 Text & Data & BSS | *
  105. * | for Monitor | *
  106. * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
  107. * | UNUSED / Growth | * 256kb
  108. * |--------------------------------|
  109. * | 0x00050000 Base custom area | *
  110. * | kernel / FS | *
  111. * | | * Rest of Flash
  112. * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  113. * | END-0x00008000 Environment | * 32kb
  114. * |--------------------------------|
  115. *
  116. *
  117. *
  118. * Main Memory (4Mb SRAM or XMb SDRAM):
  119. * |--------------------------------|
  120. * | UNUSED / scratch area |
  121. * | |
  122. * | |
  123. * | |
  124. * | |
  125. * |--------------------------------|
  126. * | Monitor .Text / .DATA / .BSS | * 256kb
  127. * | Relocated! | *
  128. * |--------------------------------|
  129. * | Monitor Malloc | * 128kb (contains relocated environment)
  130. * |--------------------------------|
  131. * | Monitor/kernel STACK | * 64kb
  132. * |--------------------------------|
  133. * | Page Table for MMU systems | * 2k
  134. * |--------------------------------|
  135. * | PROM Code accessed from Linux | * 6kb-128b
  136. * |--------------------------------|
  137. * | Global data (avail from kernel)| * 128b
  138. * |--------------------------------|
  139. *
  140. */
  141. /*
  142. * Flash configuration (8,16 or 32 MB)
  143. * TEXT base always at 0xFFF00000
  144. * ENV_ADDR always at 0xFFF40000
  145. * FLASH_BASE at 0xFC000000 for 64 MB
  146. * 0xFE000000 for 32 MB
  147. * 0xFF000000 for 16 MB
  148. * 0xFF800000 for 8 MB
  149. */
  150. /*#define CONFIG_SYS_NO_FLASH 1*/
  151. #define CONFIG_SYS_FLASH_BASE 0x00000000
  152. #define CONFIG_SYS_FLASH_SIZE 0x00800000
  153. #define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors */
  154. #define CONFIG_SYS_MAX_FLASH_SECT 64 /* max num of sects on one chip */
  155. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */
  156. #define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */
  157. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  158. #define CONFIG_SYS_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */
  159. #define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */
  160. #define CONFIG_SYS_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  161. /*** CFI CONFIG ***/
  162. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  163. #define CONFIG_FLASH_CFI_DRIVER
  164. #define CONFIG_SYS_FLASH_CFI
  165. /* Bypass cache when reading regs from flash memory */
  166. #define CONFIG_SYS_FLASH_CFI_BYPASS_READ
  167. /* Buffered writes (32byte/go) instead of single accesses */
  168. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  169. /*
  170. * Environment settings
  171. */
  172. /*#define CONFIG_ENV_IS_NOWHERE 1*/
  173. #define CONFIG_ENV_IS_IN_FLASH 1
  174. /* CONFIG_ENV_ADDR need to be at sector boundary */
  175. #define CONFIG_ENV_SIZE 0x8000
  176. #define CONFIG_ENV_SECT_SIZE 0x20000
  177. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE+CONFIG_SYS_FLASH_SIZE-CONFIG_ENV_SECT_SIZE)
  178. #define CONFIG_ENV_OVERWRITE 1
  179. /*
  180. * Memory map
  181. *
  182. * Always 4Mb SRAM available
  183. * SDRAM module may be available on 0x60000000, SDRAM
  184. * is configured as if a 128Mb SDRAM module is available.
  185. */
  186. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  187. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  188. #else
  189. #define CONFIG_SYS_SDRAM_BASE 0x60000000
  190. #endif
  191. #define CONFIG_SYS_SDRAM_SIZE 0x08000000
  192. #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_SDRAM_SIZE)
  193. /* 4Mb SRAM available */
  194. #if CONFIG_LEON_RAM_SELECT != CONFIG_LEON_RAM_SDRAM_NOSRAM
  195. #define CONFIG_SYS_SRAM_BASE 0x40000000
  196. #define CONFIG_SYS_SRAM_SIZE 0x400000
  197. #define CONFIG_SYS_SRAM_END (CONFIG_SYS_SRAM_BASE+CONFIG_SYS_SRAM_SIZE)
  198. #endif
  199. /* Select RAM used to run U-BOOT from... */
  200. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
  201. #define CONFIG_SYS_RAM_BASE CONFIG_SYS_SRAM_BASE
  202. #define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SRAM_SIZE
  203. #define CONFIG_SYS_RAM_END CONFIG_SYS_SRAM_END
  204. #else
  205. #define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE
  206. #define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE
  207. #define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END
  208. #endif
  209. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_RAM_END - GENERATED_GBL_DATA_SIZE)
  210. #define CONFIG_SYS_PROM_SIZE (8192-GENERATED_GBL_DATA_SIZE)
  211. #define CONFIG_SYS_PROM_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET-CONFIG_SYS_PROM_SIZE)
  212. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_PROM_OFFSET-32)
  213. #define CONFIG_SYS_STACK_SIZE (0x10000-32)
  214. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  215. #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
  216. # define CONFIG_SYS_RAMBOOT 1
  217. #endif
  218. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  219. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  220. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  221. #define CONFIG_SYS_MALLOC_END (CONFIG_SYS_INIT_SP_OFFSET-CONFIG_SYS_STACK_SIZE)
  222. #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MALLOC_END-CONFIG_SYS_MALLOC_LEN)
  223. /* relocated monitor area */
  224. #define CONFIG_SYS_RELOC_MONITOR_MAX_END CONFIG_SYS_MALLOC_BASE
  225. #define CONFIG_SYS_RELOC_MONITOR_BASE (CONFIG_SYS_RELOC_MONITOR_MAX_END-CONFIG_SYS_MONITOR_LEN)
  226. /* make un relocated address from relocated address */
  227. #define UN_RELOC(address) (address-(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE))
  228. /*
  229. * Ethernet configuration uses on board SMC91C111
  230. */
  231. #define CONFIG_SMC91111 1
  232. #define CONFIG_SMC91111_BASE 0x20000300 /* chip select 3 */
  233. #define CONFIG_SMC_USE_32_BIT 1 /* 32 bit bus */
  234. #undef CONFIG_SMC_91111_EXT_PHY /* we use internal phy */
  235. /*#define CONFIG_SHOW_ACTIVITY*/
  236. #define CONFIG_NET_RETRY_COUNT 10 /* # of retries */
  237. #define CONFIG_PHY_ADDR 0x00
  238. /*
  239. * Miscellaneous configurable options
  240. */
  241. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  242. #if defined(CONFIG_CMD_KGDB)
  243. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  244. #else
  245. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  246. #endif
  247. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  248. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  249. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  250. #define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */
  251. #define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
  252. #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
  253. /*
  254. * Various low-level settings
  255. */
  256. /*-----------------------------------------------------------------------
  257. * USB stuff
  258. *-----------------------------------------------------------------------
  259. */
  260. #define CONFIG_USB_CLOCK 0x0001BBBB
  261. #define CONFIG_USB_CONFIG 0x00005000
  262. /***** Gaisler GRLIB IP-Cores Config ********/
  263. #define CONFIG_SYS_GRLIB_SDRAM 0
  264. /* No SDRAM Configuration */
  265. #undef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
  266. /* See, GRLIB Docs (grip.pdf) on how to set up
  267. * These the memory controller registers.
  268. */
  269. #define CONFIG_SYS_GRLIB_ESA_MCTRL1
  270. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG1 (0x10f800ff | (1<<11))
  271. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  272. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x82206000
  273. #else
  274. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2 0x82205260
  275. #endif
  276. #define CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG3 0x0809a000
  277. /* GRLIB FT-MCTRL configuration */
  278. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
  279. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG1 (0x10f800ff | (1<<11))
  280. #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
  281. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2 0x82206000
  282. #else
  283. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2 0x82205260
  284. #endif
  285. #define CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG3 0x0809a000
  286. /* no DDR controller */
  287. #undef CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
  288. /* no DDR2 Controller */
  289. #undef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
  290. /* default kernel command line */
  291. #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
  292. #endif /* __CONFIG_H */