GTH.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. /*
  82. * BOOTP options
  83. */
  84. #define CONFIG_BOOTP_BOOTFILESIZE
  85. #define CONFIG_BOOTP_BOOTPATH
  86. #define CONFIG_BOOTP_GATEWAY
  87. #define CONFIG_BOOTP_HOSTNAME
  88. /*
  89. * Command line configuration.
  90. */
  91. #include <config_cmd_default.h>
  92. #define CONFIG_CMD_IDE
  93. #define CONFIG_MAC_PARTITION
  94. #define CONFIG_DOS_PARTITION
  95. /*
  96. * Miscellaneous configurable options
  97. */
  98. #define CFG_PROMPT "=>" /* Monitor Command Prompt */
  99. #if defined(CONFIG_CMD_KGDB)
  100. #define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
  101. #else
  102. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  103. #endif
  104. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  105. #define CFG_MAXARGS 16 /* max number of command args */
  106. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  107. #define CFG_MEMTEST_START 0x0100000 /* memtest works on */
  108. #define CFG_MEMTEST_END 0x0400000 /* 1 ... 4 MB in DRAM */
  109. /* Default location to load data from net */
  110. #define CFG_LOAD_ADDR 0x100000
  111. #define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
  112. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400 }
  113. /*
  114. * Low Level Configuration Settings
  115. * (address mappings, register initial values, etc.)
  116. * You should know what you are doing if you make changes here.
  117. */
  118. /*-----------------------------------------------------------------------
  119. * Internal Memory Mapped Register
  120. */
  121. #define CFG_IMMR 0xFF000000
  122. #define CFG_IMMR_SIZE ((uint)(64 * 1024))
  123. /*-----------------------------------------------------------------------
  124. * Definitions for initial stack pointer and data area (in DPRAM)
  125. */
  126. #define CFG_INIT_RAM_ADDR CFG_IMMR
  127. #define CFG_INIT_RAM_END 0x2F00 /* End of used area in DPRAM */
  128. #define CFG_GBL_DATA_SIZE 64 /* size in bytes reserved for initial data */
  129. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  130. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  131. /*-----------------------------------------------------------------------
  132. * Start addresses for the final memory configuration
  133. * (Set up by the startup code)
  134. * Please note that CFG_SDRAM_BASE _must_ start at 0
  135. */
  136. #define CFG_SDRAM_BASE 0x00000000
  137. #define CFG_FLASH_BASE 0x80000000
  138. #define CFG_FLASH_SIZE ((uint)(8 * 1024 * 1024)) /* max 8Mbyte */
  139. #define CFG_MONITOR_LEN (384 << 10) /* Reserve 384 kB for Monitor */
  140. #define CFG_MONITOR_BASE TEXT_BASE
  141. #define CFG_MALLOC_LEN (384 << 10) /* Reserve 384 kB for malloc() */
  142. /*
  143. * For booting Linux, the board info and command line data
  144. * have to be in the first 8 MB of memory, since this is
  145. * the maximum mapped by the Linux kernel during initialization.
  146. */
  147. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  148. /*-----------------------------------------------------------------------
  149. * FLASH organization
  150. */
  151. #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
  152. #define CFG_MAX_FLASH_SECT 8 /* max number of sectors on one chip */
  153. #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
  154. #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
  155. #define CFG_ENV_IS_IN_FLASH 1
  156. #undef CFG_ENV_IS_IN_EEPROM
  157. #define CFG_ENV_OFFSET 0x000E0000
  158. #define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
  159. #define CFG_ENV_SECT_SIZE 0x50000 /* see README - env sector total size */
  160. /*-----------------------------------------------------------------------
  161. * Cache Configuration
  162. */
  163. #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */
  164. #if defined(CONFIG_CMD_KGDB)
  165. #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */
  166. #endif
  167. /*-----------------------------------------------------------------------
  168. * SYPCR - System Protection Control 11-9
  169. * SYPCR can only be written once after reset!
  170. *-----------------------------------------------------------------------
  171. * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog freeze
  172. */
  173. #if defined(CONFIG_WATCHDOG)
  174. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
  175. SYPCR_SWE | SYPCR_SWRI| SYPCR_SWP)
  176. #else
  177. #define CFG_SYPCR (SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | SYPCR_SWP)
  178. #endif
  179. /*-----------------------------------------------------------------------
  180. * SIUMCR - SIU Module Configuration 11-6
  181. *-----------------------------------------------------------------------
  182. * PCMCIA config., multi-function pin tri-state
  183. */
  184. #define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
  185. /*-----------------------------------------------------------------------
  186. * TBSCR - Time Base Status and Control 11-26
  187. *-----------------------------------------------------------------------
  188. * Clear Reference Interrupt Status, Timebase freezing enabled
  189. */
  190. #define CFG_TBSCR (TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)
  191. /*----------------------------------------------------------------------
  192. * RTCSC - Real-Time Clock Status and Control Register 11-27
  193. *-----------------------------------------------------------------------
  194. */
  195. /*FIXME dont use for now */
  196. /*#define CFG_RTCSC (RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE) */
  197. /*#define CFG_RTCSC (RTCSC_RTF) */
  198. /*-----------------------------------------------------------------------
  199. * PISCR - Periodic Interrupt Status and Control 11-31
  200. *-----------------------------------------------------------------------
  201. * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
  202. */
  203. #define CFG_PISCR (PISCR_PS | PISCR_PITF)
  204. /* PITE */
  205. /*-----------------------------------------------------------------------
  206. * PLPRCR - PLL, Low-Power, and Reset Control Register 15-30
  207. *-----------------------------------------------------------------------
  208. * set the PLL, the low-power modes and the reset control (15-29)
  209. */
  210. #define CFG_PLPRCR (((MPC8XX_FACT-1) << PLPRCR_MF_SHIFT) | \
  211. PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
  212. /*-----------------------------------------------------------------------
  213. * SCCR - System Clock and reset Control Register 15-27
  214. *-----------------------------------------------------------------------
  215. * Set clock output, timebase and RTC source and divider,
  216. * power management and some other internal clocks
  217. */
  218. /* FIXME check values */
  219. #define SCCR_MASK SCCR_EBDF11
  220. #define CFG_SCCR (SCCR_TBS|SCCR_RTSEL|SCCR_COM00|SCCR_DFSYNC00|SCCR_DFBRG00|SCCR_DFNL000|SCCR_DFNH000|SCCR_DFLCD000|SCCR_DFALCD00)
  221. /*-----------------------------------------------------------------------
  222. *
  223. *-----------------------------------------------------------------------
  224. *
  225. */
  226. #define CFG_DER 0
  227. /* Because of the way the 860 starts up and assigns CS0 the
  228. * entire address space, we have to set the memory controller
  229. * differently. Normally, you write the option register
  230. * first, and then enable the chip select by writing the
  231. * base register. For CS0, you must write the base register
  232. * first, followed by the option register.
  233. */
  234. /*
  235. * Init Memory Controller:
  236. *
  237. * BR0/1 and OR0/1 (FLASH)
  238. */
  239. /* the other CS:s are determined by looking at parameters in BCSRx */
  240. #define FLASH_BASE0_PRELIM CFG_FLASH_BASE /* FLASH bank #0 */
  241. #define CFG_REMAP_OR_AM 0xFF800000 /* 4 MB OR addr mask */
  242. #define CFG_PRELIM_OR_AM 0xFF800000 /* OR addr mask */
  243. #define FPGA_2_BASE 0x90000000
  244. #define FPGA_3_BASE 0x98000000
  245. /* FLASH timing: ACS = 10, TRLX = 1, CSNT = 1, SCY = 3, EHTR = 0 */
  246. #define CFG_OR_TIMING_FLASH (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_3_CLK | OR_TRLX)
  247. #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH)
  248. #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH) /* 1 Mbyte until detected and only 1 Mbyte is needed*/
  249. #define CFG_BR0_PRELIM ((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V | BR_PS_16 )
  250. /*
  251. * Internal Definitions
  252. *
  253. * Boot Flags
  254. */
  255. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
  256. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  257. #define CONFIG_ETHADDR DE:AD:BE:EF:00:01 /* Ethernet address */
  258. #ifdef CONFIG_MPC860T
  259. /* Interrupt level assignments.
  260. */
  261. #define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
  262. #endif /* CONFIG_MPC860T */
  263. /* We don't use the 8259.
  264. */
  265. #define NR_8259_INTS 0
  266. /* Machine type
  267. */
  268. #define _MACH_8xx (_MACH_gth)
  269. #ifdef CONFIG_MPC860
  270. #define PCMCIA_SLOT_A 1
  271. #define CONFIG_PCMCIA_SLOT_A 1
  272. #endif
  273. #define CFG_PCMCIA_MEM_ADDR (0xE0000000)
  274. #define CFG_PCMCIA_MEM_SIZE ( 64 << 20 )
  275. #define CFG_PCMCIA_DMA_ADDR (0xE4000000)
  276. #define CFG_PCMCIA_DMA_SIZE ( 64 << 20 )
  277. #define CFG_PCMCIA_ATTRB_ADDR (0xE8000000)
  278. #define CFG_PCMCIA_ATTRB_SIZE ( 64 << 20 )
  279. #define CFG_PCMCIA_IO_ADDR (0xEC000000)
  280. #define CFG_PCMCIA_IO_SIZE ( 64 << 20 )
  281. #define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
  282. #undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
  283. #undef CONFIG_IDE_LED /* LED for ide not supported */
  284. #undef CONFIG_IDE_RESET /* reset for ide not supported */
  285. #define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
  286. #define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
  287. #define CFG_ATA_IDE0_OFFSET 0x0000
  288. #define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
  289. /* Offset for data I/O */
  290. #define CFG_ATA_DATA_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
  291. /* Offset for normal register accesses */
  292. #define CFG_ATA_REG_OFFSET (2 * CFG_PCMCIA_MEM_SIZE + 0x320)
  293. /* Offset for alternate registers */
  294. #define CFG_ATA_ALT_OFFSET 0x0100
  295. #define CONFIG_8xx_GCLK_FREQ MPC8XX_HZ /* Force it - dont measure it */
  296. #define PA_FRONT_LED ((u16)0x4) /* PA 13 */
  297. #define PA_FL_CONFIG ((u16)0x20) /* PA 10 */
  298. #define PA_FL_CE ((u16)0x1000) /* PA 3 */
  299. #define PB_ID_GND ((u32)1) /* PB 31 */
  300. #define PB_REV_1 ((u32)2) /* PB 30 */
  301. #define PB_REV_0 ((u32)4) /* PB 29 */
  302. #define PB_BLUE_LED ((u32)0x400) /* PB 21 */
  303. #define PB_EEPROM ((u32)0x800) /* PB 20 */
  304. #define PB_ID_3 ((u32)0x2000) /* PB 18 */
  305. #define PB_ID_2 ((u32)0x4000) /* PB 17 */
  306. #define PB_ID_1 ((u32)0x8000) /* PB 16 */
  307. #define PB_ID_0 ((u32)0x10000) /* PB 15 */
  308. /* NOTE. This is reset for 100Mbit port only */
  309. #define PC_ENET100_RESET ((ushort)0x0080) /* PC 8 */
  310. #endif /* __CONFIG_H */