astro_mcf5373l.h 8.1 KB

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