GTH.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. /*
  2. * Parameters for GTH board
  3. * Based on FADS860T
  4. * by thomas.lange@corelatus.com
  5. * A collection of structures, addresses, and values associated with
  6. * the Motorola 860T FADS board. Copied from the MBX stuff.
  7. * Magnus Damm added defines for 8xxrom and extended bd_info.
  8. * Helmut Buchsbaum added bitvalues for BCSRx
  9. *
  10. * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
  11. */
  12. /*
  13. * ff000000 -> ff00ffff : IMAP internal in the cpu
  14. * e0000000 -> ennnnnnn : pcmcia
  15. * 98000000 -> 983nnnnn : FPGA 4MB
  16. * 90000000 -> 903nnnnn : FPGA 4MB
  17. * 80000000 -> 80nnnnnn : flash connected to CS0, final ( real ) location
  18. * 00000000 -> nnnnnnnn : sdram
  19. */
  20. /* ------------------------------------------------------------------------- */
  21. /*
  22. * board/config.h - configuration options, board specific
  23. */
  24. #ifndef __CONFIG_H
  25. #define __CONFIG_H
  26. /*
  27. * High Level Configuration Options
  28. * (easy to change)
  29. */
  30. #include <mpc8xx_irq.h>
  31. #define CONFIG_MPC860 1
  32. #define CONFIG_MPC860T 1
  33. #define CONFIG_GTH 1
  34. #define CONFIG_MISC_INIT_R 1
  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 9600
  39. #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
  40. #define MPC8XX_FACT 3 /* Multiply by 3 */
  41. #define MPC8XX_XIN 16384000 /* 16.384 MHz */
  42. #define MPC8XX_HZ ((MPC8XX_XIN) * (MPC8XX_FACT))
  43. #define CONFIG_BOOTDELAY 1 /* autoboot after 0 seconds */
  44. #define CONFIG_ENV_OVERWRITE 1 /* Allow change of ethernet address */
  45. #define CONFIG_BOOT_RETRY_TIME 5 /* Retry boot in 5 secs */
  46. #define CONFIG_RESET_TO_RETRY 1 /* If timeout waiting for command, perform a reset */
  47. /* Only interrupt boot if space is pressed */
  48. /* If a long serial cable is connected but */
  49. /* other end is dead, garbage will be read */
  50. #define CONFIG_AUTOBOOT_KEYED 1
  51. #define CONFIG_AUTOBOOT_PROMPT "Press space to abort autoboot in %d second\n"
  52. #define CONFIG_AUTOBOOT_DELAY_STR "d"
  53. #define CONFIG_AUTOBOOT_STOP_STR " "
  54. #if 0
  55. /* Net boot */
  56. /* Loads a tftp image and starts it */
  57. #define CONFIG_BOOTCOMMAND "bootp;bootm 100000" /* autoboot command */
  58. #define CONFIG_BOOTARGS "panic=1"
  59. #else
  60. /* Compact flash boot */
  61. #define CONFIG_BOOTARGS "panic=1 root=/dev/hda7"
  62. #define CONFIG_BOOTCOMMAND "disk 100000 0:5;bootm 100000"
  63. #endif
  64. /* Enable watchdog */
  65. #define CONFIG_WATCHDOG 1
  66. /* choose SCC1 ethernet (10BASET on motherboard)
  67. * or FEC ethernet (10/100 on daughterboard)
  68. */
  69. #if 1
  70. #define CONFIG_SCC1_ENET 1 /* use SCC1 ethernet */
  71. #undef CONFIG_FEC_ENET /* disable FEC ethernet */
  72. #define CFG_DISCOVER_PHY
  73. #else
  74. #undef CONFIG_SCC1_ENET /* disable SCC1 ethernet */
  75. #define CONFIG_FEC_ENET 1 /* use FEC ethernet */
  76. #define CFG_DISCOVER_PHY
  77. #endif
  78. #if defined(CONFIG_SCC1_ENET) && defined(CONFIG_FEC_ENET)
  79. #error Both CONFIG_SCC1_ENET and CONFIG_FEC_ENET configured
  80. #endif
  81. #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_IDE)
  82. #define CONFIG_MAC_PARTITION
  83. #define CONFIG_DOS_PARTITION
  84. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  85. #include <cmd_confdefs.h>
  86. /*
  87. * Miscellaneous configurable options
  88. */
  89. #define CFG_PROMPT "=>" /* Monitor Command Prompt */
  90. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  91. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  92. #else
  93. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  94. #endif
  95. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  96. #define CFG_MAXARGS 16 /* max number of command args */
  97. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  98. #define CFG_MEMTEST_START 0x0100000 /* memtest works on */
  99. #define CFG_MEMTEST_END 0x0400000 /* 1 ... 4 MB in DRAM */
  100. /* Default location to load data from net */
  101. #define CFG_LOAD_ADDR 0x100000
  102. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  103. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400 }
  104. /*
  105. * Low Level Configuration Settings
  106. * (address mappings, register initial values, etc.)
  107. * You should know what you are doing if you make changes here.
  108. */
  109. /*-----------------------------------------------------------------------
  110. * Internal Memory Mapped Register
  111. */
  112. #define CFG_IMMR 0xFF000000
  113. #define CFG_IMMR_SIZE ((uint)(64 * 1024))
  114. /*-----------------------------------------------------------------------
  115. * Definitions for initial stack pointer and data area (in DPRAM)
  116. */
  117. #define CFG_INIT_RAM_ADDR CFG_IMMR
  118. #define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
  119. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  120. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  121. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  122. /*-----------------------------------------------------------------------
  123. * Start addresses for the final memory configuration
  124. * (Set up by the startup code)
  125. * Please note that CFG_SDRAM_BASE _must_ start at 0
  126. */
  127. #define CFG_SDRAM_BASE 0x00000000
  128. #define CFG_FLASH_BASE 0x80000000
  129. #define CFG_FLASH_SIZE ((uint)(8 * 1024 * 1024)) /* max 8Mbyte */
  130. #define CFG_MONITOR_LEN (384 << 10) /* Reserve 384 kB for Monitor */
  131. #define CFG_MONITOR_BASE TEXT_BASE
  132. #define CFG_MALLOC_LEN (384 << 10) /* Reserve 384 kB for malloc() */
  133. /*
  134. * For booting Linux, the board info and command line data
  135. * have to be in the first 8 MB of memory, since this is
  136. * the maximum mapped by the Linux kernel during initialization.
  137. */
  138. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  139. /*-----------------------------------------------------------------------
  140. * FLASH organization
  141. */
  142. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  143. #define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  144. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  145. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  146. #define CFG_ENV_IS_IN_FLASH 1
  147. #undef CFG_ENV_IS_IN_EEPROM
  148. #define CFG_ENV_OFFSET 0x000E0000
  149. #define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
  150. #define CFG_ENV_SECT_SIZE 0x50000 /* see README - env sector total size */
  151. /*-----------------------------------------------------------------------
  152. * Cache Configuration
  153. */
  154. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  155. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  156. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  157. #endif
  158. /*-----------------------------------------------------------------------
  159. * SYPCR - System Protection Control 11-9
  160. * SYPCR can only be written once after reset!
  161. *-----------------------------------------------------------------------
  162. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  163. */
  164. #if defined(CONFIG_WATCHDOG)
  165. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  166. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  167. #else
  168. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  169. #endif
  170. /*-----------------------------------------------------------------------
  171. * SIUMCR - SIU Module Configuration 11-6
  172. *-----------------------------------------------------------------------
  173. * PCMCIA config., multi-function pin tri-state
  174. */
  175. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
  176. /*-----------------------------------------------------------------------
  177. * TBSCR - Time Base Status and Control 11-26
  178. *-----------------------------------------------------------------------
  179. * Clear Reference Interrupt Status, Timebase freezing enabled
  180. */
  181. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
  182. /*----------------------------------------------------------------------
  183. * RTCSC - Real-Time Clock Status and Control Register 11-27
  184. *-----------------------------------------------------------------------
  185. */
  186. /*FIXME dont use for now */
  187. /*#define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE) */
  188. /*#define CFG_RTCSC (RTCSC_RTF) */
  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. /* PITE */
  196. /*-----------------------------------------------------------------------
  197. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  198. *-----------------------------------------------------------------------
  199. * set the PLL, the low-power modes and the reset control (15-29)
  200. */
  201. #define CFG_PLPRCR (((MPC8XX_FACT-1) << PLPRCR_MF_SHIFT) | \
  202. PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
  203. /*-----------------------------------------------------------------------
  204. * SCCR - System Clock and reset Control Register 15-27
  205. *-----------------------------------------------------------------------
  206. * Set clock output, timebase and RTC source and divider,
  207. * power management and some other internal clocks
  208. */
  209. /* FIXME check values */
  210. #define SCCR_MASK SCCR_EBDF11
  211. #define CFG_SCCR (SCCR_TBS|SCCR_RTSEL|SCCR_COM00|SCCR_DFSYNC00|SCCR_DFBRG00|SCCR_DFNL000|SCCR_DFNH000|SCCR_DFLCD000|SCCR_DFALCD00)
  212. /*-----------------------------------------------------------------------
  213. *
  214. *-----------------------------------------------------------------------
  215. *
  216. */
  217. #define CFG_DER 0
  218. /* Because of the way the 860 starts up and assigns CS0 the
  219. * entire address space, we have to set the memory controller
  220. * differently. Normally, you write the option register
  221. * first, and then enable the chip select by writing the
  222. * base register. For CS0, you must write the base register
  223. * first, followed by the option register.
  224. */
  225. /*
  226. * Init Memory Controller:
  227. *
  228. * BR0/1 and OR0/1 (FLASH)
  229. */
  230. /* the other CS:s are determined by looking at parameters in BCSRx */
  231. #define FLASH_BASE0_PRELIM CFG_FLASH_BASE /* FLASH bank #0 */
  232. #define CFG_REMAP_OR_AM 0xFF800000 /* 4 MB OR addr mask */
  233. #define CFG_PRELIM_OR_AM 0xFF800000 /* OR addr mask */
  234. #define FPGA_2_BASE 0x90000000
  235. #define FPGA_3_BASE 0x98000000
  236. /* FLASH timing: ACS = 10, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 0 */
  237. #define CFG_OR_TIMING_FLASH (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK | OR_TRLX)
  238. #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  239. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH) /* 1 Mbyte until detected and only 1 Mbyte is needed*/
  240. #define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V | BR_PS_16 )
  241. /*
  242. * Internal Definitions
  243. *
  244. * Boot Flags
  245. */
  246. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  247. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  248. #define CONFIG_ETHADDR DE:AD:BE:EF:00:01 /* Ethernet address */
  249. #ifdef CONFIG_MPC860T
  250. /* Interrupt level assignments.
  251. */
  252. #define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
  253. #endif /* CONFIG_MPC860T */
  254. /* We don't use the 8259.
  255. */
  256. #define NR_8259_INTS 0
  257. /* Machine type
  258. */
  259. #define _MACH_8xx (_MACH_gth)
  260. #ifdef CONFIG_MPC860
  261. #define PCMCIA_SLOT_A 1
  262. #define CONFIG_PCMCIA_SLOT_A 1
  263. #endif
  264. #define CFG_PCMCIA_MEM_ADDR (0xE0000000)
  265. #define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
  266. #define CFG_PCMCIA_DMA_ADDR (0xE4000000)
  267. #define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
  268. #define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
  269. #define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
  270. #define CFG_PCMCIA_IO_ADDR (0xEC000000)
  271. #define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
  272. #define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
  273. #undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
  274. #undef CONFIG_IDE_LED /* LED for ide not supported */
  275. #undef CONFIG_IDE_RESET /* reset for ide not supported */
  276. #define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
  277. #define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
  278. #define CFG_ATA_IDE0_OFFSET 0x0000
  279. #define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
  280. /* Offset for data I/O */
  281. #define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
  282. /* Offset for normal register accesses */
  283. #define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
  284. /* Offset for alternate registers */
  285. #define CFG_ATA_ALT_OFFSET 0x0100
  286. #define CONFIG_8xx_GCLK_FREQ MPC8XX_HZ /* Force it - dont measure it */
  287. #define PA_FRONT_LED ((u16)0x4) /* PA 13 */
  288. #define PA_FL_CONFIG ((u16)0x20) /* PA 10 */
  289. #define PA_FL_CE ((u16)0x1000) /* PA 3 */
  290. #define PB_ID_GND ((u32)1) /* PB 31 */
  291. #define PB_REV_1 ((u32)2) /* PB 30 */
  292. #define PB_REV_0 ((u32)4) /* PB 29 */
  293. #define PB_BLUE_LED ((u32)0x400) /* PB 21 */
  294. #define PB_EEPROM ((u32)0x800) /* PB 20 */
  295. #define PB_ID_3 ((u32)0x2000) /* PB 18 */
  296. #define PB_ID_2 ((u32)0x4000) /* PB 17 */
  297. #define PB_ID_1 ((u32)0x8000) /* PB 16 */
  298. #define PB_ID_0 ((u32)0x10000) /* PB 15 */
  299. /* NOTE. This is reset for 100Mbit port only */
  300. #define PC_ENET100_RESET ((ushort)0x0080) /* PC 8 */
  301. #endif /* __CONFIG_H */