intel-agp.h 9.0 KB

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