spc1920.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. /*
  2. * (C) Copyright 2006
  3. * Markus Klotzbuecher, DENX Software Engineering, mk@denx.de
  4. *
  5. * Configuation settings for the SPC1920 board.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __H
  23. #define __CONFIG_H
  24. #define CONFIG_SPC1920 1 /* SPC1920 board */
  25. #define CONFIG_MPC885 1 /* MPC885 CPU */
  26. #define CONFIG_8xx_CONS_SMC1 /* Console is on SMC1 */
  27. #undef CONFIG_8xx_CONS_SMC2
  28. #undef CONFIG_8xx_CONS_NONE
  29. #define CONFIG_MII
  30. /* #define MII_DEBUG */
  31. /* #define CONFIG_FEC_ENET */
  32. #undef CONFIG_ETHER_ON_FEC1
  33. #define CONFIG_ETHER_ON_FEC2
  34. #define FEC_ENET
  35. /* #define CONFIG_FEC2_PHY_NORXERR */
  36. /* #define CFG_DISCOVER_PHY */
  37. /* #define CONFIG_PHY_ADDR 0x1 */
  38. #define CONFIG_FEC2_PHY 1
  39. #define CONFIG_BAUDRATE 19200
  40. /* use PLD CLK4 instead of brg */
  41. #undef CFG_SPC1920_SMC1_CLK4
  42. #define CONFIG_8xx_OSCLK 10000000 /* 10 MHz oscillator on EXTCLK */
  43. #define CONFIG_8xx_CPUCLK_DEFAULT 50000000
  44. #define CFG_8xx_CPUCLK_MIN 40000000
  45. #define CFG_8xx_CPUCLK_MAX 133000000
  46. #define CFG_RESET_ADDRESS 0xf8000000
  47. #define CONFIG_BOARD_EARLY_INIT_F
  48. #if 1
  49. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  50. #else
  51. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  52. #endif
  53. #define CONFIG_ENV_OVERWRITE
  54. #define CONFIG_NFSBOOTCOMMAND \
  55. "dhcp;" \
  56. "setenv bootargs root=/dev/nfs rw nfsroot=$rootpath " \
  57. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:eth0:off;" \
  58. "bootm"
  59. #define CONFIG_BOOTCOMMAND \
  60. "setenv bootargs root=/dev/mtdblock2 rw mtdparts=phys:1280K(ROM)ro,-(root) "\
  61. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:eth0:off;" \
  62. "bootm fe080000"
  63. #undef CONFIG_BOOTARGS
  64. #undef CONFIG_WATCHDOG /* watchdog disabled */
  65. #define CONFIG_BZIP2 /* include support for bzip2 compressed images */
  66. #ifndef CONFIG_COMMANDS
  67. #define CONFIG_COMMANDS (CONFIG_CMD_DFL \
  68. | CFG_CMD_ASKENV \
  69. | CFG_CMD_ECHO \
  70. | CFG_CMD_IMMAP \
  71. | CFG_CMD_JFFS2 \
  72. | CFG_CMD_PING \
  73. | CFG_CMD_DHCP \
  74. | CFG_CMD_IMMAP \
  75. | CFG_CMD_MII)
  76. /* & ~( CFG_CMD_NET)) */
  77. #endif /* !CONFIG_COMMANDS */
  78. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  79. #include <cmd_confdefs.h>
  80. /*
  81. * Miscellaneous configurable options
  82. */
  83. #define CFG_LONGHELP /* undef to save memory */
  84. #define CFG_PROMPT "=>" /* Monitor Command Prompt */
  85. #define CFG_HUSH_PARSER
  86. #define CFG_PROMPT_HUSH_PS2 "> "
  87. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  88. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  89. #else
  90. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  91. #endif
  92. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16) /* Print Buffer Size */
  93. #define CFG_MAXARGS 16 /* max number of command args */
  94. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  95. #define CFG_LOAD_ADDR 0x00100000
  96. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  97. #define CFG_BAUDRATE_TABLE { 2400, 4800, 9600, 19200 }
  98. /*
  99. * Low Level Configuration Settings
  100. * (address mappings, register initial values, etc.)
  101. * You should know what you are doing if you make changes here.
  102. */
  103. /*-----------------------------------------------------------------------
  104. * Internal Memory Mapped Register
  105. */
  106. #define CFG_IMMR 0xF0000000
  107. /*-----------------------------------------------------------------------
  108. * Definitions for initial stack pointer and data area (in DPRAM)
  109. */
  110. #define CFG_INIT_RAM_ADDR CFG_IMMR
  111. #define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
  112. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  113. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  114. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  115. /*-----------------------------------------------------------------------
  116. * Start addresses for the final memory configuration
  117. * (Set up by the startup code)
  118. * Please note that CFG_SDRAM_BASE _must_ start at 0
  119. */
  120. #define CFG_MEMTEST_START 0x0400000 /* memtest works on */
  121. #define CFG_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  122. /*
  123. * For booting Linux, the board info and command line data
  124. * have to be in the first 8 MB of memory, since this is
  125. * the maximum mapped by the Linux kernel during initialization.
  126. */
  127. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  128. #define CFG_MONITOR_BASE TEXT_BASE
  129. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 KB for monitor */
  130. #ifdef CONFIG_BZIP2
  131. #define CFG_MALLOC_LEN (2500 << 10) /* Reserve ~2.5 MB for malloc() */
  132. #else
  133. #define CFG_MALLOC_LEN (384 << 10) /* Reserve 384 kB for malloc() */
  134. #endif /* CONFIG_BZIP2 */
  135. #define CFG_ALLOC_DPRAM 1 /* use allocation routines */
  136. /*
  137. * Flash
  138. */
  139. /*-----------------------------------------------------------------------
  140. * Flash organisation
  141. */
  142. #define CFG_FLASH_BASE 0xFE000000
  143. #define CFG_FLASH_CFI /* The flash is CFI compatible */
  144. #define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */
  145. #define CFG_MAX_FLASH_BANKS 1 /* Max number of flash banks */
  146. #define CFG_MAX_FLASH_SECT 128 /* Max num of sects on one chip */
  147. /* Environment is in flash */
  148. #define CFG_ENV_IS_IN_FLASH
  149. #define CFG_ENV_SECT_SIZE 0x40000 /* We use one complete sector */
  150. #define CFG_ENV_ADDR (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
  151. #define CONFIG_ENV_OVERWRITE
  152. /*-----------------------------------------------------------------------
  153. * Cache Configuration
  154. */
  155. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  156. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  157. /*-----------------------------------------------------------------------
  158. * I2C configuration
  159. */
  160. #if (CONFIG_COMMANDS & CFG_CMD_I2C)
  161. #define CONFIG_HARD_I2C 1 /* I2C with hardware support */
  162. #define CFG_I2C_SPEED 400000 /* I2C speed and slave address defaults */
  163. #define CFG_I2C_SLAVE 0x7F
  164. #endif
  165. /*-----------------------------------------------------------------------
  166. * SYPCR - System Protection Control 11-9
  167. * SYPCR can only be written once after reset!
  168. *-----------------------------------------------------------------------
  169. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  170. */
  171. #if defined(CONFIG_WATCHDOG)
  172. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  173. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  174. #else
  175. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  176. #endif
  177. /*-----------------------------------------------------------------------
  178. * SIUMCR - SIU Module Configuration 11-6
  179. *-----------------------------------------------------------------------
  180. * PCMCIA config., multi-function pin tri-state
  181. */
  182. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
  183. /*-----------------------------------------------------------------------
  184. * TBSCR - Time Base Status and Control 11-26
  185. *-----------------------------------------------------------------------
  186. * Clear Reference Interrupt Status, Timebase freezing enabled
  187. */
  188. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBE)
  189. /*-----------------------------------------------------------------------
  190. * PISCR - Periodic Interrupt Status and Control 11-31
  191. *-----------------------------------------------------------------------
  192. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  193. */
  194. #define CFG_PISCR (PISCR_PS | PISCR_PITF)
  195. /*-----------------------------------------------------------------------
  196. * SCCR - System Clock and reset Control Register 15-27
  197. *-----------------------------------------------------------------------
  198. * Set clock output, timebase and RTC source and divider,
  199. * power management and some other internal clocks
  200. */
  201. #define SCCR_MASK SCCR_EBDF11
  202. /* #define CFG_SCCR SCCR_TBS */
  203. #define CFG_SCCR (SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  204. SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  205. SCCR_DFALCD00)
  206. /*-----------------------------------------------------------------------
  207. * DER - Debug Enable Register
  208. *-----------------------------------------------------------------------
  209. * Set to zero to prevent the processor from entering debug mode
  210. */
  211. #define CFG_DER 0
  212. /* Because of the way the 860 starts up and assigns CS0 the entire
  213. * address space, we have to set the memory controller differently.
  214. * Normally, you write the option register first, and then enable the
  215. * chip select by writing the base register. For CS0, you must write
  216. * the base register first, followed by the option register.
  217. */
  218. /*
  219. * Init Memory Controller:
  220. */
  221. /* BR0 and OR0 (FLASH) */
  222. #define FLASH_BASE0_PRELIM CFG_FLASH_BASE /* FLASH bank #0 */
  223. /* used to re-map FLASH both when starting from SRAM or FLASH:
  224. * restrict access enough to keep SRAM working (if any)
  225. * but not too much to meddle with FLASH accesses
  226. */
  227. #define CFG_REMAP_OR_AM 0x80000000 /* OR addr mask */
  228. #define CFG_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
  229. /*
  230. * FLASH timing:
  231. */
  232. #define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
  233. OR_SCY_3_CLK | OR_EHTR | OR_BI)
  234. #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  235. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
  236. #define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )
  237. /*
  238. * SDRAM CS1 UPMB
  239. */
  240. #define CFG_SDRAM_BASE 0x00000000
  241. #define CFG_SDRAM_BASE_PRELIM CFG_SDRAM_BASE
  242. #define SDRAM_MAX_SIZE 0x4000000 /* max 64 MB */
  243. #define CFG_PRELIM_OR1_AM 0xF0000000
  244. /* #define CFG_OR1_TIMING OR_CSNT_SAM/\* | OR_G5LS /\\* *\\/ *\/ */
  245. #define SDRAM_TIMING OR_SCY_0_CLK /* SDRAM-Timing */
  246. #define CFG_OR1_PRELIM (CFG_PRELIM_OR1_AM | OR_CSNT_SAM | OR_G5LS | SDRAM_TIMING)
  247. #define CFG_BR1_PRELIM ((CFG_SDRAM_BASE_PRELIM & BR_BA_MSK) | BR_MS_UPMB | BR_V)
  248. /* #define CFG_OR1_FINAL ((CFG_OR1_AM & OR_AM_MSK) | CFG_OR1_TIMING) */
  249. /* #define CFG_BR1_FINAL ((CFG_SDRAM_BASE & BR_BA_MSK) | BR_MS_UPMB | BR_V) */
  250. #define CFG_PTB_PER_CLK ((4096 * 16 * 1000) / (4 * 64))
  251. #define CFG_PTA_PER_CLK 195
  252. #define CFG_MBMR_PTB 195
  253. #define CFG_MPTPR MPTPR_PTP_DIV16
  254. #define CFG_MAR 0x88
  255. #define CFG_MBMR_8COL ((CFG_MBMR_PTB << MBMR_PTB_SHIFT) | \
  256. MBMR_AMB_TYPE_0 | \
  257. MBMR_G0CLB_A10 | \
  258. MBMR_DSB_1_CYCL | \
  259. MBMR_RLFB_1X | \
  260. MBMR_WLFB_1X | \
  261. MBMR_TLFB_4X) /* 0x04804114 */ /* 0x10802114 */
  262. #define CFG_MBMR_9COL ((CFG_MBMR_PTB << MBMR_PTB_SHIFT) | \
  263. MBMR_AMB_TYPE_1 | \
  264. MBMR_G0CLB_A10 | \
  265. MBMR_DSB_1_CYCL | \
  266. MBMR_RLFB_1X | \
  267. MBMR_WLFB_1X | \
  268. MBMR_TLFB_4X) /* 0x04804114 */ /* 0x10802114 */
  269. /* PLD CS5 */
  270. #define CFG_SPC1920_PLD_BASE 0x80000000
  271. #define CFG_PRELIM_OR5_AM 0xffff8000
  272. #define CFG_OR5_PRELIM (CFG_PRELIM_OR5_AM | \
  273. OR_CSNT_SAM | \
  274. OR_ACS_DIV1 | \
  275. OR_BI | \
  276. OR_SCY_0_CLK | \
  277. OR_TRLX)
  278. #define CFG_BR5_PRELIM ((CFG_SPC1920_PLD_BASE & BR_BA_MSK) | BR_PS_8 | BR_V);
  279. /* #define CFG_PLD_BASE 0x30000000 */
  280. /* #define CFG_OR5_PRELIM 0xffff1110 */
  281. /* #define CFG_BR5_PRELIM 0x30000401 */
  282. /*
  283. * Internal Definitions
  284. *
  285. * Boot Flags
  286. */
  287. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  288. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  289. /* Machine type
  290. */
  291. #define _MACH_8xx (_MACH_fads)
  292. #endif /* __CONFIG_H */