spc1920.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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 CONFIG_MII_INIT 1
  31. #undef CONFIG_ETHER_ON_FEC1
  32. #define CONFIG_ETHER_ON_FEC2
  33. #define FEC_ENET
  34. #define CONFIG_FEC2_PHY 1
  35. #define CONFIG_BAUDRATE 19200
  36. /* use PLD CLK4 instead of brg */
  37. #define CONFIG_SYS_SPC1920_SMC1_CLK4
  38. #define CONFIG_8xx_OSCLK 10000000 /* 10 MHz oscillator on EXTCLK */
  39. #define CONFIG_8xx_CPUCLK_DEFAULT 50000000
  40. #define CONFIG_SYS_8xx_CPUCLK_MIN 40000000
  41. #define CONFIG_SYS_8xx_CPUCLK_MAX 133000000
  42. #define CONFIG_SYS_RESET_ADDRESS 0xC0000000
  43. #define CONFIG_BOARD_EARLY_INIT_F
  44. #define CONFIG_LAST_STAGE_INIT
  45. #if 0
  46. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  47. #else
  48. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  49. #endif
  50. #define CONFIG_ENV_OVERWRITE
  51. #define CONFIG_NFSBOOTCOMMAND \
  52. "dhcp;" \
  53. "setenv bootargs root=/dev/nfs rw nfsroot=$rootpath " \
  54. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:eth0:off;" \
  55. "bootm"
  56. #define CONFIG_BOOTCOMMAND \
  57. "setenv bootargs root=/dev/mtdblock2 rw mtdparts=phys:1280K(ROM)ro,-(root) "\
  58. "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:eth0:off;" \
  59. "bootm fe080000"
  60. #undef CONFIG_BOOTARGS
  61. #undef CONFIG_WATCHDOG /* watchdog disabled */
  62. #define CONFIG_BZIP2 /* include support for bzip2 compressed images */
  63. /*
  64. * BOOTP options
  65. */
  66. #define CONFIG_BOOTP_BOOTFILESIZE
  67. #define CONFIG_BOOTP_BOOTPATH
  68. #define CONFIG_BOOTP_GATEWAY
  69. #define CONFIG_BOOTP_HOSTNAME
  70. /*
  71. * Command line configuration.
  72. */
  73. #include <config_cmd_default.h>
  74. #define CONFIG_CMD_ASKENV
  75. #define CONFIG_CMD_DATE
  76. #define CONFIG_CMD_ECHO
  77. #define CONFIG_CMD_IMMAP
  78. #define CONFIG_CMD_JFFS2
  79. #define CONFIG_CMD_NET
  80. #define CONFIG_CMD_PING
  81. #define CONFIG_CMD_DHCP
  82. #define CONFIG_CMD_I2C
  83. #define CONFIG_CMD_MII
  84. /*
  85. * Miscellaneous configurable options
  86. */
  87. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  88. #define CONFIG_SYS_PROMPT "=>" /* Monitor Command Prompt */
  89. #define CONFIG_SYS_HUSH_PARSER
  90. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  91. #if defined(CONFIG_CMD_KGDB)
  92. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  93. #else
  94. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  95. #endif
  96. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) /* Print Buffer Size */
  97. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  98. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  99. #define CONFIG_SYS_LOAD_ADDR 0x00100000
  100. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
  101. #define CONFIG_SYS_BAUDRATE_TABLE { 2400, 4800, 9600, 19200 }
  102. /*
  103. * Low Level Configuration Settings
  104. * (address mappings, register initial values, etc.)
  105. * You should know what you are doing if you make changes here.
  106. */
  107. /*-----------------------------------------------------------------------
  108. * Internal Memory Mapped Register
  109. */
  110. #define CONFIG_SYS_IMMR 0xF0000000
  111. /*-----------------------------------------------------------------------
  112. * Definitions for initial stack pointer and data area (in DPRAM)
  113. */
  114. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
  115. #define CONFIG_SYS_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
  116. #define CONFIG_SYS_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  117. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  118. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  119. /*-----------------------------------------------------------------------
  120. * Start addresses for the final memory configuration
  121. * (Set up by the startup code)
  122. * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
  123. */
  124. #define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works on */
  125. #define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  126. /*
  127. * For booting Linux, the board info and command line data
  128. * have to be in the first 8 MB of memory, since this is
  129. * the maximum mapped by the Linux kernel during initialization.
  130. */
  131. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  132. #define CONFIG_SYS_MONITOR_BASE TEXT_BASE
  133. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 KB for monitor */
  134. #ifdef CONFIG_BZIP2
  135. #define CONFIG_SYS_MALLOC_LEN (2500 << 10) /* Reserve ~2.5 MB for malloc() */
  136. #else
  137. #define CONFIG_SYS_MALLOC_LEN (384 << 10) /* Reserve 384 kB for malloc() */
  138. #endif /* CONFIG_BZIP2 */
  139. #define CONFIG_SYS_ALLOC_DPRAM 1 /* use allocation routines */
  140. /*
  141. * Flash
  142. */
  143. /*-----------------------------------------------------------------------
  144. * Flash organisation
  145. */
  146. #define CONFIG_SYS_FLASH_BASE 0xFE000000
  147. #define CONFIG_SYS_FLASH_CFI /* The flash is CFI compatible */
  148. #define CONFIG_FLASH_CFI_DRIVER /* Use common CFI driver */
  149. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* Max number of flash banks */
  150. #define CONFIG_SYS_MAX_FLASH_SECT 128 /* Max num of sects on one chip */
  151. /* Environment is in flash */
  152. #define CONFIG_ENV_IS_IN_FLASH
  153. #define CONFIG_ENV_SECT_SIZE 0x40000 /* We use one complete sector */
  154. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
  155. #define CONFIG_ENV_OVERWRITE
  156. /*-----------------------------------------------------------------------
  157. * Cache Configuration
  158. */
  159. #define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  160. #define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  161. #ifdef CONFIG_CMD_DATE
  162. # define CONFIG_RTC_DS3231
  163. # define CONFIG_SYS_I2C_RTC_ADDR 0x68
  164. #endif
  165. /*-----------------------------------------------------------------------
  166. * I2C configuration
  167. */
  168. #if defined(CONFIG_CMD_I2C)
  169. /* enable I2C and select the hardware/software driver */
  170. #undef CONFIG_HARD_I2C /* I2C with hardware support */
  171. #define CONFIG_SOFT_I2C 1 /* I2C bit-banged */
  172. #define CONFIG_SYS_I2C_SPEED 93000 /* 93 kHz is supposed to work */
  173. #define CONFIG_SYS_I2C_SLAVE 0xFE
  174. #ifdef CONFIG_SOFT_I2C
  175. /*
  176. * Software (bit-bang) I2C driver configuration
  177. */
  178. #define PB_SCL 0x00000020 /* PB 26 */
  179. #define PB_SDA 0x00000010 /* PB 27 */
  180. #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
  181. #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
  182. #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
  183. #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
  184. #define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
  185. else immr->im_cpm.cp_pbdat &= ~PB_SDA
  186. #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
  187. else immr->im_cpm.cp_pbdat &= ~PB_SCL
  188. #define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */
  189. #endif /* CONFIG_SOFT_I2C */
  190. #endif
  191. /*-----------------------------------------------------------------------
  192. * SYPCR - System Protection Control 11-9
  193. * SYPCR can only be written once after reset!
  194. *-----------------------------------------------------------------------
  195. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  196. */
  197. #if defined(CONFIG_WATCHDOG)
  198. #define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  199. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  200. #else
  201. #define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  202. #endif
  203. /*-----------------------------------------------------------------------
  204. * SIUMCR - SIU Module Configuration 11-6
  205. *-----------------------------------------------------------------------
  206. * PCMCIA config., multi-function pin tri-state
  207. */
  208. #define CONFIG_SYS_SIUMCR (SIUMCR_FRC)
  209. /*-----------------------------------------------------------------------
  210. * TBSCR - Time Base Status and Control 11-26
  211. *-----------------------------------------------------------------------
  212. * Clear Reference Interrupt Status, Timebase freezing enabled
  213. */
  214. #define CONFIG_SYS_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBE)
  215. /*-----------------------------------------------------------------------
  216. * PISCR - Periodic Interrupt Status and Control 11-31
  217. *-----------------------------------------------------------------------
  218. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  219. */
  220. #define CONFIG_SYS_PISCR (PISCR_PS | PISCR_PITF)
  221. /*-----------------------------------------------------------------------
  222. * SCCR - System Clock and reset Control Register 15-27
  223. *-----------------------------------------------------------------------
  224. * Set clock output, timebase and RTC source and divider,
  225. * power management and some other internal clocks
  226. */
  227. #define SCCR_MASK SCCR_EBDF11
  228. /* #define CONFIG_SYS_SCCR SCCR_TBS */
  229. #define CONFIG_SYS_SCCR (SCCR_COM00 | SCCR_DFSYNC00 | SCCR_DFBRG00 | \
  230. SCCR_DFNL000 | SCCR_DFNH000 | SCCR_DFLCD000 | \
  231. SCCR_DFALCD00)
  232. /*-----------------------------------------------------------------------
  233. * DER - Debug Enable Register
  234. *-----------------------------------------------------------------------
  235. * Set to zero to prevent the processor from entering debug mode
  236. */
  237. #define CONFIG_SYS_DER 0
  238. /* Because of the way the 860 starts up and assigns CS0 the entire
  239. * address space, we have to set the memory controller differently.
  240. * Normally, you write the option register first, and then enable the
  241. * chip select by writing the base register. For CS0, you must write
  242. * the base register first, followed by the option register.
  243. */
  244. /*
  245. * Init Memory Controller:
  246. */
  247. /* BR0 and OR0 (FLASH) */
  248. #define FLASH_BASE0_PRELIM CONFIG_SYS_FLASH_BASE /* FLASH bank #0 */
  249. /* used to re-map FLASH both when starting from SRAM or FLASH:
  250. * restrict access enough to keep SRAM working (if any)
  251. * but not too much to meddle with FLASH accesses
  252. */
  253. #define CONFIG_SYS_REMAP_OR_AM 0x80000000 /* OR addr mask */
  254. #define CONFIG_SYS_PRELIM_OR_AM 0xE0000000 /* OR addr mask */
  255. /*
  256. * FLASH timing:
  257. */
  258. #define CONFIG_SYS_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \
  259. OR_SCY_6_CLK | OR_EHTR | OR_BI)
  260. #define CONFIG_SYS_OR0_REMAP (CONFIG_SYS_REMAP_OR_AM | CONFIG_SYS_OR_TIMING_FLASH)
  261. #define CONFIG_SYS_OR0_PRELIM (CONFIG_SYS_PRELIM_OR_AM | CONFIG_SYS_OR_TIMING_FLASH)
  262. #define CONFIG_SYS_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )
  263. /*
  264. * SDRAM CS1 UPMB
  265. */
  266. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  267. #define CONFIG_SYS_SDRAM_BASE_PRELIM CONFIG_SYS_SDRAM_BASE
  268. #define SDRAM_MAX_SIZE 0x4000000 /* max 64 MB */
  269. #define CONFIG_SYS_PRELIM_OR1_AM 0xF0000000
  270. /* #define CONFIG_SYS_OR1_TIMING OR_CSNT_SAM/\* | OR_G5LS /\\* *\\/ *\/ */
  271. #define SDRAM_TIMING OR_SCY_0_CLK /* SDRAM-Timing */
  272. #define CONFIG_SYS_OR1_PRELIM (CONFIG_SYS_PRELIM_OR1_AM | OR_CSNT_SAM | OR_G5LS | SDRAM_TIMING)
  273. #define CONFIG_SYS_BR1_PRELIM ((CONFIG_SYS_SDRAM_BASE_PRELIM & BR_BA_MSK) | BR_MS_UPMB | BR_V)
  274. /* #define CONFIG_SYS_OR1_FINAL ((CONFIG_SYS_OR1_AM & OR_AM_MSK) | CONFIG_SYS_OR1_TIMING) */
  275. /* #define CONFIG_SYS_BR1_FINAL ((CONFIG_SYS_SDRAM_BASE & BR_BA_MSK) | BR_MS_UPMB | BR_V) */
  276. #define CONFIG_SYS_PTB_PER_CLK ((4096 * 16 * 1000) / (4 * 64))
  277. #define CONFIG_SYS_PTA_PER_CLK 195
  278. #define CONFIG_SYS_MBMR_PTB 195
  279. #define CONFIG_SYS_MPTPR MPTPR_PTP_DIV16
  280. #define CONFIG_SYS_MAR 0x88
  281. #define CONFIG_SYS_MBMR_8COL ((CONFIG_SYS_MBMR_PTB << MBMR_PTB_SHIFT) | \
  282. MBMR_AMB_TYPE_0 | \
  283. MBMR_G0CLB_A10 | \
  284. MBMR_DSB_1_CYCL | \
  285. MBMR_RLFB_1X | \
  286. MBMR_WLFB_1X | \
  287. MBMR_TLFB_4X) /* 0x04804114 */ /* 0x10802114 */
  288. #define CONFIG_SYS_MBMR_9COL ((CONFIG_SYS_MBMR_PTB << MBMR_PTB_SHIFT) | \
  289. MBMR_AMB_TYPE_1 | \
  290. MBMR_G0CLB_A10 | \
  291. MBMR_DSB_1_CYCL | \
  292. MBMR_RLFB_1X | \
  293. MBMR_WLFB_1X | \
  294. MBMR_TLFB_4X) /* 0x04804114 */ /* 0x10802114 */
  295. /*
  296. * DSP Host Port Interface CS3
  297. */
  298. #define CONFIG_SYS_SPC1920_HPI_BASE 0x90000000
  299. #define CONFIG_SYS_PRELIM_OR3_AM 0xF8000000
  300. #define CONFIG_SYS_OR3 (CONFIG_SYS_PRELIM_OR3_AM | \
  301. OR_G5LS | \
  302. OR_SCY_0_CLK | \
  303. OR_BI)
  304. #define CONFIG_SYS_BR3 ((CONFIG_SYS_SPC1920_HPI_BASE & BR_BA_MSK) | \
  305. BR_MS_UPMA | \
  306. BR_PS_16 | \
  307. BR_V)
  308. #define CONFIG_SYS_MAMR (MAMR_GPL_A4DIS | \
  309. MAMR_RLFA_5X | \
  310. MAMR_WLFA_5X)
  311. #define CONFIG_SPC1920_HPI_TEST
  312. #ifdef CONFIG_SPC1920_HPI_TEST
  313. #define HPI_REG(x) (*((volatile u16 *) (CONFIG_SYS_SPC1920_HPI_BASE + x)))
  314. #define HPI_HPIC_1 HPI_REG(0)
  315. #define HPI_HPIC_2 HPI_REG(2)
  316. #define HPI_HPIA_1 HPI_REG(0x2000008)
  317. #define HPI_HPIA_2 HPI_REG(0x2000008 + 2)
  318. #define HPI_HPID_INC_1 HPI_REG(0x1000004)
  319. #define HPI_HPID_INC_2 HPI_REG(0x1000004 + 2)
  320. #define HPI_HPID_NOINC_1 HPI_REG(0x300000c)
  321. #define HPI_HPID_NOINC_2 HPI_REG(0x300000c + 2)
  322. #endif /* CONFIG_SPC1920_HPI_TEST */
  323. /*
  324. * Ramtron FM18L08 FRAM 32KB on CS4
  325. */
  326. #define CONFIG_SYS_SPC1920_FRAM_BASE 0x80100000
  327. #define CONFIG_SYS_PRELIM_OR4_AM 0xffff8000
  328. #define CONFIG_SYS_OR4 (CONFIG_SYS_PRELIM_OR4_AM | \
  329. OR_ACS_DIV2 | \
  330. OR_BI | \
  331. OR_SCY_4_CLK | \
  332. OR_TRLX)
  333. #define CONFIG_SYS_BR4 ((CONFIG_SYS_SPC1920_FRAM_BASE & BR_BA_MSK) | BR_PS_8 | BR_V)
  334. /*
  335. * PLD CS5
  336. */
  337. #define CONFIG_SYS_SPC1920_PLD_BASE 0x80000000
  338. #define CONFIG_SYS_PRELIM_OR5_AM 0xffff8000
  339. #define CONFIG_SYS_OR5_PRELIM (CONFIG_SYS_PRELIM_OR5_AM | \
  340. OR_CSNT_SAM | \
  341. OR_ACS_DIV1 | \
  342. OR_BI | \
  343. OR_SCY_0_CLK | \
  344. OR_TRLX)
  345. #define CONFIG_SYS_BR5_PRELIM ((CONFIG_SYS_SPC1920_PLD_BASE & BR_BA_MSK) | BR_PS_8 | BR_V)
  346. /*
  347. * Internal Definitions
  348. *
  349. * Boot Flags
  350. */
  351. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  352. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  353. #endif /* __CONFIG_H */