intel-agp.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /*
  2. * Common Intel AGPGART and GTT definitions.
  3. */
  4. #ifndef _INTEL_AGP_H
  5. #define _INTEL_AGP_H
  6. /* Intel registers */
  7. #define INTEL_APSIZE 0xb4
  8. #define INTEL_ATTBASE 0xb8
  9. #define INTEL_AGPCTRL 0xb0
  10. #define INTEL_NBXCFG 0x50
  11. #define INTEL_ERRSTS 0x91
  12. /* Intel i830 registers */
  13. #define I830_GMCH_CTRL 0x52
  14. #define I830_GMCH_ENABLED 0x4
  15. #define I830_GMCH_MEM_MASK 0x1
  16. #define I830_GMCH_MEM_64M 0x1
  17. #define I830_GMCH_MEM_128M 0
  18. #define I830_GMCH_GMS_MASK 0x70
  19. #define I830_GMCH_GMS_DISABLED 0x00
  20. #define I830_GMCH_GMS_LOCAL 0x10
  21. #define I830_GMCH_GMS_STOLEN_512 0x20
  22. #define I830_GMCH_GMS_STOLEN_1024 0x30
  23. #define I830_GMCH_GMS_STOLEN_8192 0x40
  24. #define I830_RDRAM_CHANNEL_TYPE 0x03010
  25. #define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
  26. #define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
  27. /* This one is for I830MP w. an external graphic card */
  28. #define INTEL_I830_ERRSTS 0x92
  29. /* Intel 855GM/852GM registers */
  30. #define I855_GMCH_GMS_MASK 0xF0
  31. #define I855_GMCH_GMS_STOLEN_0M 0x0
  32. #define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
  33. #define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
  34. #define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
  35. #define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
  36. #define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
  37. #define I85X_CAPID 0x44
  38. #define I85X_VARIANT_MASK 0x7
  39. #define I85X_VARIANT_SHIFT 5
  40. #define I855_GME 0x0
  41. #define I855_GM 0x4
  42. #define I852_GME 0x2
  43. #define I852_GM 0x5
  44. /* Intel i845 registers */
  45. #define INTEL_I845_AGPM 0x51
  46. #define INTEL_I845_ERRSTS 0xc8
  47. /* Intel i860 registers */
  48. #define INTEL_I860_MCHCFG 0x50
  49. #define INTEL_I860_ERRSTS 0xc8
  50. /* Intel i810 registers */
  51. #define I810_GMADDR 0x10
  52. #define I810_MMADDR 0x14
  53. #define I810_PTE_BASE 0x10000
  54. #define I810_PTE_MAIN_UNCACHED 0x00000000
  55. #define I810_PTE_LOCAL 0x00000002
  56. #define I810_PTE_VALID 0x00000001
  57. #define I830_PTE_SYSTEM_CACHED 0x00000006
  58. /* GT PTE cache control fields */
  59. #define GEN6_PTE_UNCACHED 0x00000002
  60. #define GEN6_PTE_LLC 0x00000004
  61. #define GEN6_PTE_LLC_MLC 0x00000006
  62. #define GEN6_PTE_GFDT 0x00000008
  63. #define I810_SMRAM_MISCC 0x70
  64. #define I810_GFX_MEM_WIN_SIZE 0x00010000
  65. #define I810_GFX_MEM_WIN_32M 0x00010000
  66. #define I810_GMS 0x000000c0
  67. #define I810_GMS_DISABLE 0x00000000
  68. #define I810_PGETBL_CTL 0x2020
  69. #define I810_PGETBL_ENABLED 0x00000001
  70. /* Note: PGETBL_CTL2 has a different offset on G33. */
  71. #define I965_PGETBL_CTL2 0x20c4
  72. #define I965_PGETBL_SIZE_MASK 0x0000000e
  73. #define I965_PGETBL_SIZE_512KB (0 << 1)
  74. #define I965_PGETBL_SIZE_256KB (1 << 1)
  75. #define I965_PGETBL_SIZE_128KB (2 << 1)
  76. #define I965_PGETBL_SIZE_1MB (3 << 1)
  77. #define I965_PGETBL_SIZE_2MB (4 << 1)
  78. #define I965_PGETBL_SIZE_1_5MB (5 << 1)
  79. #define G33_GMCH_SIZE_MASK (3 << 8)
  80. #define G33_GMCH_SIZE_1M (1 << 8)
  81. #define G33_GMCH_SIZE_2M (2 << 8)
  82. #define G4x_GMCH_SIZE_MASK (0xf << 8)
  83. #define G4x_GMCH_SIZE_1M (0x1 << 8)
  84. #define G4x_GMCH_SIZE_2M (0x3 << 8)
  85. #define G4x_GMCH_SIZE_VT_1M (0x9 << 8)
  86. #define G4x_GMCH_SIZE_VT_1_5M (0xa << 8)
  87. #define G4x_GMCH_SIZE_VT_2M (0xc << 8)
  88. #define GFX_FLSH_CNTL 0x2170 /* 915+ */
  89. #define I810_DRAM_CTL 0x3000
  90. #define I810_DRAM_ROW_0 0x00000001
  91. #define I810_DRAM_ROW_0_SDRAM 0x00000001
  92. /* Intel 815 register */
  93. #define INTEL_815_APCONT 0x51
  94. #define INTEL_815_ATTBASE_MASK ~0x1FFFFFFF
  95. /* Intel i820 registers */
  96. #define INTEL_I820_RDCR 0x51
  97. #define INTEL_I820_ERRSTS 0xc8
  98. /* Intel i840 registers */
  99. #define INTEL_I840_MCHCFG 0x50
  100. #define INTEL_I840_ERRSTS 0xc8
  101. /* Intel i850 registers */
  102. #define INTEL_I850_MCHCFG 0x50
  103. #define INTEL_I850_ERRSTS 0xc8
  104. /* intel 915G registers */
  105. #define I915_GMADDR 0x18
  106. #define I915_MMADDR 0x10
  107. #define I915_PTEADDR 0x1C
  108. #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4)
  109. #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4)
  110. #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
  111. #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
  112. #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4)
  113. #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4)
  114. #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4)
  115. #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4)
  116. #define I915_IFPADDR 0x60
  117. #define I830_HIC 0x70
  118. /* Intel 965G registers */
  119. #define I965_MSAC 0x62
  120. #define I965_IFPADDR 0x70
  121. /* Intel 7505 registers */
  122. #define INTEL_I7505_APSIZE 0x74
  123. #define INTEL_I7505_NCAPID 0x60
  124. #define INTEL_I7505_NISTAT 0x6c
  125. #define INTEL_I7505_ATTBASE 0x78
  126. #define INTEL_I7505_ERRSTS 0x42
  127. #define INTEL_I7505_AGPCTRL 0x70
  128. #define INTEL_I7505_MCHCFG 0x50
  129. #define SNB_GMCH_CTRL 0x50
  130. #define SNB_GMCH_GMS_STOLEN_MASK 0xF8
  131. #define SNB_GMCH_GMS_STOLEN_32M (1 << 3)
  132. #define SNB_GMCH_GMS_STOLEN_64M (2 << 3)
  133. #define SNB_GMCH_GMS_STOLEN_96M (3 << 3)
  134. #define SNB_GMCH_GMS_STOLEN_128M (4 << 3)
  135. #define SNB_GMCH_GMS_STOLEN_160M (5 << 3)
  136. #define SNB_GMCH_GMS_STOLEN_192M (6 << 3)
  137. #define SNB_GMCH_GMS_STOLEN_224M (7 << 3)
  138. #define SNB_GMCH_GMS_STOLEN_256M (8 << 3)
  139. #define SNB_GMCH_GMS_STOLEN_288M (9 << 3)
  140. #define SNB_GMCH_GMS_STOLEN_320M (0xa << 3)
  141. #define SNB_GMCH_GMS_STOLEN_352M (0xb << 3)
  142. #define SNB_GMCH_GMS_STOLEN_384M (0xc << 3)
  143. #define SNB_GMCH_GMS_STOLEN_416M (0xd << 3)
  144. #define SNB_GMCH_GMS_STOLEN_448M (0xe << 3)
  145. #define SNB_GMCH_GMS_STOLEN_480M (0xf << 3)
  146. #define SNB_GMCH_GMS_STOLEN_512M (0x10 << 3)
  147. #define SNB_GTT_SIZE_0M (0 << 8)
  148. #define SNB_GTT_SIZE_1M (1 << 8)
  149. #define SNB_GTT_SIZE_2M (2 << 8)
  150. #define SNB_GTT_SIZE_MASK (3 << 8)
  151. /* pci devices ids */
  152. #define PCI_DEVICE_ID_INTEL_E7221_HB 0x2588
  153. #define PCI_DEVICE_ID_INTEL_E7221_IG 0x258a
  154. #define PCI_DEVICE_ID_INTEL_82946GZ_HB 0x2970
  155. #define PCI_DEVICE_ID_INTEL_82946GZ_IG 0x2972
  156. #define PCI_DEVICE_ID_INTEL_82G35_HB 0x2980
  157. #define PCI_DEVICE_ID_INTEL_82G35_IG 0x2982
  158. #define PCI_DEVICE_ID_INTEL_82965Q_HB 0x2990
  159. #define PCI_DEVICE_ID_INTEL_82965Q_IG 0x2992
  160. #define PCI_DEVICE_ID_INTEL_82965G_HB 0x29A0
  161. #define PCI_DEVICE_ID_INTEL_82965G_IG 0x29A2
  162. #define PCI_DEVICE_ID_INTEL_82965GM_HB 0x2A00
  163. #define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02
  164. #define PCI_DEVICE_ID_INTEL_82965GME_HB 0x2A10
  165. #define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12
  166. #define PCI_DEVICE_ID_INTEL_82945GME_HB 0x27AC
  167. #define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE
  168. #define PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB 0xA010
  169. #define PCI_DEVICE_ID_INTEL_PINEVIEW_M_IG 0xA011
  170. #define PCI_DEVICE_ID_INTEL_PINEVIEW_HB 0xA000
  171. #define PCI_DEVICE_ID_INTEL_PINEVIEW_IG 0xA001
  172. #define PCI_DEVICE_ID_INTEL_G33_HB 0x29C0
  173. #define PCI_DEVICE_ID_INTEL_G33_IG 0x29C2
  174. #define PCI_DEVICE_ID_INTEL_Q35_HB 0x29B0
  175. #define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2
  176. #define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0
  177. #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2
  178. #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40
  179. #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42
  180. #define PCI_DEVICE_ID_INTEL_B43_1_HB 0x2E90
  181. #define PCI_DEVICE_ID_INTEL_B43_1_IG 0x2E92
  182. #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40
  183. #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42
  184. #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00
  185. #define PCI_DEVICE_ID_INTEL_EAGLELAKE_IG 0x2E02
  186. #define PCI_DEVICE_ID_INTEL_Q45_HB 0x2E10
  187. #define PCI_DEVICE_ID_INTEL_Q45_IG 0x2E12
  188. #define PCI_DEVICE_ID_INTEL_G45_HB 0x2E20
  189. #define PCI_DEVICE_ID_INTEL_G45_IG 0x2E22
  190. #define PCI_DEVICE_ID_INTEL_G41_HB 0x2E30
  191. #define PCI_DEVICE_ID_INTEL_G41_IG 0x2E32
  192. #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB 0x0040
  193. #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG 0x0042
  194. #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB 0x0044
  195. #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062
  196. #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a
  197. #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046
  198. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB 0x0100 /* Desktop */
  199. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT1_IG 0x0102
  200. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_IG 0x0112
  201. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_PLUS_IG 0x0122
  202. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB 0x0104 /* Mobile */
  203. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT1_IG 0x0106
  204. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_IG 0x0116
  205. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_PLUS_IG 0x0126
  206. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB 0x0108 /* Server */
  207. #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_IG 0x010A
  208. int intel_gmch_probe(struct pci_dev *pdev,
  209. struct agp_bridge_data *bridge);
  210. void intel_gmch_remove(struct pci_dev *pdev);
  211. #endif