fsp2.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. #ifndef _ASM_POWERPC_FSP_DCR_H_
  2. #define _ASM_POWERPC_FSP_DCR_H_
  3. #ifdef __KERNEL__
  4. #include <asm/dcr.h>
  5. #define DCRN_CMU_ADDR 0x00C /* Chip management unic addr */
  6. #define DCRN_CMU_DATA 0x00D /* Chip management unic data */
  7. /* PLB4 Arbiter */
  8. #define DCRN_PLB4_PCBI 0x010 /* PLB Crossbar ID/Rev Register */
  9. #define DCRN_PLB4_P0ACR 0x011 /* PLB0 Arbiter Control Register */
  10. #define DCRN_PLB4_P0ESRL 0x012 /* PLB0 Error Status Register Low */
  11. #define DCRN_PLB4_P0ESRH 0x013 /* PLB0 Error Status Register High */
  12. #define DCRN_PLB4_P0EARL 0x014 /* PLB0 Error Address Register Low */
  13. #define DCRN_PLB4_P0EARH 0x015 /* PLB0 Error Address Register High */
  14. #define DCRN_PLB4_P0ESRLS 0x016 /* PLB0 Error Status Register Low Set*/
  15. #define DCRN_PLB4_P0ESRHS 0x017 /* PLB0 Error Status Register High */
  16. #define DCRN_PLB4_PCBC 0x018 /* PLB Crossbar Control Register */
  17. #define DCRN_PLB4_P1ACR 0x019 /* PLB1 Arbiter Control Register */
  18. #define DCRN_PLB4_P1ESRL 0x01A /* PLB1 Error Status Register Low */
  19. #define DCRN_PLB4_P1ESRH 0x01B /* PLB1 Error Status Register High */
  20. #define DCRN_PLB4_P1EARL 0x01C /* PLB1 Error Address Register Low */
  21. #define DCRN_PLB4_P1EARH 0x01D /* PLB1 Error Address Register High */
  22. #define DCRN_PLB4_P1ESRLS 0x01E /* PLB1 Error Status Register Low Set*/
  23. #define DCRN_PLB4_P1ESRHS 0x01F /*PLB1 Error Status Register High Set*/
  24. /* PLB4/OPB bridge 0, 1, 2, 3 */
  25. #define DCRN_PLB4OPB0_BASE 0x020
  26. #define DCRN_PLB4OPB1_BASE 0x030
  27. #define DCRN_PLB4OPB2_BASE 0x040
  28. #define DCRN_PLB4OPB3_BASE 0x050
  29. #define PLB4OPB_GESR0 0x0 /* Error status 0: Master Dev 0-3 */
  30. #define PLB4OPB_GEAR 0x2 /* Error Address Register */
  31. #define PLB4OPB_GEARU 0x3 /* Error Upper Address Register */
  32. #define PLB4OPB_GESR1 0x4 /* Error Status 1: Master Dev 4-7 */
  33. #define PLB4OPB_GESR2 0xC /* Error Status 2: Master Dev 8-11 */
  34. /* PLB4-to-AHB Bridge */
  35. #define DCRN_PLB4AHB_BASE 0x400
  36. #define DCRN_PLB4AHB_SEUAR (DCRN_PLB4AHB_BASE + 1)
  37. #define DCRN_PLB4AHB_SELAR (DCRN_PLB4AHB_BASE + 2)
  38. #define DCRN_PLB4AHB_ESR (DCRN_PLB4AHB_BASE + 3)
  39. #define DCRN_AHBPLB4_ESR (DCRN_PLB4AHB_BASE + 8)
  40. #define DCRN_AHBPLB4_EAR (DCRN_PLB4AHB_BASE + 9)
  41. /* PLB6 Controller */
  42. #define DCRN_PLB6_BASE 0x11111300
  43. #define DCRN_PLB6_CR0 (DCRN_PLB6_BASE)
  44. #define DCRN_PLB6_ERR (DCRN_PLB6_BASE + 0x0B)
  45. #define DCRN_PLB6_HD (DCRN_PLB6_BASE + 0x0E)
  46. #define DCRN_PLB6_SHD (DCRN_PLB6_BASE + 0x10)
  47. /* PLB4-to-PLB6 Bridge */
  48. #define DCRN_PLB4PLB6_BASE 0x11111320
  49. #define DCRN_PLB4PLB6_ESR (DCRN_PLB4PLB6_BASE + 1)
  50. #define DCRN_PLB4PLB6_EARH (DCRN_PLB4PLB6_BASE + 3)
  51. #define DCRN_PLB4PLB6_EARL (DCRN_PLB4PLB6_BASE + 4)
  52. /* PLB6-to-PLB4 Bridge */
  53. #define DCRN_PLB6PLB4_BASE 0x11111350
  54. #define DCRN_PLB6PLB4_ESR (DCRN_PLB6PLB4_BASE + 1)
  55. #define DCRN_PLB6PLB4_EARH (DCRN_PLB6PLB4_BASE + 3)
  56. #define DCRN_PLB6PLB4_EARL (DCRN_PLB6PLB4_BASE + 4)
  57. /* PLB6-to-MCIF Bridge */
  58. #define DCRN_PLB6MCIF_BASE 0x11111380
  59. #define DCRN_PLB6MCIF_BESR0 (DCRN_PLB6MCIF_BASE + 0)
  60. #define DCRN_PLB6MCIF_BESR1 (DCRN_PLB6MCIF_BASE + 1)
  61. #define DCRN_PLB6MCIF_BEARL (DCRN_PLB6MCIF_BASE + 2)
  62. #define DCRN_PLB6MCIF_BEARH (DCRN_PLB6MCIF_BASE + 3)
  63. /* Configuration Logic Registers */
  64. #define DCRN_CONF_BASE 0x11111400
  65. #define DCRN_CONF_FIR_RWC (DCRN_CONF_BASE + 0x3A)
  66. #define DCRN_CONF_EIR_RS (DCRN_CONF_BASE + 0x3E)
  67. #define DCRN_CONF_RPERR0 (DCRN_CONF_BASE + 0x4D)
  68. #define DCRN_CONF_RPERR1 (DCRN_CONF_BASE + 0x4E)
  69. #define DCRN_L2CDCRAI 0x11111100
  70. #define DCRN_L2CDCRDI 0x11111104
  71. /* L2 indirect addresses */
  72. #define L2MCK 0x120
  73. #define L2MCKEN 0x130
  74. #define L2INT 0x150
  75. #define L2INTEN 0x160
  76. #define L2LOG0 0x180
  77. #define L2LOG1 0x184
  78. #define L2LOG2 0x188
  79. #define L2LOG3 0x18C
  80. #define L2LOG4 0x190
  81. #define L2LOG5 0x194
  82. #define L2PLBSTAT0 0x300
  83. #define L2PLBSTAT1 0x304
  84. #define L2PLBMCKEN0 0x330
  85. #define L2PLBMCKEN1 0x334
  86. #define L2PLBINTEN0 0x360
  87. #define L2PLBINTEN1 0x364
  88. #define L2ARRSTAT0 0x500
  89. #define L2ARRSTAT1 0x504
  90. #define L2ARRSTAT2 0x508
  91. #define L2ARRMCKEN0 0x530
  92. #define L2ARRMCKEN1 0x534
  93. #define L2ARRMCKEN2 0x538
  94. #define L2ARRINTEN0 0x560
  95. #define L2ARRINTEN1 0x564
  96. #define L2ARRINTEN2 0x568
  97. #define L2CPUSTAT 0x700
  98. #define L2CPUMCKEN 0x730
  99. #define L2CPUINTEN 0x760
  100. #define L2RACSTAT0 0x900
  101. #define L2RACMCKEN0 0x930
  102. #define L2RACINTEN0 0x960
  103. #define L2WACSTAT0 0xD00
  104. #define L2WACSTAT1 0xD04
  105. #define L2WACSTAT2 0xD08
  106. #define L2WACMCKEN0 0xD30
  107. #define L2WACMCKEN1 0xD34
  108. #define L2WACMCKEN2 0xD38
  109. #define L2WACINTEN0 0xD60
  110. #define L2WACINTEN1 0xD64
  111. #define L2WACINTEN2 0xD68
  112. #define L2WDFSTAT 0xF00
  113. #define L2WDFMCKEN 0xF30
  114. #define L2WDFINTEN 0xF60
  115. /* DDR3/4 Memory Controller */
  116. #define DCRN_DDR34_BASE 0x11120000
  117. #define DCRN_DDR34_MCSTAT 0x10
  118. #define DCRN_DDR34_MCOPT1 0x20
  119. #define DCRN_DDR34_MCOPT2 0x21
  120. #define DCRN_DDR34_PHYSTAT 0x32
  121. #define DCRN_DDR34_CFGR0 0x40
  122. #define DCRN_DDR34_CFGR1 0x41
  123. #define DCRN_DDR34_CFGR2 0x42
  124. #define DCRN_DDR34_CFGR3 0x43
  125. #define DCRN_DDR34_SCRUB_CNTL 0xAA
  126. #define DCRN_DDR34_SCRUB_INT 0xAB
  127. #define DCRN_DDR34_SCRUB_START_ADDR 0xB0
  128. #define DCRN_DDR34_SCRUB_END_ADDR 0xD0
  129. #define DCRN_DDR34_ECCERR_ADDR_PORT0 0xE0
  130. #define DCRN_DDR34_ECCERR_ADDR_PORT1 0xE1
  131. #define DCRN_DDR34_ECCERR_ADDR_PORT2 0xE2
  132. #define DCRN_DDR34_ECCERR_ADDR_PORT3 0xE3
  133. #define DCRN_DDR34_ECCERR_COUNT_PORT0 0xE4
  134. #define DCRN_DDR34_ECCERR_COUNT_PORT1 0xE5
  135. #define DCRN_DDR34_ECCERR_COUNT_PORT2 0xE6
  136. #define DCRN_DDR34_ECCERR_COUNT_PORT3 0xE7
  137. #define DCRN_DDR34_ECCERR_PORT0 0xF0
  138. #define DCRN_DDR34_ECCERR_PORT1 0xF2
  139. #define DCRN_DDR34_ECCERR_PORT2 0xF4
  140. #define DCRN_DDR34_ECCERR_PORT3 0xF6
  141. #define DCRN_DDR34_ECC_CHECK_PORT0 0xF8
  142. #define DCRN_DDR34_ECC_CHECK_PORT1 0xF9
  143. #define DCRN_DDR34_ECC_CHECK_PORT2 0xF9
  144. #define DCRN_DDR34_ECC_CHECK_PORT3 0xFB
  145. #define DDR34_SCRUB_CNTL_STOP 0x00000000
  146. #define DDR34_SCRUB_CNTL_SCRUB 0x80000000
  147. #define DDR34_SCRUB_CNTL_UE_STOP 0x20000000
  148. #define DDR34_SCRUB_CNTL_CE_STOP 0x10000000
  149. #define DDR34_SCRUB_CNTL_RANK_EN 0x00008000
  150. /* PLB-Attached DDR3/4 Core Wrapper */
  151. #define DCRN_CW_BASE 0x11111800
  152. #define DCRN_CW_MCER0 0x00
  153. #define DCRN_CW_MCER1 0x01
  154. #define DCRN_CW_MCER_AND0 0x02
  155. #define DCRN_CW_MCER_AND1 0x03
  156. #define DCRN_CW_MCER_OR0 0x04
  157. #define DCRN_CW_MCER_OR1 0x05
  158. #define DCRN_CW_MCER_MASK0 0x06
  159. #define DCRN_CW_MCER_MASK1 0x07
  160. #define DCRN_CW_MCER_MASK_AND0 0x08
  161. #define DCRN_CW_MCER_MASK_AND1 0x09
  162. #define DCRN_CW_MCER_MASK_OR0 0x0A
  163. #define DCRN_CW_MCER_MASK_OR1 0x0B
  164. #define DCRN_CW_MCER_ACTION0 0x0C
  165. #define DCRN_CW_MCER_ACTION1 0x0D
  166. #define DCRN_CW_MCER_WOF0 0x0E
  167. #define DCRN_CW_MCER_WOF1 0x0F
  168. #define DCRN_CW_LFIR 0x10
  169. #define DCRN_CW_LFIR_AND 0x11
  170. #define DCRN_CW_LFIR_OR 0x12
  171. #define DCRN_CW_LFIR_MASK 0x13
  172. #define DCRN_CW_LFIR_MASK_AND 0x14
  173. #define DCRN_CW_LFIR_MASK_OR 0x15
  174. #define CW_MCER0_MEM_CE 0x00020000
  175. /* CMU addresses */
  176. #define CMUN_CRCS 0x00 /* Chip Reset Control/Status */
  177. #define CMUN_CONFFIR0 0x20 /* Config Reg Parity FIR 0 */
  178. #define CMUN_CONFFIR1 0x21 /* Config Reg Parity FIR 1 */
  179. #define CMUN_CONFFIR2 0x22 /* Config Reg Parity FIR 2 */
  180. #define CMUN_CONFFIR3 0x23 /* Config Reg Parity FIR 3 */
  181. #define CMUN_URCR3_RS 0x24 /* Unit Reset Control Reg 3 Set */
  182. #define CMUN_URCR3_C 0x25 /* Unit Reset Control Reg 3 Clear */
  183. #define CMUN_URCR3_P 0x26 /* Unit Reset Control Reg 3 Pulse */
  184. #define CMUN_PW0 0x2C /* Pulse Width Register */
  185. #define CMUN_URCR0_P 0x2D /* Unit Reset Control Reg 0 Pulse */
  186. #define CMUN_URCR1_P 0x2E /* Unit Reset Control Reg 1 Pulse */
  187. #define CMUN_URCR2_P 0x2F /* Unit Reset Control Reg 2 Pulse */
  188. #define CMUN_CLS_RW 0x30 /* Code Load Status (Read/Write) */
  189. #define CMUN_CLS_S 0x31 /* Code Load Status (Set) */
  190. #define CMUN_CLS_C 0x32 /* Code Load Status (Clear */
  191. #define CMUN_URCR2_RS 0x33 /* Unit Reset Control Reg 2 Set */
  192. #define CMUN_URCR2_C 0x34 /* Unit Reset Control Reg 2 Clear */
  193. #define CMUN_CLKEN0 0x35 /* Clock Enable 0 */
  194. #define CMUN_CLKEN1 0x36 /* Clock Enable 1 */
  195. #define CMUN_PCD0 0x37 /* PSI clock divider 0 */
  196. #define CMUN_PCD1 0x38 /* PSI clock divider 1 */
  197. #define CMUN_TMR0 0x39 /* Reset Timer */
  198. #define CMUN_TVS0 0x3A /* TV Sense Reg 0 */
  199. #define CMUN_TVS1 0x3B /* TV Sense Reg 1 */
  200. #define CMUN_MCCR 0x3C /* DRAM Configuration Reg */
  201. #define CMUN_FIR0 0x3D /* Fault Isolation Reg 0 */
  202. #define CMUN_FMR0 0x3E /* FIR Mask Reg 0 */
  203. #define CMUN_ETDRB 0x3F /* ETDR Backdoor */
  204. /* CRCS bit fields */
  205. #define CRCS_STAT_MASK 0xF0000000
  206. #define CRCS_STAT_POR 0x10000000
  207. #define CRCS_STAT_PHR 0x20000000
  208. #define CRCS_STAT_PCIE 0x30000000
  209. #define CRCS_STAT_CRCS_SYS 0x40000000
  210. #define CRCS_STAT_DBCR_SYS 0x50000000
  211. #define CRCS_STAT_HOST_SYS 0x60000000
  212. #define CRCS_STAT_CHIP_RST_B 0x70000000
  213. #define CRCS_STAT_CRCS_CHIP 0x80000000
  214. #define CRCS_STAT_DBCR_CHIP 0x90000000
  215. #define CRCS_STAT_HOST_CHIP 0xA0000000
  216. #define CRCS_STAT_PSI_CHIP 0xB0000000
  217. #define CRCS_STAT_CRCS_CORE 0xC0000000
  218. #define CRCS_STAT_DBCR_CORE 0xD0000000
  219. #define CRCS_STAT_HOST_CORE 0xE0000000
  220. #define CRCS_STAT_PCIE_HOT 0xF0000000
  221. #define CRCS_STAT_SELF_CORE 0x40000000
  222. #define CRCS_STAT_SELF_CHIP 0x50000000
  223. #define CRCS_WATCHE 0x08000000
  224. #define CRCS_CORE 0x04000000 /* Reset PPC440 core */
  225. #define CRCS_CHIP 0x02000000 /* Chip Reset */
  226. #define CRCS_SYS 0x01000000 /* System Reset */
  227. #define CRCS_WRCR 0x00800000 /* Watchdog reset on core reset */
  228. #define CRCS_EXTCR 0x00080000 /* CHIP_RST_B triggers chip reset */
  229. #define CRCS_PLOCK 0x00000002 /* PLL Locked */
  230. #define mtcmu(reg, data) \
  231. do { \
  232. mtdcr(DCRN_CMU_ADDR, reg); \
  233. mtdcr(DCRN_CMU_DATA, data); \
  234. } while (0)
  235. #define mfcmu(reg)\
  236. ({u32 data; \
  237. mtdcr(DCRN_CMU_ADDR, reg); \
  238. data = mfdcr(DCRN_CMU_DATA); \
  239. data; })
  240. #define mtl2(reg, data) \
  241. do { \
  242. mtdcr(DCRN_L2CDCRAI, reg); \
  243. mtdcr(DCRN_L2CDCRDI, data); \
  244. } while (0)
  245. #define mfl2(reg) \
  246. ({u32 data; \
  247. mtdcr(DCRN_L2CDCRAI, reg); \
  248. data = mfdcr(DCRN_L2CDCRDI); \
  249. data; })
  250. #endif /* __KERNEL__ */
  251. #endif /* _ASM_POWERPC_FSP2_DCR_H_ */