MPC86xADS.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. /*
  2. * A collection of structures, addresses, and values associated with
  3. * the Motorola MPC8xxADS board. Copied from the FADS config.
  4. *
  5. * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
  6. */
  7. /*
  8. * 1999-nov-26: The FADS is using the following physical memorymap:
  9. *
  10. * ff020000 -> ff02ffff : pcmcia
  11. * ff010000 -> ff01ffff : BCSR connected to CS1
  12. * ff000000 -> ff00ffff : IMAP internal in the cpu
  13. * fe000000 -> fennnnnn : flash connected to CS0
  14. * 00000000 -> nnnnnnnn : sdram connected to CS4
  15. */
  16. /* ------------------------------------------------------------------------- */
  17. /*
  18. * board/config.h - configuration options, board specific
  19. */
  20. #ifndef __CONFIG_H
  21. #define __CONFIG_H
  22. /*
  23. * High Level Configuration Options
  24. * (easy to change)
  25. */
  26. /* board type */
  27. #define CONFIG_MPC86xADS 1 /* new ADS */
  28. #define CONFIG_FADS 1 /* We are FADS compatible (more or less) */
  29. /* new 86xADS only - pick one of these */
  30. #define CONFIG_MPC866T 1
  31. #undef CONFIG_MPC866P
  32. #undef CONFIG_MPC859T
  33. #undef CONFIG_MPC859DSL
  34. #undef CONFIG_MPC852T
  35. #define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
  36. #undef CONFIG_8xx_CONS_SMC2
  37. #undef CONFIG_8xx_CONS_NONE
  38. #define CONFIG_BAUDRATE 38400
  39. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  40. #ifdef CONFIG_MPC86xADS
  41. # define CFG_8XX_FACT 5 /* Multiply by 5 */
  42. # define CFG_8XX_XIN 10000000 /* 10 MHz in */
  43. #else /* ! CONFIG_MPC86xADS */
  44. # if 0 /* old FADS */
  45. # define CFG_8XX_FACT 12 /* Multiply by 12 */
  46. # define CFG_8XX_XIN 4000000 /* 4 MHz in */
  47. # else /* new FADS */
  48. # define CFG_8XX_FACT 10 /* Multiply by 10 */
  49. # define CFG_8XX_XIN 5000000 /* 5 MHz in */
  50. # endif
  51. #endif /* ! CONFIG_MPC86xADS */
  52. #define MPC8XX_HZ ((CFG_8XX_XIN) * (CFG_8XX_FACT))
  53. /* should ALWAYS define this, measure_gclk in speed.c is unreliable */
  54. /* in general, we always know this for FADS+new ADS anyway */
  55. #define CONFIG_8xx_GCLK_FREQ MPC8XX_HZ
  56. #if 1
  57. #define CONFIG_BOOTDELAY -1 /* autoboot disabled */
  58. #else
  59. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  60. #endif
  61. #undef CONFIG_BOOTARGS
  62. #define CONFIG_BOOTCOMMAND \
  63. "dhcp;" \
  64. "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
  65. "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
  66. "bootm"
  67. #undef CONFIG_WATCHDOG /* watchdog disabled */
  68. /* ATA / IDE and partition support */
  69. #define CONFIG_MAC_PARTITION 1
  70. #define CONFIG_DOS_PARTITION 1
  71. #define CONFIG_ISO_PARTITION 1
  72. #undef CONFIG_ATAPI
  73. #define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
  74. #undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
  75. #undef CONFIG_IDE_LED /* LED for ide not supported */
  76. #undef CONFIG_IDE_RESET /* reset for ide not supported */
  77. /*
  78. * New MPC86xADS provides two Ethernet connectivity options:
  79. * 10Mbit/s on SCC1 and 100Mbit/s on FEC. All new PQ1 chips
  80. * has got FEC so FEC is the default.
  81. */
  82. #undef CONFIG_SCC1_ENET /* disable SCC1 ethernet */
  83. #define CONFIG_FEC_ENET 1 /* use FEC ethernet */
  84. #ifdef CONFIG_FEC_ENET
  85. #define CFG_DISCOVER_PHY
  86. #endif
  87. #if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET)
  88. #error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured
  89. #endif
  90. #define CONFIG_COMMANDS (CONFIG_CMD_DFL \
  91. | CFG_CMD_DHCP \
  92. | CFG_CMD_IMMAP \
  93. | CFG_CMD_MII \
  94. | CFG_CMD_PING \
  95. )
  96. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  97. #include <cmd_confdefs.h>
  98. /*
  99. * Miscellaneous configurable options
  100. */
  101. #undef CFG_LONGHELP /* undef to save memory */
  102. #define CFG_PROMPT "=>" /* Monitor Command Prompt */
  103. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  104. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  105. #else
  106. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  107. #endif
  108. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  109. #define CFG_MAXARGS 16 /* max number of command args */
  110. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  111. #define CFG_LOAD_ADDR 0x00100000
  112. #define CFG_HZ 1000 /* decr freq: 1 ms ticks */
  113. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  114. /*
  115. * Low Level Configuration Settings
  116. * (address mappings, register initial values, etc.)
  117. * You should know what you are doing if you make changes here.
  118. */
  119. /*-----------------------------------------------------------------------
  120. * Internal Memory Mapped Register
  121. */
  122. #define CFG_IMMR 0xFF000000
  123. #define CFG_IMMR_SIZE ((uint)(64 * 1024))
  124. /*-----------------------------------------------------------------------
  125. * Definitions for initial stack pointer and data area (in DPRAM)
  126. */
  127. #define CFG_INIT_RAM_ADDR CFG_IMMR
  128. #define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
  129. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  130. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  131. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  132. /*-----------------------------------------------------------------------
  133. * Start addresses for the final memory configuration
  134. * (Set up by the startup code)
  135. * Please note that CFG_SDRAM_BASE _must_ start at 0
  136. */
  137. #define CFG_SDRAM_BASE 0x00000000
  138. #if defined(CONFIG_MPC86xADS) /* new ADS */
  139. #define CFG_SDRAM_SIZE 0x00800000 /* 8 meg */
  140. #elif defined(CONFIG_FADS) /* old/new FADS */
  141. #define CFG_SDRAM_SIZE 0x00400000 /* 4 meg */
  142. #else /* old ADS */
  143. #define CFG_SDRAM_SIZE 0x00000000 /* No SDRAM */
  144. #endif
  145. #define CFG_MEMTEST_START 0x0100000 /* memtest works on */
  146. #if (CFG_SDRAM_SIZE)
  147. #define CFG_MEMTEST_END CFG_SDRAM_SIZE /* 1 ... SDRAM_SIZE */
  148. #else
  149. #define CFG_MEMTEST_END 0x0400000 /* 1 ... 4 MB in DRAM */
  150. #endif /* CFG_SDRAM_SIZE */
  151. /*
  152. * For booting Linux, the board info and command line data
  153. * have to be in the first 8 MB of memory, since this is
  154. * the maximum mapped by the Linux kernel during initialization.
  155. */
  156. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  157. /*-----------------------------------------------------------------------
  158. * FLASH organization
  159. */
  160. #define CFG_FLASH_BASE TEXT_BASE
  161. #define CFG_FLASH_SIZE ((uint)(8 * 1024 * 1024)) /* max 8Mbyte */
  162. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  163. #define CFG_MAX_FLASH_SECT 16 /* max number of sectors on one chip */
  164. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  165. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  166. #define CFG_ENV_IS_IN_FLASH 1
  167. #define CFG_ENV_SECT_SIZE 0x40000 /* see README - env sector total size */
  168. #define CFG_ENV_OFFSET CFG_ENV_SECT_SIZE
  169. #define CFG_ENV_SIZE 0x4000 /* Total Size of Environment */
  170. #define CFG_MONITOR_BASE CFG_FLASH_BASE
  171. #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 KB for monitor */
  172. #define CFG_MALLOC_LEN (384 << 10) /* Reserve 384 kB for malloc() */
  173. /*-----------------------------------------------------------------------
  174. * Cache Configuration
  175. */
  176. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  177. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  178. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  179. #endif
  180. /*-----------------------------------------------------------------------
  181. * SYPCR - System Protection Control 11-9
  182. * SYPCR can only be written once after reset!
  183. *-----------------------------------------------------------------------
  184. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  185. */
  186. #if defined(CONFIG_WATCHDOG)
  187. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  188. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  189. #else
  190. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  191. #endif
  192. /*-----------------------------------------------------------------------
  193. * SIUMCR - SIU Module Configuration 11-6
  194. *-----------------------------------------------------------------------
  195. * PCMCIA config., multi-function pin tri-state
  196. */
  197. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
  198. /*-----------------------------------------------------------------------
  199. * TBSCR - Time Base Status and Control 11-26
  200. *-----------------------------------------------------------------------
  201. * Clear Reference Interrupt Status, Timebase freezing enabled
  202. */
  203. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBE)
  204. /*-----------------------------------------------------------------------
  205. * PISCR - Periodic Interrupt Status and Control 11-31
  206. *-----------------------------------------------------------------------
  207. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  208. */
  209. #define CFG_PISCR (PISCR_PS | PISCR_PITF)
  210. /*-----------------------------------------------------------------------
  211. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  212. *-----------------------------------------------------------------------
  213. * set the PLL, the low-power modes and the reset control (15-29)
  214. */
  215. #define CFG_PLPRCR ((CFG_8XX_FACT << PLPRCR_MFI_SHIFT) | \
  216. PLPRCR_SPLSS | PLPRCR_TEXPS)
  217. /*-----------------------------------------------------------------------
  218. * SCCR - System Clock and reset Control Register 15-27
  219. *-----------------------------------------------------------------------
  220. * Set clock output, timebase and RTC source and divider,
  221. * power management and some other internal clocks
  222. */
  223. #define SCCR_MASK SCCR_EBDF11
  224. #define CFG_SCCR (SCCR_TBS|SCCR_COM00|SCCR_DFSYNC00|SCCR_DFBRG00|SCCR_DFNL000|SCCR_DFNH000|SCCR_DFLCD000|SCCR_DFALCD00)
  225. /*-----------------------------------------------------------------------
  226. *
  227. *-----------------------------------------------------------------------
  228. *
  229. */
  230. #define CFG_DER 0
  231. /* Because of the way the 860 starts up and assigns CS0 the
  232. * entire address space, we have to set the memory controller
  233. * differently. Normally, you write the option register
  234. * first, and then enable the chip select by writing the
  235. * base register. For CS0, you must write the base register
  236. * first, followed by the option register.
  237. */
  238. /*
  239. * Init Memory Controller:
  240. *
  241. * BR0/OR0 (Flash)
  242. * BR1/OR1 (BCSR)
  243. */
  244. /* the other CS:s are determined by looking at parameters in BCSRx */
  245. #define BCSR_ADDR ((uint) 0xFF010000)
  246. #define BCSR_SIZE ((uint)(64 * 1024))
  247. #define CFG_PRELIM_OR_AM 0xFF800000 /* OR addr mask */
  248. /* FLASH timing: ACS = 10, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 0 */
  249. #define CFG_OR_TIMING_FLASH (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK | OR_TRLX)
  250. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH) /* 8 Mbyte until detected */
  251. #define CFG_BR0_PRELIM ((CFG_FLASH_BASE & BR_BA_MSK) | BR_V )
  252. /* BCSRx - Board Control and Status Registers */
  253. #define CFG_OR1_PRELIM 0xffff8110 /* 64Kbyte address space */
  254. #define CFG_BR1_PRELIM ((BCSR_ADDR) | BR_V )
  255. /*
  256. * Internal Definitions
  257. *
  258. * Boot Flags
  259. */
  260. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  261. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  262. /* values according to the manual */
  263. #define PCMCIA_MEM_ADDR ((uint)0xff020000)
  264. #define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
  265. #define BCSR0 ((uint) (BCSR_ADDR + 0x00))
  266. #define BCSR1 ((uint) (BCSR_ADDR + 0x04))
  267. #define BCSR2 ((uint) (BCSR_ADDR + 0x08))
  268. #define BCSR3 ((uint) (BCSR_ADDR + 0x0c))
  269. #define BCSR4 ((uint) (BCSR_ADDR + 0x10))
  270. /* FADS bitvalues by Helmut Buchsbaum
  271. * see MPC8xxADS User's Manual for a proper description
  272. * of the following structures
  273. */
  274. #define BCSR0_ERB ((uint)0x80000000)
  275. #define BCSR0_IP ((uint)0x40000000)
  276. #define BCSR0_BDIS ((uint)0x10000000)
  277. #define BCSR0_BPS_MASK ((uint)0x0C000000)
  278. #define BCSR0_ISB_MASK ((uint)0x01800000)
  279. #define BCSR0_DBGC_MASK ((uint)0x00600000)
  280. #define BCSR0_DBPC_MASK ((uint)0x00180000)
  281. #define BCSR0_EBDF_MASK ((uint)0x00060000)
  282. #define BCSR1_FLASH_EN ((uint)0x80000000)
  283. #define BCSR1_DRAM_EN ((uint)0x40000000)
  284. #define BCSR1_ETHEN ((uint)0x20000000)
  285. #define BCSR1_IRDEN ((uint)0x10000000)
  286. #define BCSR1_FLASH_CFG_EN ((uint)0x08000000)
  287. #define BCSR1_CNT_REG_EN_PROTECT ((uint)0x04000000)
  288. #define BCSR1_BCSR_EN ((uint)0x02000000)
  289. #define BCSR1_RS232EN_1 ((uint)0x01000000)
  290. #define BCSR1_PCCEN ((uint)0x00800000)
  291. #define BCSR1_PCCVCC0 ((uint)0x00400000)
  292. #define BCSR1_PCCVPP_MASK ((uint)0x00300000)
  293. #define BCSR1_DRAM_HALF_WORD ((uint)0x00080000)
  294. #define BCSR1_RS232EN_2 ((uint)0x00040000)
  295. #define BCSR1_SDRAM_EN ((uint)0x00020000)
  296. #define BCSR1_PCCVCC1 ((uint)0x00010000)
  297. #define BCSR2_FLASH_PD_MASK ((uint)0xF0000000)
  298. #define BCSR2_DRAM_PD_MASK ((uint)0x07800000)
  299. #define BCSR2_DRAM_PD_SHIFT (23)
  300. #define BCSR2_EXTTOLI_MASK ((uint)0x00780000)
  301. #define BCSR2_DBREVNR_MASK ((uint)0x00030000)
  302. #define BCSR3_DBID_MASK ((ushort)0x3800)
  303. #define BCSR3_CNT_REG_EN_PROTECT ((ushort)0x0400)
  304. #define BCSR3_BREVNR0 ((ushort)0x0080)
  305. #define BCSR3_FLASH_PD_MASK ((ushort)0x0070)
  306. #define BCSR3_BREVN1 ((ushort)0x0008)
  307. #define BCSR3_BREVN2_MASK ((ushort)0x0003)
  308. #define BCSR4_ETHLOOP ((uint)0x80000000)
  309. #define BCSR4_TFPLDL ((uint)0x40000000)
  310. #define BCSR4_TPSQEL ((uint)0x20000000)
  311. #define BCSR4_SIGNAL_LAMP ((uint)0x10000000)
  312. #define BCSR4_FETH_EN ((uint)0x08000000)
  313. #define BCSR4_FETHCFG0 ((uint)0x04000000)
  314. #define BCSR4_FETHFDE ((uint)0x02000000)
  315. #define BCSR4_FETHCFG1 ((uint)0x00400000)
  316. #define BCSR4_FETHRST ((uint)0x00200000)
  317. #define CONFIG_DRAM_50MHZ 1
  318. #define CONFIG_SDRAM_50MHZ 1
  319. /* We don't use the 8259.
  320. */
  321. #define NR_8259_INTS 0
  322. /* Machine type
  323. */
  324. #define _MACH_8xx (_MACH_fads)
  325. #define CONFIG_DISK_SPINUP_TIME 1000000
  326. /* PCMCIA configuration */
  327. #ifdef CONFIG_MPC860
  328. #define PCMCIA_SLOT_A 1
  329. #endif
  330. #define CFG_PCMCIA_MEM_ADDR (0x50000000)
  331. #define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
  332. #define CFG_PCMCIA_DMA_ADDR (0x54000000)
  333. #define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
  334. #define CFG_PCMCIA_ATTRB_ADDR (0x58000000)
  335. #define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
  336. #define CFG_PCMCIA_IO_ADDR (0x5C000000)
  337. #define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
  338. /* we have 8 windows, we take everything up to 60000000 */
  339. #define CFG_ATA_IDE0_OFFSET 0x0000
  340. #define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
  341. /* Offset for data I/O */
  342. #define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
  343. /* Offset for normal register accesses */
  344. #define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
  345. /* Offset for alternate registers */
  346. #define CFG_ATA_ALT_OFFSET 0x0000
  347. /*#define CFG_ATA_ALT_OFFSET 0x0100 */
  348. #endif /* __CONFIG_H */