MPC86xADS.h 15 KB

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