cs5536.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /*
  2. * The header file of cs5536 south bridge.
  3. *
  4. * Copyright (C) 2007 Lemote, Inc.
  5. * Author : jlliu <liujl@lemote.com>
  6. */
  7. #ifndef _CS5536_H
  8. #define _CS5536_H
  9. #include <linux/types.h>
  10. extern void _rdmsr(u32 msr, u32 *hi, u32 *lo);
  11. extern void _wrmsr(u32 msr, u32 hi, u32 lo);
  12. /*
  13. * MSR module base
  14. */
  15. #define CS5536_SB_MSR_BASE (0x00000000)
  16. #define CS5536_GLIU_MSR_BASE (0x10000000)
  17. #define CS5536_ILLEGAL_MSR_BASE (0x20000000)
  18. #define CS5536_USB_MSR_BASE (0x40000000)
  19. #define CS5536_IDE_MSR_BASE (0x60000000)
  20. #define CS5536_DIVIL_MSR_BASE (0x80000000)
  21. #define CS5536_ACC_MSR_BASE (0xa0000000)
  22. #define CS5536_UNUSED_MSR_BASE (0xc0000000)
  23. #define CS5536_GLCP_MSR_BASE (0xe0000000)
  24. #define SB_MSR_REG(offset) (CS5536_SB_MSR_BASE | (offset))
  25. #define GLIU_MSR_REG(offset) (CS5536_GLIU_MSR_BASE | (offset))
  26. #define ILLEGAL_MSR_REG(offset) (CS5536_ILLEGAL_MSR_BASE | (offset))
  27. #define USB_MSR_REG(offset) (CS5536_USB_MSR_BASE | (offset))
  28. #define IDE_MSR_REG(offset) (CS5536_IDE_MSR_BASE | (offset))
  29. #define DIVIL_MSR_REG(offset) (CS5536_DIVIL_MSR_BASE | (offset))
  30. #define ACC_MSR_REG(offset) (CS5536_ACC_MSR_BASE | (offset))
  31. #define UNUSED_MSR_REG(offset) (CS5536_UNUSED_MSR_BASE | (offset))
  32. #define GLCP_MSR_REG(offset) (CS5536_GLCP_MSR_BASE | (offset))
  33. /*
  34. * BAR SPACE OF VIRTUAL PCI :
  35. * range for pci probe use, length is the actual size.
  36. */
  37. /* IO space for all DIVIL modules */
  38. #define CS5536_IRQ_RANGE 0xffffffe0 /* USERD FOR PCI PROBE */
  39. #define CS5536_IRQ_LENGTH 0x20 /* THE REGS ACTUAL LENGTH */
  40. #define CS5536_SMB_RANGE 0xfffffff8
  41. #define CS5536_SMB_LENGTH 0x08
  42. #define CS5536_GPIO_RANGE 0xffffff00
  43. #define CS5536_GPIO_LENGTH 0x100
  44. #define CS5536_MFGPT_RANGE 0xffffffc0
  45. #define CS5536_MFGPT_LENGTH 0x40
  46. #define CS5536_ACPI_RANGE 0xffffffe0
  47. #define CS5536_ACPI_LENGTH 0x20
  48. #define CS5536_PMS_RANGE 0xffffff80
  49. #define CS5536_PMS_LENGTH 0x80
  50. /* IO space for IDE */
  51. #define CS5536_IDE_RANGE 0xfffffff0
  52. #define CS5536_IDE_LENGTH 0x10
  53. /* IO space for ACC */
  54. #define CS5536_ACC_RANGE 0xffffff80
  55. #define CS5536_ACC_LENGTH 0x80
  56. /* MEM space for ALL USB modules */
  57. #define CS5536_OHCI_RANGE 0xfffff000
  58. #define CS5536_OHCI_LENGTH 0x1000
  59. #define CS5536_EHCI_RANGE 0xfffff000
  60. #define CS5536_EHCI_LENGTH 0x1000
  61. /*
  62. * PCI MSR ACCESS
  63. */
  64. #define PCI_MSR_CTRL 0xF0
  65. #define PCI_MSR_ADDR 0xF4
  66. #define PCI_MSR_DATA_LO 0xF8
  67. #define PCI_MSR_DATA_HI 0xFC
  68. /**************** MSR *****************************/
  69. /*
  70. * GLIU STANDARD MSR
  71. */
  72. #define GLIU_CAP 0x00
  73. #define GLIU_CONFIG 0x01
  74. #define GLIU_SMI 0x02
  75. #define GLIU_ERROR 0x03
  76. #define GLIU_PM 0x04
  77. #define GLIU_DIAG 0x05
  78. /*
  79. * GLIU SPEC. MSR
  80. */
  81. #define GLIU_P2D_BM0 0x20
  82. #define GLIU_P2D_BM1 0x21
  83. #define GLIU_P2D_BM2 0x22
  84. #define GLIU_P2D_BMK0 0x23
  85. #define GLIU_P2D_BMK1 0x24
  86. #define GLIU_P2D_BM3 0x25
  87. #define GLIU_P2D_BM4 0x26
  88. #define GLIU_COH 0x80
  89. #define GLIU_PAE 0x81
  90. #define GLIU_ARB 0x82
  91. #define GLIU_ASMI 0x83
  92. #define GLIU_AERR 0x84
  93. #define GLIU_DEBUG 0x85
  94. #define GLIU_PHY_CAP 0x86
  95. #define GLIU_NOUT_RESP 0x87
  96. #define GLIU_NOUT_WDATA 0x88
  97. #define GLIU_WHOAMI 0x8B
  98. #define GLIU_SLV_DIS 0x8C
  99. #define GLIU_IOD_BM0 0xE0
  100. #define GLIU_IOD_BM1 0xE1
  101. #define GLIU_IOD_BM2 0xE2
  102. #define GLIU_IOD_BM3 0xE3
  103. #define GLIU_IOD_BM4 0xE4
  104. #define GLIU_IOD_BM5 0xE5
  105. #define GLIU_IOD_BM6 0xE6
  106. #define GLIU_IOD_BM7 0xE7
  107. #define GLIU_IOD_BM8 0xE8
  108. #define GLIU_IOD_BM9 0xE9
  109. #define GLIU_IOD_SC0 0xEA
  110. #define GLIU_IOD_SC1 0xEB
  111. #define GLIU_IOD_SC2 0xEC
  112. #define GLIU_IOD_SC3 0xED
  113. #define GLIU_IOD_SC4 0xEE
  114. #define GLIU_IOD_SC5 0xEF
  115. #define GLIU_IOD_SC6 0xF0
  116. #define GLIU_IOD_SC7 0xF1
  117. /*
  118. * SB STANDARD
  119. */
  120. #define SB_CAP 0x00
  121. #define SB_CONFIG 0x01
  122. #define SB_SMI 0x02
  123. #define SB_ERROR 0x03
  124. #define SB_MAR_ERR_EN 0x00000001
  125. #define SB_TAR_ERR_EN 0x00000002
  126. #define SB_RSVD_BIT1 0x00000004
  127. #define SB_EXCEP_ERR_EN 0x00000008
  128. #define SB_SYSE_ERR_EN 0x00000010
  129. #define SB_PARE_ERR_EN 0x00000020
  130. #define SB_TAS_ERR_EN 0x00000040
  131. #define SB_MAR_ERR_FLAG 0x00010000
  132. #define SB_TAR_ERR_FLAG 0x00020000
  133. #define SB_RSVD_BIT2 0x00040000
  134. #define SB_EXCEP_ERR_FLAG 0x00080000
  135. #define SB_SYSE_ERR_FLAG 0x00100000
  136. #define SB_PARE_ERR_FLAG 0x00200000
  137. #define SB_TAS_ERR_FLAG 0x00400000
  138. #define SB_PM 0x04
  139. #define SB_DIAG 0x05
  140. /*
  141. * SB SPEC.
  142. */
  143. #define SB_CTRL 0x10
  144. #define SB_R0 0x20
  145. #define SB_R1 0x21
  146. #define SB_R2 0x22
  147. #define SB_R3 0x23
  148. #define SB_R4 0x24
  149. #define SB_R5 0x25
  150. #define SB_R6 0x26
  151. #define SB_R7 0x27
  152. #define SB_R8 0x28
  153. #define SB_R9 0x29
  154. #define SB_R10 0x2A
  155. #define SB_R11 0x2B
  156. #define SB_R12 0x2C
  157. #define SB_R13 0x2D
  158. #define SB_R14 0x2E
  159. #define SB_R15 0x2F
  160. /*
  161. * GLCP STANDARD
  162. */
  163. #define GLCP_CAP 0x00
  164. #define GLCP_CONFIG 0x01
  165. #define GLCP_SMI 0x02
  166. #define GLCP_ERROR 0x03
  167. #define GLCP_PM 0x04
  168. #define GLCP_DIAG 0x05
  169. /*
  170. * GLCP SPEC.
  171. */
  172. #define GLCP_CLK_DIS_DELAY 0x08
  173. #define GLCP_PM_CLK_DISABLE 0x09
  174. #define GLCP_GLB_PM 0x0B
  175. #define GLCP_DBG_OUT 0x0C
  176. #define GLCP_RSVD1 0x0D
  177. #define GLCP_SOFT_COM 0x0E
  178. #define SOFT_BAR_SMB_FLAG 0x00000001
  179. #define SOFT_BAR_GPIO_FLAG 0x00000002
  180. #define SOFT_BAR_MFGPT_FLAG 0x00000004
  181. #define SOFT_BAR_IRQ_FLAG 0x00000008
  182. #define SOFT_BAR_PMS_FLAG 0x00000010
  183. #define SOFT_BAR_ACPI_FLAG 0x00000020
  184. #define SOFT_BAR_IDE_FLAG 0x00000400
  185. #define SOFT_BAR_ACC_FLAG 0x00000800
  186. #define SOFT_BAR_OHCI_FLAG 0x00001000
  187. #define SOFT_BAR_EHCI_FLAG 0x00002000
  188. #define GLCP_RSVD2 0x0F
  189. #define GLCP_CLK_OFF 0x10
  190. #define GLCP_CLK_ACTIVE 0x11
  191. #define GLCP_CLK_DISABLE 0x12
  192. #define GLCP_CLK4ACK 0x13
  193. #define GLCP_SYS_RST 0x14
  194. #define GLCP_RSVD3 0x15
  195. #define GLCP_DBG_CLK_CTRL 0x16
  196. #define GLCP_CHIP_REV_ID 0x17
  197. /* PIC */
  198. #define PIC_YSEL_LOW 0x20
  199. #define PIC_YSEL_LOW_USB_SHIFT 8
  200. #define PIC_YSEL_LOW_ACC_SHIFT 16
  201. #define PIC_YSEL_LOW_FLASH_SHIFT 24
  202. #define PIC_YSEL_HIGH 0x21
  203. #define PIC_ZSEL_LOW 0x22
  204. #define PIC_ZSEL_HIGH 0x23
  205. #define PIC_IRQM_PRIM 0x24
  206. #define PIC_IRQM_LPC 0x25
  207. #define PIC_XIRR_STS_LOW 0x26
  208. #define PIC_XIRR_STS_HIGH 0x27
  209. #define PCI_SHDW 0x34
  210. /*
  211. * DIVIL STANDARD
  212. */
  213. #define DIVIL_CAP 0x00
  214. #define DIVIL_CONFIG 0x01
  215. #define DIVIL_SMI 0x02
  216. #define DIVIL_ERROR 0x03
  217. #define DIVIL_PM 0x04
  218. #define DIVIL_DIAG 0x05
  219. /*
  220. * DIVIL SPEC.
  221. */
  222. #define DIVIL_LBAR_IRQ 0x08
  223. #define DIVIL_LBAR_KEL 0x09
  224. #define DIVIL_LBAR_SMB 0x0B
  225. #define DIVIL_LBAR_GPIO 0x0C
  226. #define DIVIL_LBAR_MFGPT 0x0D
  227. #define DIVIL_LBAR_ACPI 0x0E
  228. #define DIVIL_LBAR_PMS 0x0F
  229. #define DIVIL_LEG_IO 0x14
  230. #define DIVIL_BALL_OPTS 0x15
  231. #define DIVIL_SOFT_IRQ 0x16
  232. #define DIVIL_SOFT_RESET 0x17
  233. /* MFGPT */
  234. #define MFGPT_IRQ 0x28
  235. /*
  236. * IDE STANDARD
  237. */
  238. #define IDE_CAP 0x00
  239. #define IDE_CONFIG 0x01
  240. #define IDE_SMI 0x02
  241. #define IDE_ERROR 0x03
  242. #define IDE_PM 0x04
  243. #define IDE_DIAG 0x05
  244. /*
  245. * IDE SPEC.
  246. */
  247. #define IDE_IO_BAR 0x08
  248. #define IDE_CFG 0x10
  249. #define IDE_DTC 0x12
  250. #define IDE_CAST 0x13
  251. #define IDE_ETC 0x14
  252. #define IDE_INTERNAL_PM 0x15
  253. /*
  254. * ACC STANDARD
  255. */
  256. #define ACC_CAP 0x00
  257. #define ACC_CONFIG 0x01
  258. #define ACC_SMI 0x02
  259. #define ACC_ERROR 0x03
  260. #define ACC_PM 0x04
  261. #define ACC_DIAG 0x05
  262. /*
  263. * USB STANDARD
  264. */
  265. #define USB_CAP 0x00
  266. #define USB_CONFIG 0x01
  267. #define USB_SMI 0x02
  268. #define USB_ERROR 0x03
  269. #define USB_PM 0x04
  270. #define USB_DIAG 0x05
  271. /*
  272. * USB SPEC.
  273. */
  274. #define USB_OHCI 0x08
  275. #define USB_EHCI 0x09
  276. /****************** NATIVE ***************************/
  277. /* GPIO : I/O SPACE; REG : 32BITS */
  278. #define GPIOL_OUT_VAL 0x00
  279. #define GPIOL_OUT_EN 0x04
  280. #endif /* _CS5536_H */