astro_mcf5373l.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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. #include <linux/stringify.h>
  34. /*
  35. * set the card type to actually compile for; either of
  36. * the possibilities listed below has to be used!
  37. */
  38. #define CONFIG_ASTRO_V532 1
  39. #if CONFIG_ASTRO_V532
  40. #define ASTRO_ID 0xF8
  41. #elif CONFIG_ASTRO_V512
  42. #define ASTRO_ID 0xFA
  43. #elif CONFIG_ASTRO_TWIN7S2
  44. #define ASTRO_ID 0xF9
  45. #elif CONFIG_ASTRO_V912
  46. #define ASTRO_ID 0xFC
  47. #elif CONFIG_ASTRO_COFDMDUOS2
  48. #define ASTRO_ID 0xFB
  49. #else
  50. #error No card type defined!
  51. #endif
  52. /*
  53. * Define processor
  54. * possible values for Urmel board: only Coldfire M5373 processor supported
  55. * (please do not change)
  56. */
  57. /* it seems not clear yet which processor defines we should use */
  58. #define CONFIG_MCF537x /* define processor family */
  59. #define CONFIG_MCF532x /* define processor family */
  60. #define CONFIG_M5373 /* define processor type */
  61. #define CONFIG_ASTRO5373L /* define board type */
  62. /* Command line configuration */
  63. #include <config_cmd_default.h>
  64. /*
  65. * CONFIG_RAM defines if u-boot is loaded via BDM (or started from
  66. * a different bootloader that has already performed RAM setup) or
  67. * started directly from flash, which is the regular case for production
  68. * boards.
  69. */
  70. #ifdef CONFIG_RAM
  71. #define CONFIG_MONITOR_IS_IN_RAM
  72. #define CONFIG_SYS_TEXT_BASE 0x40020000
  73. #define ENABLE_JFFS 0
  74. #else
  75. #define CONFIG_SYS_TEXT_BASE 0x00000000
  76. #define ENABLE_JFFS 1
  77. #endif
  78. /* Define which commmands should be available at u-boot command prompt */
  79. #define CONFIG_CMD_CACHE
  80. #define CONFIG_CMD_DATE
  81. #define CONFIG_CMD_ELF
  82. #define CONFIG_CMD_FLASH
  83. #define CONFIG_CMD_I2C
  84. #define CONFIG_CMD_MEMORY
  85. #define CONFIG_CMD_MISC
  86. #define CONFIG_CMD_XIMG
  87. #undef CONFIG_CMD_NET
  88. #undef CONFIG_CMD_NFS
  89. #if ENABLE_JFFS
  90. #define CONFIG_CMD_JFFS2
  91. #endif
  92. #define CONFIG_CMD_REGINFO
  93. #define CONFIG_CMD_LOADS
  94. #define CONFIG_CMD_LOADB
  95. #define CONFIG_CMD_FPGA
  96. #define CONFIG_CMDLINE_EDITING
  97. #define CONFIG_SYS_HUSH_PARSER
  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_MCFUART
  131. #define CONFIG_SYS_UART_PORT (2)
  132. #define CONFIG_SYS_UART2_ALT3_GPIO
  133. /*
  134. * Watchdog configuration; Watchdog is disabled for running from RAM
  135. * and set to highest possible value else. Beware there is no check
  136. * in the watchdog code to validate the timeout value set here!
  137. */
  138. #ifndef CONFIG_MONITOR_IS_IN_RAM
  139. #define CONFIG_WATCHDOG
  140. #define CONFIG_WATCHDOG_TIMEOUT 3355 /* timeout in milliseconds */
  141. #endif
  142. /*
  143. * Configuration for environment
  144. * Environment is located in the last sector of the flash
  145. */
  146. #ifndef CONFIG_MONITOR_IS_IN_RAM
  147. #define CONFIG_ENV_OFFSET 0x1FF8000
  148. #define CONFIG_ENV_SECT_SIZE 0x8000
  149. #define CONFIG_ENV_IS_IN_FLASH 1
  150. #else
  151. /*
  152. * environment in RAM - This is used to use a single PC-based application
  153. * to load an image, load U-Boot, load an environment and then start U-Boot
  154. * to execute the commands from the environment. Feedback is done via setting
  155. * and reading memory locations.
  156. */
  157. #define CONFIG_ENV_ADDR 0x40060000
  158. #define CONFIG_ENV_SECT_SIZE 0x8000
  159. #define CONFIG_ENV_IS_IN_FLASH 1
  160. #endif
  161. /* here we put our FPGA configuration... */
  162. #define CONFIG_MISC_INIT_R 1
  163. /* Define user parameters that have to be customized most likely */
  164. /* AUTOBOOT settings - booting images automatically by u-boot after power on */
  165. /*
  166. * used for autoboot, delay in seconds u-boot will wait before starting
  167. * defined (auto-)boot command, setting to -1 disables delay, setting to
  168. * 0 will too prevent access to u-boot command interface: u-boot then has
  169. * to be reflashed
  170. * beware - watchdog is not serviced during autoboot delay time!
  171. */
  172. #ifdef CONFIG_MONITOR_IS_IN_RAM
  173. #define CONFIG_BOOTDELAY 1
  174. #else
  175. #define CONFIG_BOOTDELAY 1
  176. #endif
  177. /*
  178. * The following settings will be contained in the environment block ; if you
  179. * want to use a neutral environment all those settings can be manually set in
  180. * u-boot: 'set' command
  181. */
  182. #define CONFIG_EXTRA_ENV_SETTINGS \
  183. "loaderversion=11\0" \
  184. "card_id="__stringify(ASTRO_ID)"\0" \
  185. "alterafile=0\0" \
  186. "xilinxfile=0\0" \
  187. "xilinxload=imxtract 0x540000 $xilinxfile 0x41000000&&"\
  188. "fpga load 0 0x41000000 $filesize\0" \
  189. "alteraload=imxtract 0x6c0000 $alterafile 0x41000000&&"\
  190. "fpga load 1 0x41000000 $filesize\0" \
  191. "env_default=1\0" \
  192. "env_check=if test $env_default -eq 1;"\
  193. " then setenv env_default 0;saveenv;fi\0"
  194. /*
  195. * "update" is a non-standard command that has to be supplied
  196. * by external update.c; This is not included in mainline because
  197. * it needs non-blocking CFI routines.
  198. */
  199. #ifdef CONFIG_MONITOR_IS_IN_RAM
  200. #define CONFIG_BOOTCOMMAND "" /* no autoboot in this case */
  201. #else
  202. #if CONFIG_ASTRO_V532
  203. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  204. "run xilinxload&&run alteraload&&bootm 0x80000;"\
  205. "update;reset"
  206. #else
  207. #define CONFIG_BOOTCOMMAND "protect off 0x80000 0x1ffffff;run env_check;"\
  208. "run xilinxload&&bootm 0x80000;update;reset"
  209. #endif
  210. #endif
  211. /* default bootargs that are considered during boot */
  212. #define CONFIG_BOOTARGS " console=ttyS2,115200 rootfstype=romfs"\
  213. " loaderversion=$loaderversion"
  214. #define CONFIG_SYS_PROMPT "URMEL > "
  215. /* default RAM address for user programs */
  216. #define CONFIG_SYS_LOAD_ADDR 0x20000
  217. #define CONFIG_SYS_LONGHELP
  218. #if (CONFIG_COMMANDS & CONFIG_CMD_KGDB)
  219. #define CONFIG_SYS_CBSIZE 1024
  220. #else
  221. #define CONFIG_SYS_CBSIZE 256
  222. #endif
  223. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  224. #define CONFIG_SYS_MAXARGS 16
  225. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  226. #define CONFIG_FPGA_COUNT 1
  227. #define CONFIG_FPGA
  228. #define CONFIG_FPGA_XILINX
  229. #define CONFIG_FPGA_SPARTAN3
  230. #define CONFIG_FPGA_ALTERA
  231. #define CONFIG_FPGA_CYCLON2
  232. #define CONFIG_SYS_FPGA_PROG_FEEDBACK
  233. #define CONFIG_SYS_FPGA_WAIT 1000
  234. /* End of user parameters to be customized */
  235. /* Defines memory range for test */
  236. #define CONFIG_SYS_MEMTEST_START 0x40020000
  237. #define CONFIG_SYS_MEMTEST_END 0x41ffffff
  238. /*
  239. * Low Level Configuration Settings
  240. * (address mappings, register initial values, etc.)
  241. * You should know what you are doing if you make changes here.
  242. */
  243. /* Base register address */
  244. #define CONFIG_SYS_MBAR 0xFC000000 /* Register Base Addrs */
  245. /* System Conf. Reg. & System Protection Reg. */
  246. #define CONFIG_SYS_SCR 0x0003;
  247. #define CONFIG_SYS_SPR 0xffff;
  248. /*
  249. * Definitions for initial stack pointer and data area (in internal SRAM)
  250. */
  251. #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000
  252. #define CONFIG_SYS_INIT_RAM_SIZE 0x8000
  253. #define CONFIG_SYS_INIT_RAM_CTRL 0x221
  254. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
  255. GENERATED_GBL_DATA_SIZE)
  256. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  257. /*
  258. * Start addresses for the final memory configuration
  259. * (Set up by the startup code)
  260. * for MCF5373, the allowable range is 0x40000000 to 0x7FF00000
  261. */
  262. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  263. /*
  264. * Chipselect bank definitions
  265. *
  266. * CS0 - Flash 32MB (first 16MB)
  267. * CS1 - Flash 32MB (second half)
  268. * CS2 - FPGA
  269. * CS3 - FPGA
  270. * CS4 - unused
  271. * CS5 - unused
  272. */
  273. #define CONFIG_SYS_CS0_BASE 0
  274. #define CONFIG_SYS_CS0_MASK 0x00ff0001
  275. #define CONFIG_SYS_CS0_CTRL 0x00001fc0
  276. #define CONFIG_SYS_CS1_BASE 0x01000000
  277. #define CONFIG_SYS_CS1_MASK 0x00ff0001
  278. #define CONFIG_SYS_CS1_CTRL 0x00001fc0
  279. #define CONFIG_SYS_CS2_BASE 0x20000000
  280. #define CONFIG_SYS_CS2_MASK 0x00ff0001
  281. #define CONFIG_SYS_CS2_CTRL 0x0000fec0
  282. #define CONFIG_SYS_CS3_BASE 0x21000000
  283. #define CONFIG_SYS_CS3_MASK 0x00ff0001
  284. #define CONFIG_SYS_CS3_CTRL 0x0000fec0
  285. #define CONFIG_SYS_FLASH_BASE 0x00000000
  286. #ifdef CONFIG_MONITOR_IS_IN_RAM
  287. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  288. #else
  289. /* This is mainly used during relocation in start.S */
  290. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)
  291. #endif
  292. /* Reserve 256 kB for Monitor */
  293. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  294. #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024)
  295. /* Reserve 128 kB for malloc() */
  296. #define CONFIG_SYS_MALLOC_LEN (128 << 10)
  297. /*
  298. * For booting Linux, the board info and command line data
  299. * have to be in the first 8 MB of memory, since this is
  300. * the maximum mapped by the Linux kernel during initialization ??
  301. */
  302. #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \
  303. (CONFIG_SYS_SDRAM_SIZE << 20))
  304. /* FLASH organization */
  305. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  306. #define CONFIG_SYS_MAX_FLASH_SECT 259
  307. #define CONFIG_SYS_FLASH_ERASE_TOUT 1000
  308. #define CONFIG_SYS_FLASH_CFI 1
  309. #define CONFIG_FLASH_CFI_DRIVER 1
  310. #define CONFIG_SYS_FLASH_SIZE 0x2000000
  311. #define CONFIG_SYS_FLASH_PROTECTION 1
  312. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
  313. #define CONFIG_SYS_FLASH_CFI_NONBLOCK 1
  314. #if ENABLE_JFFS
  315. /* JFFS Partition offset set */
  316. #define CONFIG_SYS_JFFS2_FIRST_BANK 0
  317. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  318. /* 512k reserved for u-boot */
  319. #define CONFIG_SYS_JFFS2_FIRST_SECTOR 0x40
  320. #endif
  321. /* Cache Configuration */
  322. #define CONFIG_SYS_CACHELINE_SIZE 16
  323. #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  324. CONFIG_SYS_INIT_RAM_SIZE - 8)
  325. #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
  326. CONFIG_SYS_INIT_RAM_SIZE - 4)
  327. #define CONFIG_SYS_ICACHE_INV (CF_CACR_CINVA)
  328. #define CONFIG_SYS_CACHE_ACR0 (CONFIG_SYS_SDRAM_BASE | \
  329. CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
  330. CF_ACR_EN | CF_ACR_SM_ALL)
  331. #define CONFIG_SYS_CACHE_ICACR (CF_CACR_EC | CF_CACR_CINVA | \
  332. CF_CACR_DCM_P)
  333. #endif /* _CONFIG_ASTRO_MCF5373L_H */