astro_mcf5373l.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. /*
  2. * Configuration settings for the Sentec Cobra Board.
  3. *
  4. * (C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. /*
  9. * configuration for ASTRO "Urmel" board.
  10. * Originating from Cobra5272 configuration, messed up by
  11. * Wolfgang Wegner <w.wegner@astro-kom.de>
  12. * Please do not bother the original author with bug reports
  13. * concerning this file.
  14. */
  15. #ifndef _CONFIG_ASTRO_MCF5373L_H
  16. #define _CONFIG_ASTRO_MCF5373L_H
  17. #include <linux/stringify.h>
  18. /*
  19. * set the card type to actually compile for; either of
  20. * the possibilities listed below has to be used!
  21. */
  22. #define CONFIG_ASTRO_V532 1
  23. #if CONFIG_ASTRO_V532
  24. #define ASTRO_ID 0xF8
  25. #elif CONFIG_ASTRO_V512
  26. #define ASTRO_ID 0xFA
  27. #elif CONFIG_ASTRO_TWIN7S2
  28. #define ASTRO_ID 0xF9
  29. #elif CONFIG_ASTRO_V912
  30. #define ASTRO_ID 0xFC
  31. #elif CONFIG_ASTRO_COFDMDUOS2
  32. #define ASTRO_ID 0xFB
  33. #else
  34. #error No card type defined!
  35. #endif
  36. #define CONFIG_ASTRO5373L /* define board type */
  37. /* Command line configuration */
  38. /*
  39. * CONFIG_RAM defines if u-boot is loaded via BDM (or started from
  40. * a different bootloader that has already performed RAM setup) or
  41. * started directly from flash, which is the regular case for production
  42. * boards.
  43. */
  44. #ifdef CONFIG_RAM
  45. #define CONFIG_MONITOR_IS_IN_RAM
  46. #define CONFIG_SYS_TEXT_BASE 0x40020000
  47. #define ENABLE_JFFS 0
  48. #else
  49. #define CONFIG_SYS_TEXT_BASE 0x00000000
  50. #define ENABLE_JFFS 1
  51. #endif
  52. /* Define which commands should be available at u-boot command prompt */
  53. #define CONFIG_CMD_DATE
  54. #if ENABLE_JFFS
  55. #define CONFIG_CMD_JFFS2
  56. #endif
  57. #define CONFIG_CMD_REGINFO
  58. #define CONFIG_CMD_FPGA_LOADMK
  59. #define CONFIG_CMDLINE_EDITING
  60. #define CONFIG_MCFRTC
  61. #undef RTC_DEBUG
  62. /* Timer */
  63. #define CONFIG_MCFTMR
  64. #undef CONFIG_MCFPIT
  65. /* I2C */
  66. #define CONFIG_SYS_I2C
  67. #define CONFIG_SYS_I2C_FSL
  68. #define CONFIG_SYS_FSL_I2C_SPEED 80000
  69. #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
  70. #define CONFIG_SYS_FSL_I2C_OFFSET 0x58000
  71. #define CONFIG_SYS_IMMR CONFIG_SYS_MBAR
  72. /*
  73. * Defines processor clock - important for correct timings concerning serial
  74. * interface etc.
  75. */
  76. #define CONFIG_SYS_CLK 80000000
  77. #define CONFIG_SYS_CPU_CLK (CONFIG_SYS_CLK * 3)
  78. #define CONFIG_SYS_SDRAM_SIZE 32 /* SDRAM size in MB */
  79. #define CONFIG_SYS_CORE_SRAM_SIZE 0x8000
  80. #define CONFIG_SYS_CORE_SRAM 0x80000000
  81. #define CONFIG_SYS_UNIFY_CACHE
  82. /*
  83. * Define baudrate for UART1 (console output, tftp, ...)
  84. * default value of CONFIG_BAUDRATE for Sentec board: 19200 baud
  85. * CONFIG_SYS_BAUDRATE_TABLE defines values that can be selected
  86. * in u-boot command interface
  87. */
  88. #define CONFIG_BAUDRATE 115200
  89. #define CONFIG_MCFUART
  90. #define CONFIG_SYS_UART_PORT (2)
  91. #define CONFIG_SYS_UART2_ALT3_GPIO
  92. /*
  93. * Watchdog configuration; Watchdog is disabled for running from RAM
  94. * and set to highest possible value else. Beware there is no check
  95. * in the watchdog code to validate the timeout value set here!
  96. */
  97. #ifndef CONFIG_MONITOR_IS_IN_RAM
  98. #define CONFIG_WATCHDOG
  99. #define CONFIG_WATCHDOG_TIMEOUT 3355 /* timeout in milliseconds */
  100. #endif
  101. /*
  102. * Configuration for environment
  103. * Environment is located in the last sector of the flash
  104. */
  105. #ifndef CONFIG_MONITOR_IS_IN_RAM
  106. #define CONFIG_ENV_OFFSET 0x1FF8000
  107. #define CONFIG_ENV_SECT_SIZE 0x8000
  108. #define CONFIG_ENV_IS_IN_FLASH 1
  109. #else
  110. /*
  111. * environment in RAM - This is used to use a single PC-based application
  112. * to load an image, load U-Boot, load an environment and then start U-Boot
  113. * to execute the commands from the environment. Feedback is done via setting
  114. * and reading memory locations.
  115. */
  116. #define CONFIG_ENV_ADDR 0x40060000
  117. #define CONFIG_ENV_SECT_SIZE 0x8000
  118. #define CONFIG_ENV_IS_IN_FLASH 1
  119. #endif
  120. /* here we put our FPGA configuration... */
  121. #define CONFIG_MISC_INIT_R 1
  122. /* Define user parameters that have to be customized most likely */
  123. /* AUTOBOOT settings - booting images automatically by u-boot after power on */
  124. /*
  125. * The following settings will be contained in the environment block ; if you
  126. * want to use a neutral environment all those settings can be manually set in
  127. * u-boot: 'set' command
  128. */
  129. #define CONFIG_EXTRA_ENV_SETTINGS \
  130. "loaderversion=11\0" \
  131. "card_id="__stringify(ASTRO_ID)"\0" \
  132. "alterafile=0\0" \
  133. "xilinxfile=0\0" \
  134. "xilinxload=imxtract 0x540000 $xilinxfile 0x41000000&&"\
  135. "fpga load 0 0x41000000 $filesize\0" \
  136. "alteraload=imxtract 0x6c0000 $alterafile 0x41000000&&"\
  137. "fpga load 1 0x41000000 $filesize\0" \
  138. "env_default=1\0" \
  139. "env_check=if test $env_default -eq 1;"\
  140. " then setenv env_default 0;saveenv;fi\0"
  141. /*
  142. * "update" is a non-standard command that has to be supplied
  143. * by external update.c; This is not included in mainline because
  144. * it needs non-blocking CFI routines.
  145. */
  146. #ifdef CONFIG_MONITOR_IS_IN_RAM
  147. #define CONFIG_BOOTCOMMAND "" /* no autoboot in this case */
  148. #else
  149. #if CONFIG_ASTRO_V532
  150. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  151. "run xilinxload&&run alteraload&&bootm 0x80000;"\
  152. "update;reset"
  153. #else
  154. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  155. "run xilinxload&&bootm 0x80000;update;reset"
  156. #endif
  157. #endif
  158. /* default bootargs that are considered during boot */
  159. #define CONFIG_BOOTARGS " console=ttyS2,115200 rootfstype=romfs"\
  160. " loaderversion=$loaderversion"
  161. /* default RAM address for user programs */
  162. #define CONFIG_SYS_LOAD_ADDR 0x20000
  163. #define CONFIG_SYS_LONGHELP
  164. #if (CONFIG_COMMANDS & CONFIG_CMD_KGDB)
  165. #define CONFIG_SYS_CBSIZE 1024
  166. #else
  167. #define CONFIG_SYS_CBSIZE 256
  168. #endif
  169. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  170. #define CONFIG_SYS_MAXARGS 16
  171. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  172. #define CONFIG_FPGA_COUNT 1
  173. #define CONFIG_FPGA
  174. #define CONFIG_FPGA_XILINX
  175. #define CONFIG_FPGA_SPARTAN3
  176. #define CONFIG_FPGA_ALTERA
  177. #define CONFIG_FPGA_CYCLON2
  178. #define CONFIG_SYS_FPGA_PROG_FEEDBACK
  179. #define CONFIG_SYS_FPGA_WAIT 1000
  180. /* End of user parameters to be customized */
  181. /* Defines memory range for test */
  182. #define CONFIG_SYS_MEMTEST_START 0x40020000
  183. #define CONFIG_SYS_MEMTEST_END 0x41ffffff
  184. /*
  185. * Low Level Configuration Settings
  186. * (address mappings, register initial values, etc.)
  187. * You should know what you are doing if you make changes here.
  188. */
  189. /* Base register address */
  190. #define CONFIG_SYS_MBAR 0xFC000000 /* Register Base Addrs */
  191. /* System Conf. Reg. & System Protection Reg. */
  192. #define CONFIG_SYS_SCR 0x0003;
  193. #define CONFIG_SYS_SPR 0xffff;
  194. /*
  195. * Definitions for initial stack pointer and data area (in internal SRAM)
  196. */
  197. #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000
  198. #define CONFIG_SYS_INIT_RAM_SIZE 0x8000
  199. #define CONFIG_SYS_INIT_RAM_CTRL 0x221
  200. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
  201. GENERATED_GBL_DATA_SIZE)
  202. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  203. /*
  204. * Start addresses for the final memory configuration
  205. * (Set up by the startup code)
  206. * for MCF5373, the allowable range is 0x40000000 to 0x7FF00000
  207. */
  208. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  209. /*
  210. * Chipselect bank definitions
  211. *
  212. * CS0 - Flash 32MB (first 16MB)
  213. * CS1 - Flash 32MB (second half)
  214. * CS2 - FPGA
  215. * CS3 - FPGA
  216. * CS4 - unused
  217. * CS5 - unused
  218. */
  219. #define CONFIG_SYS_CS0_BASE 0
  220. #define CONFIG_SYS_CS0_MASK 0x00ff0001
  221. #define CONFIG_SYS_CS0_CTRL 0x00001fc0
  222. #define CONFIG_SYS_CS1_BASE 0x01000000
  223. #define CONFIG_SYS_CS1_MASK 0x00ff0001
  224. #define CONFIG_SYS_CS1_CTRL 0x00001fc0
  225. #define CONFIG_SYS_CS2_BASE 0x20000000
  226. #define CONFIG_SYS_CS2_MASK 0x00ff0001
  227. #define CONFIG_SYS_CS2_CTRL 0x0000fec0
  228. #define CONFIG_SYS_CS3_BASE 0x21000000
  229. #define CONFIG_SYS_CS3_MASK 0x00ff0001
  230. #define CONFIG_SYS_CS3_CTRL 0x0000fec0
  231. #define CONFIG_SYS_FLASH_BASE 0x00000000
  232. #ifdef CONFIG_MONITOR_IS_IN_RAM
  233. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  234. #else
  235. /* This is mainly used during relocation in start.S */
  236. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)
  237. #endif
  238. /* Reserve 256 kB for Monitor */
  239. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  240. #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024)
  241. /* Reserve 128 kB for malloc() */
  242. #define CONFIG_SYS_MALLOC_LEN (128 << 10)
  243. /*
  244. * For booting Linux, the board info and command line data
  245. * have to be in the first 8 MB of memory, since this is
  246. * the maximum mapped by the Linux kernel during initialization ??
  247. */
  248. #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \
  249. (CONFIG_SYS_SDRAM_SIZE << 20))
  250. /* FLASH organization */
  251. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  252. #define CONFIG_SYS_MAX_FLASH_SECT 259
  253. #define CONFIG_SYS_FLASH_ERASE_TOUT 1000
  254. #define CONFIG_SYS_FLASH_CFI 1
  255. #define CONFIG_FLASH_CFI_DRIVER 1
  256. #define CONFIG_SYS_FLASH_SIZE 0x2000000
  257. #define CONFIG_SYS_FLASH_PROTECTION 1
  258. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
  259. #define CONFIG_SYS_FLASH_CFI_NONBLOCK 1
  260. #define LDS_BOARD_TEXT \
  261. . = DEFINED(env_offset) ? env_offset : .; \
  262. common/env_embedded.o (.text*)
  263. #if ENABLE_JFFS
  264. /* JFFS Partition offset set */
  265. #define CONFIG_SYS_JFFS2_FIRST_BANK 0
  266. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  267. /* 512k reserved for u-boot */
  268. #define CONFIG_SYS_JFFS2_FIRST_SECTOR 0x40
  269. #endif
  270. /* Cache Configuration */
  271. #define CONFIG_SYS_CACHELINE_SIZE 16
  272. #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  273. CONFIG_SYS_INIT_RAM_SIZE - 8)
  274. #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  275. CONFIG_SYS_INIT_RAM_SIZE - 4)
  276. #define CONFIG_SYS_ICACHE_INV (CF_CACR_CINVA)
  277. #define CONFIG_SYS_CACHE_ACR0 (CONFIG_SYS_SDRAM_BASE | \
  278. CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
  279. CF_ACR_EN | CF_ACR_SM_ALL)
  280. #define CONFIG_SYS_CACHE_ICACR (CF_CACR_EC | CF_CACR_CINVA | \
  281. CF_CACR_DCM_P)
  282. #endif /* _CONFIG_ASTRO_MCF5373L_H */