mpc83xx.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /*
  2. * Copyright 2004 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. #if defined(CONFIG_E300)
  30. #include <asm/e300.h>
  31. #endif
  32. /*
  33. * MPC83xx cpu provide RCR register to do reset thing specially. easier
  34. * to implement
  35. */
  36. #define MPC83xx_RESET
  37. /*
  38. * System reset offset (PowerPC standard)
  39. */
  40. #define EXC_OFF_SYS_RESET 0x0100
  41. /*
  42. * Default Internal Memory Register Space (Freescale recomandation)
  43. */
  44. #define CONFIG_DEFAULT_IMMR 0xFF400000
  45. /*
  46. * Watchdog
  47. */
  48. #define SWCRR 0x0204
  49. #define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
  50. #define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
  51. #define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit. */
  52. #define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
  53. #define SWCRR_RES ~(SWCRR_SWTC | SWCRR_SWEN | SWCRR_SWRI | SWCRR_SWPR)
  54. #define SWCNR 0x0208
  55. #define SWCNR_SWCN 0x0000FFFF Software Watchdog Count Field.
  56. #define SWCNR_RES ~(SWCNR_SWCN)
  57. #define SWSRR 0x020E
  58. /*
  59. * Default Internal Memory Register Space (Freescale recomandation)
  60. */
  61. #define IMMRBAR 0x0000
  62. #define IMMRBAR_BASE_ADDR 0xFFF00000 /* Identifies the 12 most-significant address bits of the base of the 1 MByte internal memory window. */
  63. #define IMMRBAR_RES ~(IMMRBAR_BASE_ADDR)
  64. /*
  65. * Default Internal Memory Register Space (Freescale recomandation)
  66. */
  67. #define LBLAWBAR0 0x0020
  68. #define LBLAWAR0 0x0024
  69. #define LBLAWBAR1 0x0028
  70. #define LBLAWAR1 0x002C
  71. #define LBLAWBAR2 0x0030
  72. #define LBLAWAR2 0x0034
  73. #define LBLAWBAR3 0x0038
  74. #define LBLAWAR3 0x003C
  75. /*
  76. * Base Registers & Option Registers
  77. */
  78. #define BR0 0x5000
  79. #define BR1 0x5008
  80. #define BR2 0x5010
  81. #define BR3 0x5018
  82. #define BR4 0x5020
  83. #define BR5 0x5028
  84. #define BR6 0x5030
  85. #define BR7 0x5038
  86. #define BR_BA 0xFFFF8000
  87. #define BR_BA_SHIFT 15
  88. #define BR_PS 0x00001800
  89. #define BR_PS_SHIFT 11
  90. #define BR_DECC 0x00000600
  91. #define BR_DECC_SHIFT 9
  92. #define BR_WP 0x00000100
  93. #define BR_WP_SHIFT 8
  94. #define BR_MSEL 0x000000E0
  95. #define BR_MSEL_SHIFT 5
  96. #define BR_V 0x00000001
  97. #define BR_V_SHIFT 0
  98. #define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
  99. #define OR0 0x5004
  100. #define OR1 0x500C
  101. #define OR2 0x5014
  102. #define OR3 0x501C
  103. #define OR4 0x5024
  104. #define OR5 0x502C
  105. #define OR6 0x5034
  106. #define OR7 0x503C
  107. #define OR_GPCM_AM 0xFFFF8000
  108. #define OR_GPCM_AM_SHIFT 15
  109. #define OR_GPCM_BCTLD 0x00001000
  110. #define OR_GPCM_BCTLD_SHIFT 12
  111. #define OR_GPCM_CSNT 0x00000800
  112. #define OR_GPCM_CSNT_SHIFT 11
  113. #define OR_GPCM_ACS 0x00000600
  114. #define OR_GPCM_ACS_SHIFT 9
  115. #define OR_GPCM_XACS 0x00000100
  116. #define OR_GPCM_XACS_SHIFT 8
  117. #define OR_GPCM_SCY 0x000000F0
  118. #define OR_GPCM_SCY_SHIFT 4
  119. #define OR_GPCM_SETA 0x00000008
  120. #define OR_GPCM_SETA_SHIFT 3
  121. #define OR_GPCM_TRLX 0x00000004
  122. #define OR_GPCM_TRLX_SHIFT 2
  123. #define OR_GPCM_EHTR 0x00000002
  124. #define OR_GPCM_EHTR_SHIFT 1
  125. #define OR_GPCM_EAD 0x00000001
  126. #define OR_GPCM_EAD_SHIFT 0
  127. #define OR_UPM_AM 0xFFFF8000
  128. #define OR_UPM_AM_SHIFT 15
  129. #define OR_UPM_XAM 0x00006000
  130. #define OR_UPM_XAM_SHIFT 13
  131. #define OR_UPM_BCTLD 0x00001000
  132. #define OR_UPM_BCTLD_SHIFT 12
  133. #define OR_UPM_BI 0x00000100
  134. #define OR_UPM_BI_SHIFT 8
  135. #define OR_UPM_TRLX 0x00000004
  136. #define OR_UPM_TRLX_SHIFT 2
  137. #define OR_UPM_EHTR 0x00000002
  138. #define OR_UPM_EHTR_SHIFT 1
  139. #define OR_UPM_EAD 0x00000001
  140. #define OR_UPM_EAD_SHIFT 0
  141. #define OR_SDRAM_AM 0xFFFF8000
  142. #define OR_SDRAM_AM_SHIFT 15
  143. #define OR_SDRAM_XAM 0x00006000
  144. #define OR_SDRAM_XAM_SHIFT 13
  145. #define OR_SDRAM_COLS 0x00001C00
  146. #define OR_SDRAM_COLS_SHIFT 10
  147. #define OR_SDRAM_ROWS 0x000001C0
  148. #define OR_SDRAM_ROWS_SHIFT 6
  149. #define OR_SDRAM_PMSEL 0x00000020
  150. #define OR_SDRAM_PMSEL_SHIFT 5
  151. #define OR_SDRAM_EAD 0x00000001
  152. #define OR_SDRAM_EAD_SHIFT 0
  153. /*
  154. * Hard Reset Configration Word - High
  155. */
  156. #define HRCWH_PCI_AGENT 0x00000000
  157. #define HRCWH_PCI_HOST 0x80000000
  158. #define HRCWH_32_BIT_PCI 0x00000000
  159. #define HRCWH_64_BIT_PCI 0x40000000
  160. #define HRCWH_PCI1_ARBITER_DISABLE 0x00000000
  161. #define HRCWH_PCI1_ARBITER_ENABLE 0x20000000
  162. #define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
  163. #define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
  164. #define HRCWH_CORE_DISABLE 0x08000000
  165. #define HRCWH_CORE_ENABLE 0x00000000
  166. #define HRCWH_FROM_0X00000100 0x00000000
  167. #define HRCWH_FROM_0XFFF00100 0x04000000
  168. #define HRCWH_BOOTSEQ_DISABLE 0x00000000
  169. #define HRCWH_BOOTSEQ_NORMAL 0x01000000
  170. #define HRCWH_BOOTSEQ_EXTENDED 0x02000000
  171. #define HRCWH_SW_WATCHDOG_DISABLE 0x00000000
  172. #define HRCWH_SW_WATCHDOG_ENABLE 0x00800000
  173. #define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000
  174. #define HRCWH_ROM_LOC_PCI1 0x00100000
  175. #define HRCWH_ROM_LOC_PCI2 0x00200000
  176. #define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000
  177. #define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
  178. #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
  179. #define HRCWH_TSEC1M_IN_RGMII 0x00000000
  180. #define HRCWH_TSEC1M_IN_RTBI 0x00004000
  181. #define HRCWH_TSEC1M_IN_GMII 0x00008000
  182. #define HRCWH_TSEC1M_IN_TBI 0x0000C000
  183. #define HRCWH_TSEC2M_IN_RGMII 0x00000000
  184. #define HRCWH_TSEC2M_IN_RTBI 0x00001000
  185. #define HRCWH_TSEC2M_IN_GMII 0x00002000
  186. #define HRCWH_TSEC2M_IN_TBI 0x00003000
  187. #define HRCWH_BIG_ENDIAN 0x00000000
  188. #define HRCWH_LITTLE_ENDIAN 0x00000008
  189. /*
  190. * Hard Reset Configration Word - Low
  191. */
  192. #define HRCWL_LCL_BUS_TO_SCB_CLK_1X1 0x00000000
  193. #define HRCWL_LCL_BUS_TO_SCB_CLK_2X1 0x80000000
  194. #define HRCWL_DDR_TO_SCB_CLK_1X1 0x00000000
  195. #define HRCWL_DDR_TO_SCB_CLK_2X1 0x40000000
  196. #define HRCWL_CSB_TO_CLKIN_16X1 0x00000000
  197. #define HRCWL_CSB_TO_CLKIN_1X1 0x01000000
  198. #define HRCWL_CSB_TO_CLKIN_2X1 0x02000000
  199. #define HRCWL_CSB_TO_CLKIN_3X1 0x03000000
  200. #define HRCWL_CSB_TO_CLKIN_4X1 0x04000000
  201. #define HRCWL_CSB_TO_CLKIN_5X1 0x05000000
  202. #define HRCWL_CSB_TO_CLKIN_6X1 0x06000000
  203. #define HRCWL_CSB_TO_CLKIN_7X1 0x07000000
  204. #define HRCWL_CSB_TO_CLKIN_8X1 0x08000000
  205. #define HRCWL_CSB_TO_CLKIN_9X1 0x09000000
  206. #define HRCWL_CSB_TO_CLKIN_10X1 0x0A000000
  207. #define HRCWL_CSB_TO_CLKIN_11X1 0x0B000000
  208. #define HRCWL_CSB_TO_CLKIN_12X1 0x0C000000
  209. #define HRCWL_CSB_TO_CLKIN_13X1 0x0D000000
  210. #define HRCWL_CSB_TO_CLKIN_14X1 0x0E000000
  211. #define HRCWL_CSB_TO_CLKIN_15X1 0x0F000000
  212. #define HRCWL_VCO_BYPASS 0x00000000
  213. #define HRCWL_VCO_1X2 0x00000000
  214. #define HRCWL_VCO_1X4 0x00200000
  215. #define HRCWL_VCO_1X8 0x00400000
  216. #define HRCWL_CORE_TO_CSB_BYPASS 0x00000000
  217. #define HRCWL_CORE_TO_CSB_1X1 0x00020000
  218. #define HRCWL_CORE_TO_CSB_1_5X1 0x00030000
  219. #define HRCWL_CORE_TO_CSB_2X1 0x00040000
  220. #define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
  221. #define HRCWL_CORE_TO_CSB_3X1 0x00060000
  222. /*
  223. * LCRR - Clock Ratio Register (10.3.1.16)
  224. */
  225. #define LCRR_DBYP 0x80000000
  226. #define LCRR_DBYP_SHIFT 31
  227. #define LCRR_BUFCMDC 0x30000000
  228. #define LCRR_BUFCMDC_1 0x10000000
  229. #define LCRR_BUFCMDC_2 0x20000000
  230. #define LCRR_BUFCMDC_3 0x30000000
  231. #define LCRR_BUFCMDC_4 0x00000000
  232. #define LCRR_BUFCMDC_SHIFT 28
  233. #define LCRR_ECL 0x03000000
  234. #define LCRR_ECL_4 0x00000000
  235. #define LCRR_ECL_5 0x01000000
  236. #define LCRR_ECL_6 0x02000000
  237. #define LCRR_ECL_7 0x03000000
  238. #define LCRR_ECL_SHIFT 24
  239. #define LCRR_EADC 0x00030000
  240. #define LCRR_EADC_1 0x00010000
  241. #define LCRR_EADC_2 0x00020000
  242. #define LCRR_EADC_3 0x00030000
  243. #define LCRR_EADC_4 0x00000000
  244. #define LCRR_EADC_SHIFT 16
  245. #define LCRR_CLKDIV 0x0000000F
  246. #define LCRR_CLKDIV_2 0x00000002
  247. #define LCRR_CLKDIV_4 0x00000004
  248. #define LCRR_CLKDIV_8 0x00000008
  249. #define LCRR_CLKDIV_SHIFT 0
  250. #endif /* __MPC83XX_H__ */