mpc83xx.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. /*
  2. * Copyright (C) 2004-2006 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. /*
  23. * mpc83xx.h
  24. *
  25. * MPC83xx specific definitions
  26. */
  27. #ifndef __MPC83XX_H__
  28. #define __MPC83XX_H__
  29. #include <config.h>
  30. #if defined(CONFIG_E300)
  31. #include <asm/e300.h>
  32. #endif
  33. /*
  34. * MPC83xx cpu provide RCR register to do reset thing specially. easier
  35. * to implement
  36. */
  37. #define MPC83xx_RESET
  38. /*
  39. * System reset offset (PowerPC standard)
  40. */
  41. #define EXC_OFF_SYS_RESET 0x0100
  42. /*
  43. * Default Internal Memory Register Space (Freescale recomandation)
  44. */
  45. #define CONFIG_DEFAULT_IMMR 0xFF400000
  46. /*
  47. * Watchdog
  48. */
  49. #define SWCRR 0x0204
  50. #define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
  51. #define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
  52. #define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit. */
  53. #define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
  54. #define SWCRR_RES ~(SWCRR_SWTC | SWCRR_SWEN | SWCRR_SWRI | SWCRR_SWPR)
  55. #define SWCNR 0x0208
  56. #define SWCNR_SWCN 0x0000FFFF Software Watchdog Count Field.
  57. #define SWCNR_RES ~(SWCNR_SWCN)
  58. #define SWSRR 0x020E
  59. /*
  60. * Default Internal Memory Register Space (Freescale recomandation)
  61. */
  62. #define IMMRBAR 0x0000
  63. #define IMMRBAR_BASE_ADDR 0xFFF00000 /* Identifies the 12 most-significant address bits of the base of the 1 MByte internal memory window. */
  64. #define IMMRBAR_RES ~(IMMRBAR_BASE_ADDR)
  65. /*
  66. * Default Internal Memory Register Space (Freescale recomandation)
  67. */
  68. #define LBLAWBAR0 0x0020
  69. #define LBLAWAR0 0x0024
  70. #define LBLAWBAR1 0x0028
  71. #define LBLAWAR1 0x002C
  72. #define LBLAWBAR2 0x0030
  73. #define LBLAWAR2 0x0034
  74. #define LBLAWBAR3 0x0038
  75. #define LBLAWAR3 0x003C
  76. /*
  77. * The device ID and revision numbers
  78. */
  79. #define SPR_8349E_REV10 0x80300100
  80. #define SPR_8349E_REV11 0x80300101
  81. /*
  82. * Base Registers & Option Registers
  83. */
  84. #define BR0 0x5000
  85. #define BR1 0x5008
  86. #define BR2 0x5010
  87. #define BR3 0x5018
  88. #define BR4 0x5020
  89. #define BR5 0x5028
  90. #define BR6 0x5030
  91. #define BR7 0x5038
  92. #define BR_BA 0xFFFF8000
  93. #define BR_BA_SHIFT 15
  94. #define BR_PS 0x00001800
  95. #define BR_PS_SHIFT 11
  96. #define BR_PS_8 0x00000800 /* Port Size 8 bit */
  97. #define BR_PS_16 0x00001000 /* Port Size 16 bit */
  98. #define BR_PS_32 0x00001800 /* Port Size 32 bit */
  99. #define BR_DECC 0x00000600
  100. #define BR_DECC_SHIFT 9
  101. #define BR_WP 0x00000100
  102. #define BR_WP_SHIFT 8
  103. #define BR_MSEL 0x000000E0
  104. #define BR_MSEL_SHIFT 5
  105. #define BR_MS_GPCM 0x00000000 /* GPCM */
  106. #define BR_MS_SDRAM 0x00000060 /* SDRAM */
  107. #define BR_MS_UPMA 0x00000080 /* UPMA */
  108. #define BR_MS_UPMB 0x000000A0 /* UPMB */
  109. #define BR_MS_UPMC 0x000000C0 /* UPMC */
  110. #define BR_V 0x00000001
  111. #define BR_V_SHIFT 0
  112. #define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
  113. #define OR0 0x5004
  114. #define OR1 0x500C
  115. #define OR2 0x5014
  116. #define OR3 0x501C
  117. #define OR4 0x5024
  118. #define OR5 0x502C
  119. #define OR6 0x5034
  120. #define OR7 0x503C
  121. #define OR_GPCM_AM 0xFFFF8000
  122. #define OR_GPCM_AM_SHIFT 15
  123. #define OR_GPCM_BCTLD 0x00001000
  124. #define OR_GPCM_BCTLD_SHIFT 12
  125. #define OR_GPCM_CSNT 0x00000800
  126. #define OR_GPCM_CSNT_SHIFT 11
  127. #define OR_GPCM_ACS 0x00000600
  128. #define OR_GPCM_ACS_SHIFT 9
  129. #define OR_GPCM_ACS_0b10 0x00000400
  130. #define OR_GPCM_ACS_0b11 0x00000600
  131. #define OR_GPCM_XACS 0x00000100
  132. #define OR_GPCM_XACS_SHIFT 8
  133. #define OR_GPCM_SCY 0x000000F0
  134. #define OR_GPCM_SCY_SHIFT 4
  135. #define OR_GPCM_SCY_1 0x00000010
  136. #define OR_GPCM_SCY_2 0x00000020
  137. #define OR_GPCM_SCY_3 0x00000030
  138. #define OR_GPCM_SCY_4 0x00000040
  139. #define OR_GPCM_SCY_5 0x00000050
  140. #define OR_GPCM_SCY_6 0x00000060
  141. #define OR_GPCM_SCY_7 0x00000070
  142. #define OR_GPCM_SCY_8 0x00000080
  143. #define OR_GPCM_SCY_9 0x00000090
  144. #define OR_GPCM_SCY_10 0x000000a0
  145. #define OR_GPCM_SCY_11 0x000000b0
  146. #define OR_GPCM_SCY_12 0x000000c0
  147. #define OR_GPCM_SCY_13 0x000000d0
  148. #define OR_GPCM_SCY_14 0x000000e0
  149. #define OR_GPCM_SCY_15 0x000000f0
  150. #define OR_GPCM_SETA 0x00000008
  151. #define OR_GPCM_SETA_SHIFT 3
  152. #define OR_GPCM_TRLX 0x00000004
  153. #define OR_GPCM_TRLX_SHIFT 2
  154. #define OR_GPCM_EHTR 0x00000002
  155. #define OR_GPCM_EHTR_SHIFT 1
  156. #define OR_GPCM_EAD 0x00000001
  157. #define OR_GPCM_EAD_SHIFT 0
  158. #define OR_UPM_AM 0xFFFF8000
  159. #define OR_UPM_AM_SHIFT 15
  160. #define OR_UPM_XAM 0x00006000
  161. #define OR_UPM_XAM_SHIFT 13
  162. #define OR_UPM_BCTLD 0x00001000
  163. #define OR_UPM_BCTLD_SHIFT 12
  164. #define OR_UPM_BI 0x00000100
  165. #define OR_UPM_BI_SHIFT 8
  166. #define OR_UPM_TRLX 0x00000004
  167. #define OR_UPM_TRLX_SHIFT 2
  168. #define OR_UPM_EHTR 0x00000002
  169. #define OR_UPM_EHTR_SHIFT 1
  170. #define OR_UPM_EAD 0x00000001
  171. #define OR_UPM_EAD_SHIFT 0
  172. #define OR_SDRAM_AM 0xFFFF8000
  173. #define OR_SDRAM_AM_SHIFT 15
  174. #define OR_SDRAM_XAM 0x00006000
  175. #define OR_SDRAM_XAM_SHIFT 13
  176. #define OR_SDRAM_COLS 0x00001C00
  177. #define OR_SDRAM_COLS_SHIFT 10
  178. #define OR_SDRAM_ROWS 0x000001C0
  179. #define OR_SDRAM_ROWS_SHIFT 6
  180. #define OR_SDRAM_PMSEL 0x00000020
  181. #define OR_SDRAM_PMSEL_SHIFT 5
  182. #define OR_SDRAM_EAD 0x00000001
  183. #define OR_SDRAM_EAD_SHIFT 0
  184. /*
  185. * Hard Reset Configration Word - High
  186. */
  187. #define HRCWH_PCI_AGENT 0x00000000
  188. #define HRCWH_PCI_HOST 0x80000000
  189. #define HRCWH_32_BIT_PCI 0x00000000
  190. #define HRCWH_64_BIT_PCI 0x40000000
  191. #define HRCWH_PCI1_ARBITER_DISABLE 0x00000000
  192. #define HRCWH_PCI1_ARBITER_ENABLE 0x20000000
  193. #define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
  194. #define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
  195. #define HRCWH_CORE_DISABLE 0x08000000
  196. #define HRCWH_CORE_ENABLE 0x00000000
  197. #define HRCWH_FROM_0X00000100 0x00000000
  198. #define HRCWH_FROM_0XFFF00100 0x04000000
  199. #define HRCWH_BOOTSEQ_DISABLE 0x00000000
  200. #define HRCWH_BOOTSEQ_NORMAL 0x01000000
  201. #define HRCWH_BOOTSEQ_EXTENDED 0x02000000
  202. #define HRCWH_SW_WATCHDOG_DISABLE 0x00000000
  203. #define HRCWH_SW_WATCHDOG_ENABLE 0x00800000
  204. #define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000
  205. #define HRCWH_ROM_LOC_PCI1 0x00100000
  206. #define HRCWH_ROM_LOC_PCI2 0x00200000
  207. #define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000
  208. #define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
  209. #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
  210. #define HRCWH_TSEC1M_IN_RGMII 0x00000000
  211. #define HRCWH_TSEC1M_IN_RTBI 0x00004000
  212. #define HRCWH_TSEC1M_IN_GMII 0x00008000
  213. #define HRCWH_TSEC1M_IN_TBI 0x0000C000
  214. #define HRCWH_TSEC2M_IN_RGMII 0x00000000
  215. #define HRCWH_TSEC2M_IN_RTBI 0x00001000
  216. #define HRCWH_TSEC2M_IN_GMII 0x00002000
  217. #define HRCWH_TSEC2M_IN_TBI 0x00003000
  218. #define HRCWH_BIG_ENDIAN 0x00000000
  219. #define HRCWH_LITTLE_ENDIAN 0x00000008
  220. #define HRCWH_LALE_NORMAL 0x00000000
  221. #define HRCWH_LALE_EARLY 0x00000004
  222. #define HRCWH_LDP_SET 0x00000000
  223. #define HRCWH_LDP_CLEAR 0x00000002
  224. /*
  225. * Hard Reset Configration Word - Low
  226. */
  227. #define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
  228. #define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
  229. #define HRCWL_DDR_TO_SCB_CLK_1X1 0x00000000
  230. #define HRCWL_DDR_TO_SCB_CLK_2X1 0x40000000
  231. #define HRCWL_CSB_TO_CLKIN_16X1 0x00000000
  232. #define HRCWL_CSB_TO_CLKIN_1X1 0x01000000
  233. #define HRCWL_CSB_TO_CLKIN_2X1 0x02000000
  234. #define HRCWL_CSB_TO_CLKIN_3X1 0x03000000
  235. #define HRCWL_CSB_TO_CLKIN_4X1 0x04000000
  236. #define HRCWL_CSB_TO_CLKIN_5X1 0x05000000
  237. #define HRCWL_CSB_TO_CLKIN_6X1 0x06000000
  238. #define HRCWL_CSB_TO_CLKIN_7X1 0x07000000
  239. #define HRCWL_CSB_TO_CLKIN_8X1 0x08000000
  240. #define HRCWL_CSB_TO_CLKIN_9X1 0x09000000
  241. #define HRCWL_CSB_TO_CLKIN_10X1 0x0A000000
  242. #define HRCWL_CSB_TO_CLKIN_11X1 0x0B000000
  243. #define HRCWL_CSB_TO_CLKIN_12X1 0x0C000000
  244. #define HRCWL_CSB_TO_CLKIN_13X1 0x0D000000
  245. #define HRCWL_CSB_TO_CLKIN_14X1 0x0E000000
  246. #define HRCWL_CSB_TO_CLKIN_15X1 0x0F000000
  247. #define HRCWL_VCO_BYPASS 0x00000000
  248. #define HRCWL_VCO_1X2 0x00000000
  249. #define HRCWL_VCO_1X4 0x00200000
  250. #define HRCWL_VCO_1X8 0x00400000
  251. #define HRCWL_CORE_TO_CSB_BYPASS 0x00000000
  252. #define HRCWL_CORE_TO_CSB_1X1 0x00020000
  253. #define HRCWL_CORE_TO_CSB_1_5X1 0x00030000
  254. #define HRCWL_CORE_TO_CSB_2X1 0x00040000
  255. #define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
  256. #define HRCWL_CORE_TO_CSB_3X1 0x00060000
  257. /*
  258. * LCRR - Clock Ratio Register (10.3.1.16)
  259. */
  260. #define LCRR_DBYP 0x80000000
  261. #define LCRR_DBYP_SHIFT 31
  262. #define LCRR_BUFCMDC 0x30000000
  263. #define LCRR_BUFCMDC_1 0x10000000
  264. #define LCRR_BUFCMDC_2 0x20000000
  265. #define LCRR_BUFCMDC_3 0x30000000
  266. #define LCRR_BUFCMDC_4 0x00000000
  267. #define LCRR_BUFCMDC_SHIFT 28
  268. #define LCRR_ECL 0x03000000
  269. #define LCRR_ECL_4 0x00000000
  270. #define LCRR_ECL_5 0x01000000
  271. #define LCRR_ECL_6 0x02000000
  272. #define LCRR_ECL_7 0x03000000
  273. #define LCRR_ECL_SHIFT 24
  274. #define LCRR_EADC 0x00030000
  275. #define LCRR_EADC_1 0x00010000
  276. #define LCRR_EADC_2 0x00020000
  277. #define LCRR_EADC_3 0x00030000
  278. #define LCRR_EADC_4 0x00000000
  279. #define LCRR_EADC_SHIFT 16
  280. #define LCRR_CLKDIV 0x0000000F
  281. #define LCRR_CLKDIV_2 0x00000002
  282. #define LCRR_CLKDIV_4 0x00000004
  283. #define LCRR_CLKDIV_8 0x00000008
  284. #define LCRR_CLKDIV_SHIFT 0
  285. /*
  286. * SCCR-System Clock Control Register
  287. */
  288. #define SCCR_TSEC1CM_0 0x00000000
  289. #define SCCR_TSEC1CM_1 0x40000000
  290. #define SCCR_TSEC1CM_2 0x80000000
  291. #define SCCR_TSEC1CM_3 0xC0000000
  292. #define SCCR_TSEC2CM_0 0x00000000
  293. #define SCCR_TSEC2CM_1 0x10000000
  294. #define SCCR_TSEC2CM_2 0x20000000
  295. #define SCCR_TSEC2CM_3 0x30000000
  296. #define SCCR_ENCCM_0 0x00000000
  297. #define SCCR_ENCCM_1 0x01000000
  298. #define SCCR_ENCCM_2 0x02000000
  299. #define SCCR_ENCCM_3 0x03000000
  300. #define SCCR_USBCM_0 0x00000000
  301. #define SCCR_USBCM_1 0x00500000
  302. #define SCCR_USBCM_2 0x00A00000
  303. #define SCCR_USBCM_3 0x00F00000
  304. #define SCCR_CLK_MASK ( SCCR_TSEC1CM_3 \
  305. | SCCR_TSEC2CM_3 \
  306. | SCCR_ENCCM_3 \
  307. | SCCR_USBCM_3 )
  308. #define SCCR_DEFAULT 0xFFFFFFFF
  309. #endif /* __MPC83XX_H__ */