ISPAN.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. /*
  2. * Copyright (C) 2004 Arabella Software Ltd.
  3. * Yuli Barcohen <yuli@arabellasw.com>
  4. *
  5. * Support for Interphase iSPAN Communications Controllers
  6. * (453x and others). Tested on 4532.
  7. *
  8. * Derived from iSPAN 4539 port (iphase4539) by
  9. * Wolfgang Grandegger <wg@denx.de>
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #ifndef __CONFIG_H
  30. #define __CONFIG_H
  31. #define CONFIG_MPC8260 /* This is an MPC8260 CPU */
  32. #define CONFIG_ISPAN /* ...on one of Interphase iSPAN boards */
  33. /*-----------------------------------------------------------------------
  34. * Select serial console configuration
  35. *
  36. * If either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
  37. * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
  38. * for SCC).
  39. *
  40. * If CONFIG_CONS_NONE is defined, then the serial console routines must be
  41. * defined elsewhere (for example, on the cogent platform, there are serial
  42. * ports on the motherboard which are used for the serial console - see
  43. * cogent/cma101/serial.[ch]).
  44. */
  45. #define CONFIG_CONS_ON_SMC /* Define if console on SMC */
  46. #undef CONFIG_CONS_ON_SCC /* Define if console on SCC */
  47. #undef CONFIG_CONS_NONE /* Define if console on something else */
  48. #define CONFIG_CONS_INDEX 1 /* Which serial channel for console */
  49. /*-----------------------------------------------------------------------
  50. * Select Ethernet configuration
  51. *
  52. * If either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
  53. * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
  54. * for FCC).
  55. *
  56. * If CONFIG_ETHER_NONE is defined, then either the Ethernet routines must
  57. * be defined elsewhere (as for the console), or CFG_CMD_NET must be removed
  58. * from CONFIG_COMMANDS to remove support for networking.
  59. */
  60. #undef CONFIG_ETHER_ON_SCC /* Define if Ethernet on SCC */
  61. #define CONFIG_ETHER_ON_FCC /* Define if Ethernet on FCC */
  62. #undef CONFIG_ETHER_NONE /* Define if Ethernet on something else */
  63. #define CONFIG_ETHER_INDEX 3 /* Which channel for Ethernrt */
  64. #ifdef CONFIG_ETHER_ON_FCC
  65. #if CONFIG_ETHER_INDEX == 3
  66. #define CFG_PHY_ADDR 0
  67. #define CFG_CMXFCR_VALUE (CMXFCR_RF3CS_CLK14 | CMXFCR_TF3CS_CLK16)
  68. #define CFG_CMXFCR_MASK (CMXFCR_FC3 | CMXFCR_RF3CS_MSK | CMXFCR_TF3CS_MSK)
  69. #endif /* CONFIG_ETHER_INDEX == 3 */
  70. #define CFG_CPMFCR_RAMTYPE 0
  71. #define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
  72. #define CONFIG_MII /* MII PHY management */
  73. #define CONFIG_BITBANGMII /* Bit-bang MII PHY management */
  74. /*
  75. * GPIO pins used for bit-banged MII communications
  76. */
  77. #define MDIO_PORT 3 /* Port D */
  78. #define CFG_MDIO_PIN 0x00040000 /* PD13 */
  79. #define CFG_MDC_PIN 0x00080000 /* PD12 */
  80. #define MDIO_ACTIVE (iop->pdir |= CFG_MDIO_PIN)
  81. #define MDIO_TRISTATE (iop->pdir &= ~CFG_MDIO_PIN)
  82. #define MDIO_READ ((iop->pdat & CFG_MDIO_PIN) != 0)
  83. #define MDIO(bit) if(bit) iop->pdat |= CFG_MDIO_PIN; \
  84. else iop->pdat &= ~CFG_MDIO_PIN
  85. #define MDC(bit) if(bit) iop->pdat |= CFG_MDC_PIN; \
  86. else iop->pdat &= ~CFG_MDC_PIN
  87. #define MIIDELAY udelay(1)
  88. #endif /* CONFIG_ETHER_ON_FCC */
  89. #define CONFIG_8260_CLKIN 65536000 /* in Hz */
  90. #define CONFIG_BAUDRATE 38400
  91. #define CONFIG_COMMANDS ( CONFIG_CMD_DFL \
  92. | CFG_CMD_ASKENV \
  93. | CFG_CMD_DHCP \
  94. | CFG_CMD_ECHO \
  95. | CFG_CMD_IMMAP \
  96. | CFG_CMD_MII \
  97. | CFG_CMD_PING \
  98. | CFG_CMD_REGINFO \
  99. )
  100. /* This must be included AFTER the definition of CONFIG_COMMANDS */
  101. #include <cmd_confdefs.h>
  102. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  103. #define CONFIG_BOOTCOMMAND "bootm fe010000" /* autoboot command */
  104. #define CONFIG_BOOTARGS "root=/dev/ram rw"
  105. #define CONFIG_BZIP2 /* Include support for bzip2 compressed images */
  106. #undef CONFIG_WATCHDOG /* Disable platform specific watchdog */
  107. /*-----------------------------------------------------------------------
  108. * Miscellaneous configurable options
  109. */
  110. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  111. #define CFG_HUSH_PARSER
  112. #define CFG_PROMPT_HUSH_PS2 "> "
  113. #define CFG_LONGHELP /* #undef to save memory */
  114. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  115. #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16) /* Print Buffer Size */
  116. #define CFG_MAXARGS 16 /* Max number of command args */
  117. #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
  118. #define CFG_MEMTEST_START 0x00100000 /* memtest works on */
  119. #define CFG_MEMTEST_END 0x03B00000 /* 1 ... 59 MB in SDRAM */
  120. #define CFG_LOAD_ADDR 0x100000 /* Default load address */
  121. #define CFG_HZ 1000 /* Decrementer freq: 1 ms ticks */
  122. #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  123. #define CFG_RESET_ADDRESS 0x09900000
  124. #define CONFIG_MISC_INIT_R /* We need misc_init_r() */
  125. /*-----------------------------------------------------------------------
  126. * For booting Linux, the board info and command line data
  127. * have to be in the first 8 MB of memory, since this is
  128. * the maximum mapped by the Linux kernel during initialization.
  129. */
  130. #define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
  131. #define CFG_MONITOR_BASE TEXT_BASE
  132. #define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */
  133. #ifdef CONFIG_BZIP2
  134. #define CFG_MALLOC_LEN (4096 << 10) /* Reserve 4 MB for malloc() */
  135. #else
  136. #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 KB for malloc() */
  137. #endif /* CONFIG_BZIP2 */
  138. /*-----------------------------------------------------------------------
  139. * FLASH organization
  140. */
  141. #define CFG_FLASH_BASE 0xFE000000
  142. #define CFG_FLASH_CFI /* The flash is CFI compatible */
  143. #define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */
  144. #define CFG_MAX_FLASH_BANKS 1 /* Max num of memory banks */
  145. #define CFG_MAX_FLASH_SECT 142 /* Max num of sects on one chip */
  146. /* Environment is in flash, there is little space left in Serial EEPROM */
  147. #define CFG_ENV_IS_IN_FLASH
  148. #define CFG_ENV_SECT_SIZE 0x10000 /* We use one complete sector */
  149. #define CFG_ENV_ADDR (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
  150. #define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR + CFG_ENV_SECT_SIZE)
  151. /*-----------------------------------------------------------------------
  152. * Hard Reset Configuration Words
  153. *
  154. * If you change bits in the HRCW, you must also change the CFG_*
  155. * defines for the various registers affected by the HRCW e.g. changing
  156. * HRCW_DPPCxx requires you to also change CFG_SIUMCR.
  157. */
  158. /* 0x1686B245 */
  159. #define CFG_HRCW_MASTER (HRCW_EBM | HRCW_BPS01 | HRCW_CIP |\
  160. HRCW_L2CPC10 | HRCW_ISB110 |\
  161. HRCW_BMS | HRCW_MMR11 | HRCW_APPC10 |\
  162. HRCW_CS10PC01 | HRCW_MODCK_H0101 \
  163. )
  164. /* No slaves */
  165. #define CFG_HRCW_SLAVE1 0
  166. #define CFG_HRCW_SLAVE2 0
  167. #define CFG_HRCW_SLAVE3 0
  168. #define CFG_HRCW_SLAVE4 0
  169. #define CFG_HRCW_SLAVE5 0
  170. #define CFG_HRCW_SLAVE6 0
  171. #define CFG_HRCW_SLAVE7 0
  172. /*-----------------------------------------------------------------------
  173. * Internal Memory Mapped Register
  174. */
  175. #define CFG_IMMR 0xF0F00000
  176. #ifdef CFG_REV_B
  177. #define CFG_DEFAULT_IMMR 0xFF000000
  178. #endif /* CFG_REV_B */
  179. /*-----------------------------------------------------------------------
  180. * Definitions for initial stack pointer and data area (in DPRAM)
  181. */
  182. #define CFG_INIT_RAM_ADDR CFG_IMMR
  183. #define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
  184. #define CFG_GBL_DATA_SIZE 128 /* Size in bytes reserved for initial data */
  185. #define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
  186. #define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
  187. /*-----------------------------------------------------------------------
  188. * Internal Definitions
  189. *
  190. * Boot Flags
  191. */
  192. #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from flash */
  193. #define BOOTFLAG_WARM 0x02 /* Software reboot */
  194. /*-----------------------------------------------------------------------
  195. * Cache Configuration
  196. */
  197. #define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
  198. /*-----------------------------------------------------------------------
  199. * HIDx - Hardware Implementation-dependent Registers 2-11
  200. *-----------------------------------------------------------------------
  201. * HID0 also contains cache control.
  202. *
  203. * HID1 has only read-only information - nothing to set.
  204. */
  205. #define CFG_HID0_INIT (HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI|\
  206. HID0_IFEM|HID0_ABE)
  207. #define CFG_HID0_FINAL (HID0_ICE|HID0_IFEM|HID0_ABE)
  208. #define CFG_HID2 0
  209. /*-----------------------------------------------------------------------
  210. * RMR - Reset Mode Register 5-5
  211. *-----------------------------------------------------------------------
  212. * turn on Checkstop Reset Enable
  213. */
  214. #define CFG_RMR RMR_CSRE
  215. /*-----------------------------------------------------------------------
  216. * BCR - Bus Configuration 4-25
  217. *-----------------------------------------------------------------------
  218. */
  219. #define CFG_BCR 0xA01C0000
  220. /*-----------------------------------------------------------------------
  221. * SIUMCR - SIU Module Configuration 4-31
  222. *-----------------------------------------------------------------------
  223. */
  224. #define CFG_SIUMCR 0x42250000/* 0x4205C000 */
  225. /*-----------------------------------------------------------------------
  226. * SYPCR - System Protection Control 4-35
  227. * SYPCR can only be written once after reset!
  228. *-----------------------------------------------------------------------
  229. * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
  230. */
  231. #if defined (CONFIG_WATCHDOG)
  232. #define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\
  233. SYPCR_SWRI|SYPCR_SWP|SYPCR_SWE)
  234. #else
  235. #define CFG_SYPCR (SYPCR_SWTC|SYPCR_BMT|SYPCR_PBME|SYPCR_LBME|\
  236. SYPCR_SWRI|SYPCR_SWP)
  237. #endif /* CONFIG_WATCHDOG */
  238. /*-----------------------------------------------------------------------
  239. * TMCNTSC - Time Counter Status and Control 4-40
  240. * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
  241. * and enable Time Counter
  242. *-----------------------------------------------------------------------
  243. */
  244. #define CFG_TMCNTSC (TMCNTSC_SEC|TMCNTSC_ALR|TMCNTSC_TCF|TMCNTSC_TCE)
  245. /*-----------------------------------------------------------------------
  246. * PISCR - Periodic Interrupt Status and Control 4-42
  247. *-----------------------------------------------------------------------
  248. * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
  249. * Periodic timer
  250. */
  251. #define CFG_PISCR (PISCR_PS|PISCR_PTF|PISCR_PTE)
  252. /*-----------------------------------------------------------------------
  253. * SCCR - System Clock Control 9-8
  254. *-----------------------------------------------------------------------
  255. * Ensure DFBRG is Divide by 16
  256. */
  257. #define CFG_SCCR SCCR_DFBRG01
  258. /*-----------------------------------------------------------------------
  259. * RCCR - RISC Controller Configuration 13-7
  260. *-----------------------------------------------------------------------
  261. */
  262. #define CFG_RCCR 0
  263. /*-----------------------------------------------------------------------
  264. * Init Memory Controller:
  265. *
  266. * Bank Bus Machine PortSize Device
  267. * ---- --- ------- ----------------------------- ------
  268. * 0 60x GPCM 8 bit (Rev.B)/16 bit (Rev.D) Flash
  269. * 1 60x SDRAM 64 bit SDRAM
  270. * 2 Local SDRAM 32 bit SDRAM
  271. */
  272. #define CFG_USE_FIRMWARE /* If defined - do not initialise memory
  273. controller, rely on initialisation
  274. performed by the Interphase boot firmware.
  275. */
  276. #define CFG_OR0_PRELIM 0xFE000882
  277. #ifdef CFG_REV_B
  278. #define CFG_BR0_PRELIM (CFG_FLASH_BASE | BRx_PS_8 | BRx_V)
  279. #else /* Rev. D */
  280. #define CFG_BR0_PRELIM (CFG_FLASH_BASE | BRx_PS_16 | BRx_V)
  281. #endif /* CFG_REV_B */
  282. #define CFG_MPTPR 0x7F00
  283. /* Please note that 60x SDRAM MUST start at 0 */
  284. #define CFG_SDRAM_BASE 0x00000000
  285. #define CFG_60x_BR 0x00000041
  286. #define CFG_60x_OR 0xF0002CD0
  287. #define CFG_PSDMR 0x0049929A
  288. #define CFG_PSRT 0x07
  289. #define CFG_LSDRAM_BASE 0xF7000000
  290. #define CFG_LOC_BR 0x00001861
  291. #define CFG_LOC_OR 0xFF803280
  292. #define CFG_LSDMR 0x8285A552
  293. #define CFG_LSRT 0x07
  294. #endif /* __CONFIG_H */