astro_mcf5373l.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. /*
  2. * Configuration settings for the Sentec Cobra Board.
  3. *
  4. * (C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. /*
  25. * configuration for ASTRO "Urmel" board.
  26. * Originating from Cobra5272 configuration, messed up by
  27. * Wolfgang Wegner <w.wegner@astro-kom.de>
  28. * Please do not bother the original author with bug reports
  29. * concerning this file.
  30. */
  31. #ifndef _CONFIG_ASTRO_MCF5373L_H
  32. #define _CONFIG_ASTRO_MCF5373L_H
  33. /*
  34. * set the card type to actually compile for; either of
  35. * the possibilities listed below has to be used!
  36. */
  37. #define CONFIG_ASTRO_V532 1
  38. #if CONFIG_ASTRO_V532
  39. #define ASTRO_ID 0xF8
  40. #elif CONFIG_ASTRO_V512
  41. #define ASTRO_ID 0xFA
  42. #elif CONFIG_ASTRO_TWIN7S2
  43. #define ASTRO_ID 0xF9
  44. #elif CONFIG_ASTRO_V912
  45. #define ASTRO_ID 0xFC
  46. #elif CONFIG_ASTRO_COFDMDUOS2
  47. #define ASTRO_ID 0xFB
  48. #else
  49. #error No card type defined!
  50. #endif
  51. /*
  52. * Define processor
  53. * possible values for Urmel board: only Coldfire M5373 processor supported
  54. * (please do not change)
  55. */
  56. /* it seems not clear yet which processor defines we should use */
  57. #define CONFIG_MCF537x /* define processor family */
  58. #define CONFIG_MCF532x /* define processor family */
  59. #define CONFIG_M5373 /* define processor type */
  60. #define CONFIG_ASTRO5373L /* define board type */
  61. /* Command line configuration */
  62. #include <config_cmd_default.h>
  63. /*
  64. * CONFIG_RAM defines if u-boot is loaded via BDM (or started from
  65. * a different bootloader that has already performed RAM setup) or
  66. * started directly from flash, which is the regular case for production
  67. * boards.
  68. */
  69. #ifdef CONFIG_RAM
  70. #define CONFIG_MONITOR_IS_IN_RAM
  71. #define CONFIG_SYS_TEXT_BASE 0x40020000
  72. #define ENABLE_JFFS 0
  73. #else
  74. #define CONFIG_SYS_TEXT_BASE 0x00000000
  75. #define ENABLE_JFFS 1
  76. #endif
  77. /* Define which commmands should be available at u-boot command prompt */
  78. #define CONFIG_CMD_CACHE
  79. #define CONFIG_CMD_DATE
  80. #define CONFIG_CMD_ELF
  81. #define CONFIG_CMD_FLASH
  82. #define CONFIG_CMD_I2C
  83. #define CONFIG_CMD_MEMORY
  84. #define CONFIG_CMD_MISC
  85. #define CONFIG_CMD_XIMG
  86. #undef CONFIG_CMD_NET
  87. #undef CONFIG_CMD_NFS
  88. #if ENABLE_JFFS
  89. #define CONFIG_CMD_JFFS2
  90. #endif
  91. #define CONFIG_CMD_REGINFO
  92. #define CONFIG_CMD_LOADS
  93. #define CONFIG_CMD_LOADB
  94. #define CONFIG_CMD_FPGA
  95. #define CONFIG_CMDLINE_EDITING
  96. #define CONFIG_SYS_HUSH_PARSER
  97. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  98. #define CONFIG_MCFRTC
  99. #undef RTC_DEBUG
  100. /* Timer */
  101. #define CONFIG_MCFTMR
  102. #undef CONFIG_MCFPIT
  103. /* I2C */
  104. #define CONFIG_FSL_I2C
  105. #define CONFIG_HARD_I2C /* I2C with hw support */
  106. #undef CONFIG_SOFT_I2C /* I2C bit-banged */
  107. #define CONFIG_SYS_I2C_SPEED 80000
  108. #define CONFIG_SYS_I2C_SLAVE 0x7F
  109. #define CONFIG_SYS_I2C_OFFSET 0x58000
  110. #define CONFIG_SYS_IMMR CONFIG_SYS_MBAR
  111. /*
  112. * Defines processor clock - important for correct timings concerning serial
  113. * interface etc.
  114. * CONFIG_SYS_HZ gives unit: 1000 -> 1 Hz ^= 1000 ms
  115. */
  116. #define CONFIG_SYS_HZ 1000
  117. #define CONFIG_SYS_CLK 80000000
  118. #define CONFIG_SYS_CPU_CLK (CONFIG_SYS_CLK * 3)
  119. #define CONFIG_SYS_SDRAM_SIZE 32 /* SDRAM size in MB */
  120. #define CONFIG_SYS_CORE_SRAM_SIZE 0x8000
  121. #define CONFIG_SYS_CORE_SRAM 0x80000000
  122. #define CONFIG_SYS_UNIFY_CACHE
  123. /*
  124. * Define baudrate for UART1 (console output, tftp, ...)
  125. * default value of CONFIG_BAUDRATE for Sentec board: 19200 baud
  126. * CONFIG_SYS_BAUDRATE_TABLE defines values that can be selected
  127. * in u-boot command interface
  128. */
  129. #define CONFIG_BAUDRATE 115200
  130. #define CONFIG_SYS_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 }
  131. #define CONFIG_MCFUART
  132. #define CONFIG_SYS_UART_PORT (2)
  133. #define CONFIG_SYS_UART2_ALT3_GPIO
  134. /*
  135. * Watchdog configuration; Watchdog is disabled for running from RAM
  136. * and set to highest possible value else. Beware there is no check
  137. * in the watchdog code to validate the timeout value set here!
  138. */
  139. #ifndef CONFIG_MONITOR_IS_IN_RAM
  140. #define CONFIG_WATCHDOG
  141. #define CONFIG_WATCHDOG_TIMEOUT 3355 /* timeout in milliseconds */
  142. #endif
  143. /*
  144. * Configuration for environment
  145. * Environment is located in the last sector of the flash
  146. */
  147. #ifndef CONFIG_MONITOR_IS_IN_RAM
  148. #define CONFIG_ENV_OFFSET 0x1FF8000
  149. #define CONFIG_ENV_SECT_SIZE 0x8000
  150. #define CONFIG_ENV_IS_IN_FLASH 1
  151. #else
  152. /*
  153. * environment in RAM - This is used to use a single PC-based application
  154. * to load an image, load U-Boot, load an environment and then start U-Boot
  155. * to execute the commands from the environment. Feedback is done via setting
  156. * and reading memory locations.
  157. */
  158. #define CONFIG_ENV_ADDR 0x40060000
  159. #define CONFIG_ENV_SECT_SIZE 0x8000
  160. #define CONFIG_ENV_IS_IN_FLASH 1
  161. #endif
  162. /* here we put our FPGA configuration... */
  163. #define CONFIG_MISC_INIT_R 1
  164. /* Define user parameters that have to be customized most likely */
  165. /* AUTOBOOT settings - booting images automatically by u-boot after power on */
  166. /*
  167. * used for autoboot, delay in seconds u-boot will wait before starting
  168. * defined (auto-)boot command, setting to -1 disables delay, setting to
  169. * 0 will too prevent access to u-boot command interface: u-boot then has
  170. * to be reflashed
  171. * beware - watchdog is not serviced during autoboot delay time!
  172. */
  173. #ifdef CONFIG_MONITOR_IS_IN_RAM
  174. #define CONFIG_BOOTDELAY 1
  175. #else
  176. #define CONFIG_BOOTDELAY 1
  177. #endif
  178. /*
  179. * The following settings will be contained in the environment block ; if you
  180. * want to use a neutral environment all those settings can be manually set in
  181. * u-boot: 'set' command
  182. */
  183. #define _QUOTEME(x) #x
  184. #define QUOTEME(x) _QUOTEME(x)
  185. #define CONFIG_EXTRA_ENV_SETTINGS \
  186. "loaderversion=11\0" \
  187. "card_id="QUOTEME(ASTRO_ID)"\0" \
  188. "alterafile=0\0" \
  189. "xilinxfile=0\0" \
  190. "xilinxload=imxtract 0x540000 $xilinxfile 0x41000000&&"\
  191. "fpga load 0 0x41000000 $filesize\0" \
  192. "alteraload=imxtract 0x6c0000 $alterafile 0x41000000&&"\
  193. "fpga load 1 0x41000000 $filesize\0" \
  194. "env_default=1\0" \
  195. "env_check=if test $env_default -eq 1;"\
  196. " then setenv env_default 0;saveenv;fi\0"
  197. /*
  198. * "update" is a non-standard command that has to be supplied
  199. * by external update.c; This is not included in mainline because
  200. * it needs non-blocking CFI routines.
  201. */
  202. #ifdef CONFIG_MONITOR_IS_IN_RAM
  203. #define CONFIG_BOOTCOMMAND "" /* no autoboot in this case */
  204. #else
  205. #if CONFIG_ASTRO_V532
  206. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  207. "run xilinxload&&run alteraload&&bootm 0x80000;"\
  208. "update;reset"
  209. #else
  210. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  211. "run xilinxload&&bootm 0x80000;update;reset"
  212. #endif
  213. #endif
  214. /* default bootargs that are considered during boot */
  215. #define CONFIG_BOOTARGS " console=ttyS2,115200 rootfstype=romfs"\
  216. " loaderversion=$loaderversion"
  217. #define CONFIG_SYS_PROMPT "URMEL > "
  218. /* default RAM address for user programs */
  219. #define CONFIG_SYS_LOAD_ADDR 0x20000
  220. #define CONFIG_SYS_LONGHELP
  221. #if (CONFIG_COMMANDS & CONFIG_CMD_KGDB)
  222. #define CONFIG_SYS_CBSIZE 1024
  223. #else
  224. #define CONFIG_SYS_CBSIZE 256
  225. #endif
  226. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  227. #define CONFIG_SYS_MAXARGS 16
  228. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  229. #define CONFIG_FPGA_COUNT 1
  230. #define CONFIG_FPGA
  231. #define CONFIG_FPGA_XILINX
  232. #define CONFIG_FPGA_SPARTAN3
  233. #define CONFIG_FPGA_ALTERA
  234. #define CONFIG_FPGA_CYCLON2
  235. #define CONFIG_SYS_FPGA_PROG_FEEDBACK
  236. #define CONFIG_SYS_FPGA_WAIT 1000
  237. /* End of user parameters to be customized */
  238. /* Defines memory range for test */
  239. #define CONFIG_SYS_MEMTEST_START 0x40020000
  240. #define CONFIG_SYS_MEMTEST_END 0x41ffffff
  241. /*
  242. * Low Level Configuration Settings
  243. * (address mappings, register initial values, etc.)
  244. * You should know what you are doing if you make changes here.
  245. */
  246. /* Base register address */
  247. #define CONFIG_SYS_MBAR 0xFC000000 /* Register Base Addrs */
  248. /* System Conf. Reg. & System Protection Reg. */
  249. #define CONFIG_SYS_SCR 0x0003;
  250. #define CONFIG_SYS_SPR 0xffff;
  251. /*
  252. * Definitions for initial stack pointer and data area (in internal SRAM)
  253. */
  254. #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000
  255. #define CONFIG_SYS_INIT_RAM_SIZE 0x8000
  256. #define CONFIG_SYS_INIT_RAM_CTRL 0x221
  257. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
  258. GENERATED_GBL_DATA_SIZE)
  259. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  260. /*
  261. * Start addresses for the final memory configuration
  262. * (Set up by the startup code)
  263. * for MCF5373, the allowable range is 0x40000000 to 0x7FF00000
  264. */
  265. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  266. /*
  267. * Chipselect bank definitions
  268. *
  269. * CS0 - Flash 32MB (first 16MB)
  270. * CS1 - Flash 32MB (second half)
  271. * CS2 - FPGA
  272. * CS3 - FPGA
  273. * CS4 - unused
  274. * CS5 - unused
  275. */
  276. #define CONFIG_SYS_CS0_BASE 0
  277. #define CONFIG_SYS_CS0_MASK 0x00ff0001
  278. #define CONFIG_SYS_CS0_CTRL 0x00001fc0
  279. #define CONFIG_SYS_CS1_BASE 0x01000000
  280. #define CONFIG_SYS_CS1_MASK 0x00ff0001
  281. #define CONFIG_SYS_CS1_CTRL 0x00001fc0
  282. #define CONFIG_SYS_CS2_BASE 0x20000000
  283. #define CONFIG_SYS_CS2_MASK 0x00ff0001
  284. #define CONFIG_SYS_CS2_CTRL 0x0000fec0
  285. #define CONFIG_SYS_CS3_BASE 0x21000000
  286. #define CONFIG_SYS_CS3_MASK 0x00ff0001
  287. #define CONFIG_SYS_CS3_CTRL 0x0000fec0
  288. #define CONFIG_SYS_FLASH_BASE 0x00000000
  289. #ifdef CONFIG_MONITOR_IS_IN_RAM
  290. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  291. #else
  292. /* This is mainly used during relocation in start.S */
  293. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)
  294. #endif
  295. /* Reserve 256 kB for Monitor */
  296. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  297. #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024)
  298. /* Reserve 128 kB for malloc() */
  299. #define CONFIG_SYS_MALLOC_LEN (128 << 10)
  300. /*
  301. * For booting Linux, the board info and command line data
  302. * have to be in the first 8 MB of memory, since this is
  303. * the maximum mapped by the Linux kernel during initialization ??
  304. */
  305. #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \
  306. (CONFIG_SYS_SDRAM_SIZE << 20))
  307. /* FLASH organization */
  308. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  309. #define CONFIG_SYS_MAX_FLASH_SECT 259
  310. #define CONFIG_SYS_FLASH_ERASE_TOUT 1000
  311. #define CONFIG_SYS_FLASH_CFI 1
  312. #define CONFIG_FLASH_CFI_DRIVER 1
  313. #define CONFIG_SYS_FLASH_SIZE 0x2000000
  314. #define CONFIG_SYS_FLASH_PROTECTION 1
  315. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
  316. #define CONFIG_SYS_FLASH_CFI_NONBLOCK 1
  317. #if ENABLE_JFFS
  318. /* JFFS Partition offset set */
  319. #define CONFIG_SYS_JFFS2_FIRST_BANK 0
  320. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  321. /* 512k reserved for u-boot */
  322. #define CONFIG_SYS_JFFS2_FIRST_SECTOR 0x40
  323. #endif
  324. /* Cache Configuration */
  325. #define CONFIG_SYS_CACHELINE_SIZE 16
  326. #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  327. CONFIG_SYS_INIT_RAM_SIZE - 8)
  328. #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  329. CONFIG_SYS_INIT_RAM_SIZE - 4)
  330. #define CONFIG_SYS_ICACHE_INV (CF_CACR_CINVA)
  331. #define CONFIG_SYS_CACHE_ACR0 (CONFIG_SYS_SDRAM_BASE | \
  332. CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
  333. CF_ACR_EN | CF_ACR_SM_ALL)
  334. #define CONFIG_SYS_CACHE_ICACR (CF_CACR_EC | CF_CACR_CINVA | \
  335. CF_CACR_DCM_P)
  336. #endif /* _CONFIG_ASTRO_MCF5373L_H */