TOP860.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. /*
  2. * (C) Copyright 2003
  3. * EMK Elektronik GmbH <www.emk-elektronik.de>
  4. * Reinhard Meyer <r.meyer@emk-elektronik.de>
  5. *
  6. * Configuation settings for the TOP860 board.
  7. *
  8. * -----------------------------------------------------------------
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. /*
  28. * TOP860 is a simple module:
  29. * 16-bit wide FLASH on CS0 (2MB or more)
  30. * 32-bit wide DRAM on CS2 (either 4MB or 16MB)
  31. * FEC with Am79C874 100-Base-T and Fiber Optic
  32. * Ports available, but we choose SMC1 for Console
  33. * 8k I2C EEPROM at address 0xae, 6k user available, 2k factory set
  34. * 32768Hz crystal PLL set for 49.152MHz Core and 24.576MHz Bus Clock
  35. *
  36. * This config has been copied from MBX.h / MBX860T.h
  37. */
  38. /*
  39. * board/config.h - configuration options, board specific
  40. */
  41. #ifndef __CONFIG_H
  42. #define __CONFIG_H
  43. /*
  44. * High Level Configuration Options
  45. * (easy to change)
  46. */
  47. /*-----------------------------------------------------------------------
  48. * CPU and BOARD type
  49. */
  50. #define CONFIG_MPC860 1 /* This is a MPC860 CPU */
  51. #define CONFIG_MPC860T 1 /* even better... an FEC! */
  52. #define CONFIG_TOP860 1 /* ...on a TOP860 module */
  53. #define CONFIG_SYS_TEXT_BASE 0x80000000
  54. #undef CONFIG_WATCHDOG /* watchdog disabled */
  55. #define CONFIG_IDENT_STRING " EMK TOP860"
  56. /*-----------------------------------------------------------------------
  57. * CLOCK settings
  58. */
  59. #define CONFIG_SYSCLK 49152000
  60. #define CONFIG_SYS_XTAL 32768
  61. #define CONFIG_EBDF 1
  62. #define CONFIG_COM 3
  63. #define CONFIG_RTC_MPC8xx
  64. /*-----------------------------------------------------------------------
  65. * Physical memory map as defined by EMK
  66. */
  67. #define CONFIG_SYS_IMMR 0xFFF00000 /* Internal Memory Mapped Register */
  68. #define CONFIG_SYS_FLASH_BASE 0x80000000 /* FLASH in final mapping */
  69. #define CONFIG_SYS_DRAM_BASE 0x00000000 /* DRAM in final mapping */
  70. #define CONFIG_SYS_FLASH_MAX 0x00400000 /* max FLASH to expect */
  71. #define CONFIG_SYS_DRAM_MAX 0x01000000 /* max DRAM to expect */
  72. /*-----------------------------------------------------------------------
  73. * derived values
  74. */
  75. #define CONFIG_SYS_MF (CONFIG_SYSCLK/CONFIG_SYS_XTAL)
  76. #define CONFIG_SYS_CPUCLOCK CONFIG_SYSCLK
  77. #define CONFIG_SYS_BRGCLOCK CONFIG_SYSCLK
  78. #define CONFIG_SYS_BUSCLOCK (CONFIG_SYSCLK >> CONFIG_EBDF)
  79. #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
  80. #define CONFIG_8xx_GCLK_FREQ CONFIG_SYSCLK
  81. /*-----------------------------------------------------------------------
  82. * FLASH organization
  83. */
  84. #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
  85. #define CONFIG_SYS_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
  86. #define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  87. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  88. #define CONFIG_SYS_FLASH_CFI
  89. /*-----------------------------------------------------------------------
  90. * Command interpreter
  91. */
  92. #define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
  93. #undef CONFIG_8xx_CONS_SMC2
  94. #define CONFIG_BAUDRATE 9600
  95. /*
  96. * Allow partial commands to be matched to uniqueness.
  97. */
  98. #define CONFIG_SYS_MATCH_PARTIAL_CMD
  99. /*
  100. * Command line configuration.
  101. */
  102. #include <config_cmd_default.h>
  103. #define CONFIG_CMD_ASKENV
  104. #define CONFIG_CMD_DHCP
  105. #define CONFIG_CMD_I2C
  106. #define CONFIG_CMD_EEPROM
  107. #define CONFIG_CMD_REGINFO
  108. #define CONFIG_CMD_IMMAP
  109. #define CONFIG_CMD_ELF
  110. #define CONFIG_CMD_DATE
  111. #define CONFIG_CMD_MII
  112. #define CONFIG_CMD_BEDBUG
  113. #define CONFIG_SOURCE 1
  114. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1
  115. #undef CONFIG_LOADS_ECHO /* NO echo on for serial download */
  116. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  117. #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
  118. #undef CONFIG_SYS_HUSH_PARSER /* Hush parse for U-Boot */
  119. #if defined(CONFIG_CMD_KGDB)
  120. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  121. #else
  122. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  123. #endif
  124. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  125. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  126. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
  127. /*-----------------------------------------------------------------------
  128. * Memory Test Command
  129. */
  130. #define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works on */
  131. #define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
  132. /*-----------------------------------------------------------------------
  133. * Environment handler
  134. * only the first 6k in EEPROM are available for user. Of that we use 256b
  135. */
  136. #define CONFIG_SOFT_I2C
  137. #define CONFIG_ENV_IS_IN_EEPROM 1 /* turn on EEPROM env feature */
  138. #define CONFIG_ENV_OFFSET 0x1000
  139. #define CONFIG_ENV_SIZE 0x0700
  140. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
  141. #define CONFIG_SYS_FACT_OFFSET 0x1800
  142. #define CONFIG_SYS_FACT_SIZE 0x0800
  143. #define CONFIG_SYS_I2C_FACT_ADDR 0x57
  144. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
  145. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  146. #define CONFIG_SYS_EEPROM_SIZE 0x2000
  147. #define CONFIG_SYS_I2C_SPEED 100000
  148. #define CONFIG_SYS_I2C_SLAVE 0xFE
  149. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 12
  150. #define CONFIG_ENV_OVERWRITE
  151. #define CONFIG_MISC_INIT_R
  152. #if defined (CONFIG_SOFT_I2C)
  153. #define SDA 0x00010
  154. #define SCL 0x00020
  155. #define __I2C_DIR immr->im_cpm.cp_pbdir
  156. #define __I2C_DAT immr->im_cpm.cp_pbdat
  157. #define __I2C_PAR immr->im_cpm.cp_pbpar
  158. #define __I2C_ODR immr->im_cpm.cp_pbodr
  159. #define I2C_INIT { __I2C_PAR &= ~(SDA|SCL); \
  160. __I2C_ODR &= ~(SDA|SCL); \
  161. __I2C_DAT |= (SDA|SCL); \
  162. __I2C_DIR|=(SDA|SCL); }
  163. #define I2C_READ ((__I2C_DAT & SDA) ? 1 : 0)
  164. #define I2C_SDA(x) { if (x) __I2C_DAT |= SDA; else __I2C_DAT &= ~SDA; }
  165. #define I2C_SCL(x) { if (x) __I2C_DAT |= SCL; else __I2C_DAT &= ~SCL; }
  166. #define I2C_DELAY { udelay(5); }
  167. #define I2C_ACTIVE { __I2C_DIR |= SDA; }
  168. #define I2C_TRISTATE { __I2C_DIR &= ~SDA; }
  169. #endif
  170. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
  171. /*-----------------------------------------------------------------------
  172. * defines we need to get FEC running
  173. */
  174. #define CONFIG_FEC_ENET 1 /* Ethernet only via FEC */
  175. #define FEC_ENET 1 /* eth.c needs it that way... */
  176. #define CONFIG_SYS_DISCOVER_PHY 1
  177. #define CONFIG_MII 1
  178. #define CONFIG_MII_INIT 1
  179. #define CONFIG_PHY_ADDR 31
  180. /*-----------------------------------------------------------------------
  181. * adresses
  182. */
  183. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */
  184. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  185. #define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */
  186. /*-----------------------------------------------------------------------
  187. * Start addresses for the final memory configuration
  188. * (Set up by the startup code)
  189. * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
  190. */
  191. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  192. #define CONFIG_SYS_FLASH_BASE 0x80000000
  193. /*-----------------------------------------------------------------------
  194. * Definitions for initial stack pointer and data area (in DPRAM)
  195. */
  196. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR
  197. #define CONFIG_SYS_INIT_RAM_SIZE 0x2f00 /* Size of used area in DPRAM */
  198. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  199. #define CONFIG_SYS_INIT_VPD_SIZE 256 /* size in bytes reserved for vpd buffer */
  200. #define CONFIG_SYS_INIT_VPD_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_INIT_VPD_SIZE)
  201. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_VPD_OFFSET-8)
  202. /*-----------------------------------------------------------------------
  203. * Cache Configuration
  204. */
  205. #define CONFIG_SYS_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  206. #if defined(CONFIG_CMD_KGDB)
  207. #define CONFIG_SYS_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  208. #endif
  209. /* Interrupt level assignments.
  210. */
  211. #define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
  212. /*-----------------------------------------------------------------------
  213. * Debug Enable Register
  214. *-----------------------------------------------------------------------
  215. *
  216. */
  217. #define CONFIG_SYS_DER 0 /* used in start.S */
  218. /*-----------------------------------------------------------------------
  219. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  220. *-----------------------------------------------------------------------
  221. * set up PLPRCR (PLL, Low-Power, and Reset Control Register)
  222. * 12 MF calculated Multiplication factor
  223. * 4 0 0000
  224. * 1 SPLSS 0 System PLL lock status sticky
  225. * 1 TEXPS 1 Timer expired status
  226. * 1 0 0
  227. * 1 TMIST 0 Timers interrupt status
  228. * 1 0 0
  229. * 1 CSRC 0 Clock source (0=DFNH, 1=DFNL)
  230. * 2 LPM 00 Low-power modes
  231. * 1 CSR 0 Checkstop reset enable
  232. * 1 LOLRE 0 Loss-of-lock reset enable
  233. * 1 FIOPD 0 Force I/O pull down
  234. * 5 0 00000
  235. */
  236. #define CONFIG_SYS_PLPRCR (PLPRCR_TEXPS | ((CONFIG_SYS_MF-1)<<20))
  237. /*-----------------------------------------------------------------------
  238. * SYPCR - System Protection Control 11-9
  239. * SYPCR can only be written once after reset!
  240. *-----------------------------------------------------------------------
  241. * set up SYPCR:
  242. * 16 SWTC 0xffff Software watchdog timer count
  243. * 8 BMT 0xff Bus monitor timing
  244. * 1 BME 1 Bus monitor enable
  245. * 3 0 000
  246. * 1 SWF 1 Software watchdog freeze
  247. * 1 SWE 0/1 Software watchdog enable
  248. * 1 SWRI 0/1 Software watchdog reset/interrupt select (1=HRESET)
  249. * 1 SWP 0/1 Software watchdog prescale (1=/2048)
  250. */
  251. #if defined (CONFIG_WATCHDOG)
  252. #define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  253. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  254. #else
  255. #define CONFIG_SYS_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF)
  256. #endif
  257. /*-----------------------------------------------------------------------
  258. * SIUMCR - SIU Module Configuration 11-6
  259. *-----------------------------------------------------------------------
  260. * set up SIUMCR
  261. * 1 EARB 0 External arbitration
  262. * 3 EARP 000 External arbitration request priority
  263. * 4 0 0000
  264. * 1 DSHW 0 Data show cycles
  265. * 2 DBGC 00 Debug pin configuration
  266. * 2 DBPC 00 Debug port pins configuration
  267. * 1 0 0
  268. * 1 FRC 0 FRZ pin configuration
  269. * 1 DLK 0 Debug register lock
  270. * 1 OPAR 0 Odd parity
  271. * 1 PNCS 0 Parity enable for non memory controller regions
  272. * 1 DPC 0 Data parity pins configuration
  273. * 1 MPRE 0 Multiprocessor reservation enable
  274. * 2 MLRC 11 Multi level reservation control (00=IRQ4, 01=3State, 10=KR/RETRY, 11=SPKROUT)
  275. * 1 AEME 0 Async external master enable
  276. * 1 SEME 0 Sync external master enable
  277. * 1 BSC 0 Byte strobe configuration
  278. * 1 GB5E 0 GPL_B5 enable
  279. * 1 B2DD 0 Bank 2 double drive
  280. * 1 B3DD 0 Bank 3 double drive
  281. * 4 0 0000
  282. */
  283. #define CONFIG_SYS_SIUMCR (SIUMCR_MLRC11)
  284. /*-----------------------------------------------------------------------
  285. * TBSCR - Time Base Status and Control 11-26
  286. *-----------------------------------------------------------------------
  287. * Clear Reference Interrupt Status, Timebase freezing enabled
  288. */
  289. #define CONFIG_SYS_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
  290. /*-----------------------------------------------------------------------
  291. * PISCR - Periodic Interrupt Status and Control 11-31
  292. *-----------------------------------------------------------------------
  293. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  294. */
  295. #define CONFIG_SYS_PISCR (PISCR_PS | PISCR_PITF | PISCR_PTE)
  296. /*-----------------------------------------------------------------------
  297. * SCCR - System Clock and reset Control Register 15-27
  298. *-----------------------------------------------------------------------
  299. * set up SCCR (System Clock and Reset Control Register)
  300. * 1 0 0
  301. * 2 COM 11 Clock output module (00=full, 01=half, 11=off)
  302. * 3 0 000
  303. * 1 TBS 1 Timebase source (0=OSCCLK, 1=GCLK2)
  304. * 1 RTDIV 0 Real-time clock divide (0=/4, 1=/512)
  305. * 1 RTSEL 0 Real-time clock select (0=OSCM, 1=EXTCLK)
  306. * 1 CRQEN 0 CPM request enable
  307. * 1 PRQEN 0 Power management request enable
  308. * 2 0 00
  309. * 2 EBDF xx External bus division factor
  310. * 2 0 00
  311. * 2 DFSYNC 00 Division factor for SYNCLK
  312. * 2 DFBRG 00 Division factor for BRGCLK
  313. * 3 DFNL 000 Division factor low frequency
  314. * 3 DFNH 000 Division factor high frequency
  315. * 5 0 00000
  316. */
  317. #define SCCR_MASK 0
  318. #ifdef CONFIG_EBDF
  319. #define CONFIG_SYS_SCCR (SCCR_COM11 | SCCR_TBS | SCCR_EBDF01)
  320. #else
  321. #define CONFIG_SYS_SCCR (SCCR_COM11 | SCCR_TBS)
  322. #endif
  323. /*-----------------------------------------------------------------------
  324. * Chip Select 0 - FLASH
  325. *-----------------------------------------------------------------------
  326. * Preliminary Values
  327. */
  328. /* FLASH timing: CSNT=1 ACS=10 BIH=1 SCY=4 SETA=0 TLRX=1 EHTR=1 */
  329. #define CONFIG_SYS_OR_TIMING_FLASH (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_4_CLK | OR_TRLX | OR_EHTR)
  330. #define CONFIG_SYS_OR0_PRELIM (-CONFIG_SYS_FLASH_MAX | CONFIG_SYS_OR_TIMING_FLASH)
  331. #define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | BR_PS_16 | BR_V )
  332. /*-----------------------------------------------------------------------
  333. * misc
  334. *-----------------------------------------------------------------------
  335. *
  336. */
  337. /*
  338. * Set the autoboot delay in seconds. A delay of -1 disables autoboot
  339. */
  340. #define CONFIG_BOOTDELAY 5
  341. /*
  342. * Pass the clock frequency to the Linux kernel in units of MHz
  343. */
  344. #define CONFIG_CLOCKS_IN_MHZ
  345. #define CONFIG_PREBOOT \
  346. "echo;echo"
  347. #undef CONFIG_BOOTARGS
  348. #define CONFIG_BOOTCOMMAND \
  349. "bootp;" \
  350. "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} " \
  351. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
  352. "bootm"
  353. /*
  354. * BOOTP options
  355. */
  356. #define CONFIG_BOOTP_SUBNETMASK
  357. #define CONFIG_BOOTP_GATEWAY
  358. #define CONFIG_BOOTP_HOSTNAME
  359. #define CONFIG_BOOTP_BOOTPATH
  360. #define CONFIG_BOOTP_BOOTFILESIZE
  361. /*
  362. * Set default IP stuff just to get bootstrap entries into the
  363. * environment so that we can source the full default environment.
  364. */
  365. #define CONFIG_ETHADDR 9a:52:63:15:85:25
  366. #define CONFIG_SERVERIP 10.0.4.200
  367. #define CONFIG_IPADDR 10.0.4.111
  368. #define CONFIG_SYS_LOAD_ADDR 0x00100000 /* default load address */
  369. #define CONFIG_SYS_TFTP_LOADADDR 0x00100000
  370. /*
  371. * For booting Linux, the board info and command line data
  372. * have to be in the first 8 MB of memory, since this is
  373. * the maximum mapped by the Linux kernel during initialization.
  374. */
  375. #define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  376. #endif /* __CONFIG_H */