intel_chipset.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /*
  2. *
  3. * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
  4. * All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sub license, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * The above copyright notice and this permission notice (including the
  15. * next paragraph) shall be included in all copies or substantial portions
  16. * of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  21. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
  22. * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  23. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  24. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  25. *
  26. */
  27. #ifndef _INTEL_CHIPSET_H
  28. #define _INTEL_CHIPSET_H
  29. #define PCI_CHIP_I810 0x7121
  30. #define PCI_CHIP_I810_DC100 0x7123
  31. #define PCI_CHIP_I810_E 0x7125
  32. #define PCI_CHIP_I815 0x1132
  33. #define PCI_CHIP_I830_M 0x3577
  34. #define PCI_CHIP_845_G 0x2562
  35. #define PCI_CHIP_I855_GM 0x3582
  36. #define PCI_CHIP_I865_G 0x2572
  37. #define PCI_CHIP_I915_G 0x2582
  38. #define PCI_CHIP_E7221_G 0x258A
  39. #define PCI_CHIP_I915_GM 0x2592
  40. #define PCI_CHIP_I945_G 0x2772
  41. #define PCI_CHIP_I945_GM 0x27A2
  42. #define PCI_CHIP_I945_GME 0x27AE
  43. #define PCI_CHIP_Q35_G 0x29B2
  44. #define PCI_CHIP_G33_G 0x29C2
  45. #define PCI_CHIP_Q33_G 0x29D2
  46. #define PCI_CHIP_IGD_GM 0xA011
  47. #define PCI_CHIP_IGD_G 0xA001
  48. #define IS_IGDGM(devid) ((devid) == PCI_CHIP_IGD_GM)
  49. #define IS_IGDG(devid) ((devid) == PCI_CHIP_IGD_G)
  50. #define IS_IGD(devid) (IS_IGDG(devid) || IS_IGDGM(devid))
  51. #define PCI_CHIP_I965_G 0x29A2
  52. #define PCI_CHIP_I965_Q 0x2992
  53. #define PCI_CHIP_I965_G_1 0x2982
  54. #define PCI_CHIP_I946_GZ 0x2972
  55. #define PCI_CHIP_I965_GM 0x2A02
  56. #define PCI_CHIP_I965_GME 0x2A12
  57. #define PCI_CHIP_GM45_GM 0x2A42
  58. #define PCI_CHIP_IGD_E_G 0x2E02
  59. #define PCI_CHIP_Q45_G 0x2E12
  60. #define PCI_CHIP_G45_G 0x2E22
  61. #define PCI_CHIP_G41_G 0x2E32
  62. #define PCI_CHIP_ILD_G 0x0042
  63. #define PCI_CHIP_ILM_G 0x0046
  64. #define PCI_CHIP_SANDYBRIDGE_GT1 0x0102 /* desktop */
  65. #define PCI_CHIP_SANDYBRIDGE_GT2 0x0112
  66. #define PCI_CHIP_SANDYBRIDGE_GT2_PLUS 0x0122
  67. #define PCI_CHIP_SANDYBRIDGE_M_GT1 0x0106 /* mobile */
  68. #define PCI_CHIP_SANDYBRIDGE_M_GT2 0x0116
  69. #define PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS 0x0126
  70. #define PCI_CHIP_SANDYBRIDGE_S 0x010A /* server */
  71. #define PCI_CHIP_IVYBRIDGE_GT1 0x0152 /* desktop */
  72. #define PCI_CHIP_IVYBRIDGE_GT2 0x0162
  73. #define PCI_CHIP_IVYBRIDGE_M_GT1 0x0156 /* mobile */
  74. #define PCI_CHIP_IVYBRIDGE_M_GT2 0x0166
  75. #define PCI_CHIP_IVYBRIDGE_S 0x015a /* server */
  76. #define PCI_CHIP_IVYBRIDGE_S_GT2 0x016a /* server */
  77. #define PCI_CHIP_HASWELL_GT1 0x0402 /* Desktop */
  78. #define PCI_CHIP_HASWELL_GT2 0x0412
  79. #define PCI_CHIP_HASWELL_GT3 0x0422
  80. #define PCI_CHIP_HASWELL_M_GT1 0x0406 /* Mobile */
  81. #define PCI_CHIP_HASWELL_M_GT2 0x0416
  82. #define PCI_CHIP_HASWELL_M_GT3 0x0426
  83. #define PCI_CHIP_HASWELL_S_GT1 0x040A /* Server */
  84. #define PCI_CHIP_HASWELL_S_GT2 0x041A
  85. #define PCI_CHIP_HASWELL_S_GT3 0x042A
  86. #define PCI_CHIP_HASWELL_B_GT1 0x040B /* Reserved */
  87. #define PCI_CHIP_HASWELL_B_GT2 0x041B
  88. #define PCI_CHIP_HASWELL_B_GT3 0x042B
  89. #define PCI_CHIP_HASWELL_E_GT1 0x040E /* Reserved */
  90. #define PCI_CHIP_HASWELL_E_GT2 0x041E
  91. #define PCI_CHIP_HASWELL_E_GT3 0x042E
  92. #define PCI_CHIP_HASWELL_SDV_GT1 0x0C02 /* Desktop */
  93. #define PCI_CHIP_HASWELL_SDV_GT2 0x0C12
  94. #define PCI_CHIP_HASWELL_SDV_GT3 0x0C22
  95. #define PCI_CHIP_HASWELL_SDV_M_GT1 0x0C06 /* Mobile */
  96. #define PCI_CHIP_HASWELL_SDV_M_GT2 0x0C16
  97. #define PCI_CHIP_HASWELL_SDV_M_GT3 0x0C26
  98. #define PCI_CHIP_HASWELL_SDV_S_GT1 0x0C0A /* Server */
  99. #define PCI_CHIP_HASWELL_SDV_S_GT2 0x0C1A
  100. #define PCI_CHIP_HASWELL_SDV_S_GT3 0x0C2A
  101. #define PCI_CHIP_HASWELL_SDV_B_GT1 0x0C0B /* Reserved */
  102. #define PCI_CHIP_HASWELL_SDV_B_GT2 0x0C1B
  103. #define PCI_CHIP_HASWELL_SDV_B_GT3 0x0C2B
  104. #define PCI_CHIP_HASWELL_SDV_E_GT1 0x0C0E /* Reserved */
  105. #define PCI_CHIP_HASWELL_SDV_E_GT2 0x0C1E
  106. #define PCI_CHIP_HASWELL_SDV_E_GT3 0x0C2E
  107. #define PCI_CHIP_HASWELL_ULT_GT1 0x0A02 /* Desktop */
  108. #define PCI_CHIP_HASWELL_ULT_GT2 0x0A12
  109. #define PCI_CHIP_HASWELL_ULT_GT3 0x0A22
  110. #define PCI_CHIP_HASWELL_ULT_M_GT1 0x0A06 /* Mobile */
  111. #define PCI_CHIP_HASWELL_ULT_M_GT2 0x0A16
  112. #define PCI_CHIP_HASWELL_ULT_M_GT3 0x0A26
  113. #define PCI_CHIP_HASWELL_ULT_S_GT1 0x0A0A /* Server */
  114. #define PCI_CHIP_HASWELL_ULT_S_GT2 0x0A1A
  115. #define PCI_CHIP_HASWELL_ULT_S_GT3 0x0A2A
  116. #define PCI_CHIP_HASWELL_ULT_B_GT1 0x0A0B /* Reserved */
  117. #define PCI_CHIP_HASWELL_ULT_B_GT2 0x0A1B
  118. #define PCI_CHIP_HASWELL_ULT_B_GT3 0x0A2B
  119. #define PCI_CHIP_HASWELL_ULT_E_GT1 0x0A0E /* Reserved */
  120. #define PCI_CHIP_HASWELL_ULT_E_GT2 0x0A1E
  121. #define PCI_CHIP_HASWELL_ULT_E_GT3 0x0A2E
  122. #define PCI_CHIP_HASWELL_CRW_GT1 0x0D02 /* Desktop */
  123. #define PCI_CHIP_HASWELL_CRW_GT2 0x0D12
  124. #define PCI_CHIP_HASWELL_CRW_GT3 0x0D22
  125. #define PCI_CHIP_HASWELL_CRW_M_GT1 0x0D06 /* Mobile */
  126. #define PCI_CHIP_HASWELL_CRW_M_GT2 0x0D16
  127. #define PCI_CHIP_HASWELL_CRW_M_GT3 0x0D26
  128. #define PCI_CHIP_HASWELL_CRW_S_GT1 0x0D0A /* Server */
  129. #define PCI_CHIP_HASWELL_CRW_S_GT2 0x0D1A
  130. #define PCI_CHIP_HASWELL_CRW_S_GT3 0x0D2A
  131. #define PCI_CHIP_HASWELL_CRW_B_GT1 0x0D0B /* Reserved */
  132. #define PCI_CHIP_HASWELL_CRW_B_GT2 0x0D1B
  133. #define PCI_CHIP_HASWELL_CRW_B_GT3 0x0D2B
  134. #define PCI_CHIP_HASWELL_CRW_E_GT1 0x0D0E /* Reserved */
  135. #define PCI_CHIP_HASWELL_CRW_E_GT2 0x0D1E
  136. #define PCI_CHIP_HASWELL_CRW_E_GT3 0x0D2E
  137. #define BDW_SPARE 0x2
  138. #define BDW_ULT 0x6
  139. #define BDW_SERVER 0xa
  140. #define BDW_IRIS 0xb
  141. #define BDW_WORKSTATION 0xd
  142. #define BDW_ULX 0xe
  143. #define PCI_CHIP_VALLEYVIEW_PO 0x0f30 /* VLV PO board */
  144. #define PCI_CHIP_VALLEYVIEW_1 0x0f31
  145. #define PCI_CHIP_VALLEYVIEW_2 0x0f32
  146. #define PCI_CHIP_VALLEYVIEW_3 0x0f33
  147. #define PCI_CHIP_CHERRYVIEW_0 0x22b0
  148. #define PCI_CHIP_CHERRYVIEW_1 0x22b1
  149. #define PCI_CHIP_CHERRYVIEW_2 0x22b2
  150. #define PCI_CHIP_CHERRYVIEW_3 0x22b3
  151. #define PCI_CHIP_SKYLAKE_DT_GT2 0x1912
  152. #define PCI_CHIP_KABYLAKE_DT_GT2 0x5912
  153. #define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \
  154. (devid) == PCI_CHIP_I915_GM || \
  155. (devid) == PCI_CHIP_I945_GM || \
  156. (devid) == PCI_CHIP_I945_GME || \
  157. (devid) == PCI_CHIP_I965_GM || \
  158. (devid) == PCI_CHIP_I965_GME || \
  159. (devid) == PCI_CHIP_GM45_GM || IS_IGD(devid) || \
  160. (devid) == PCI_CHIP_IVYBRIDGE_M_GT1 || \
  161. (devid) == PCI_CHIP_IVYBRIDGE_M_GT2)
  162. #define IS_G45(devid) ((devid) == PCI_CHIP_IGD_E_G || \
  163. (devid) == PCI_CHIP_Q45_G || \
  164. (devid) == PCI_CHIP_G45_G || \
  165. (devid) == PCI_CHIP_G41_G)
  166. #define IS_GM45(devid) ((devid) == PCI_CHIP_GM45_GM)
  167. #define IS_G4X(devid) (IS_G45(devid) || IS_GM45(devid))
  168. #define IS_ILD(devid) ((devid) == PCI_CHIP_ILD_G)
  169. #define IS_ILM(devid) ((devid) == PCI_CHIP_ILM_G)
  170. #define IS_915(devid) ((devid) == PCI_CHIP_I915_G || \
  171. (devid) == PCI_CHIP_E7221_G || \
  172. (devid) == PCI_CHIP_I915_GM)
  173. #define IS_945GM(devid) ((devid) == PCI_CHIP_I945_GM || \
  174. (devid) == PCI_CHIP_I945_GME)
  175. #define IS_945(devid) ((devid) == PCI_CHIP_I945_G || \
  176. (devid) == PCI_CHIP_I945_GM || \
  177. (devid) == PCI_CHIP_I945_GME || \
  178. IS_G33(devid))
  179. #define IS_G33(devid) ((devid) == PCI_CHIP_G33_G || \
  180. (devid) == PCI_CHIP_Q33_G || \
  181. (devid) == PCI_CHIP_Q35_G || IS_IGD(devid))
  182. #define IS_GEN2(devid) ((devid) == PCI_CHIP_I830_M || \
  183. (devid) == PCI_CHIP_845_G || \
  184. (devid) == PCI_CHIP_I855_GM || \
  185. (devid) == PCI_CHIP_I865_G)
  186. #define IS_GEN3(devid) (IS_945(devid) || IS_915(devid))
  187. #define IS_GEN4(devid) ((devid) == PCI_CHIP_I965_G || \
  188. (devid) == PCI_CHIP_I965_Q || \
  189. (devid) == PCI_CHIP_I965_G_1 || \
  190. (devid) == PCI_CHIP_I965_GM || \
  191. (devid) == PCI_CHIP_I965_GME || \
  192. (devid) == PCI_CHIP_I946_GZ || \
  193. IS_G4X(devid))
  194. #define IS_GEN5(devid) (IS_ILD(devid) || IS_ILM(devid))
  195. #define IS_GEN6(devid) ((devid) == PCI_CHIP_SANDYBRIDGE_GT1 || \
  196. (devid) == PCI_CHIP_SANDYBRIDGE_GT2 || \
  197. (devid) == PCI_CHIP_SANDYBRIDGE_GT2_PLUS || \
  198. (devid) == PCI_CHIP_SANDYBRIDGE_M_GT1 || \
  199. (devid) == PCI_CHIP_SANDYBRIDGE_M_GT2 || \
  200. (devid) == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS || \
  201. (devid) == PCI_CHIP_SANDYBRIDGE_S)
  202. #define IS_GEN7(devid) (IS_IVYBRIDGE(devid) || \
  203. IS_HASWELL(devid) || \
  204. IS_VALLEYVIEW(devid))
  205. #define IS_IVYBRIDGE(devid) ((devid) == PCI_CHIP_IVYBRIDGE_GT1 || \
  206. (devid) == PCI_CHIP_IVYBRIDGE_GT2 || \
  207. (devid) == PCI_CHIP_IVYBRIDGE_M_GT1 || \
  208. (devid) == PCI_CHIP_IVYBRIDGE_M_GT2 || \
  209. (devid) == PCI_CHIP_IVYBRIDGE_S || \
  210. (devid) == PCI_CHIP_IVYBRIDGE_S_GT2)
  211. #define IS_VALLEYVIEW(devid) ((devid) == PCI_CHIP_VALLEYVIEW_PO || \
  212. (devid) == PCI_CHIP_VALLEYVIEW_1 || \
  213. (devid) == PCI_CHIP_VALLEYVIEW_2 || \
  214. (devid) == PCI_CHIP_VALLEYVIEW_3)
  215. #define IS_HSW_GT1(devid) ((devid) == PCI_CHIP_HASWELL_GT1 || \
  216. (devid) == PCI_CHIP_HASWELL_M_GT1 || \
  217. (devid) == PCI_CHIP_HASWELL_S_GT1 || \
  218. (devid) == PCI_CHIP_HASWELL_B_GT1 || \
  219. (devid) == PCI_CHIP_HASWELL_E_GT1 || \
  220. (devid) == PCI_CHIP_HASWELL_SDV_GT1 || \
  221. (devid) == PCI_CHIP_HASWELL_SDV_M_GT1 || \
  222. (devid) == PCI_CHIP_HASWELL_SDV_S_GT1 || \
  223. (devid) == PCI_CHIP_HASWELL_SDV_B_GT1 || \
  224. (devid) == PCI_CHIP_HASWELL_SDV_E_GT1 || \
  225. (devid) == PCI_CHIP_HASWELL_ULT_GT1 || \
  226. (devid) == PCI_CHIP_HASWELL_ULT_M_GT1 || \
  227. (devid) == PCI_CHIP_HASWELL_ULT_S_GT1 || \
  228. (devid) == PCI_CHIP_HASWELL_ULT_B_GT1 || \
  229. (devid) == PCI_CHIP_HASWELL_ULT_E_GT1 || \
  230. (devid) == PCI_CHIP_HASWELL_CRW_GT1 || \
  231. (devid) == PCI_CHIP_HASWELL_CRW_M_GT1 || \
  232. (devid) == PCI_CHIP_HASWELL_CRW_S_GT1 || \
  233. (devid) == PCI_CHIP_HASWELL_CRW_B_GT1 || \
  234. (devid) == PCI_CHIP_HASWELL_CRW_E_GT1)
  235. #define IS_HSW_GT2(devid) ((devid) == PCI_CHIP_HASWELL_GT2 || \
  236. (devid) == PCI_CHIP_HASWELL_M_GT2 || \
  237. (devid) == PCI_CHIP_HASWELL_S_GT2 || \
  238. (devid) == PCI_CHIP_HASWELL_B_GT2 || \
  239. (devid) == PCI_CHIP_HASWELL_E_GT2 || \
  240. (devid) == PCI_CHIP_HASWELL_SDV_GT2 || \
  241. (devid) == PCI_CHIP_HASWELL_SDV_M_GT2 || \
  242. (devid) == PCI_CHIP_HASWELL_SDV_S_GT2 || \
  243. (devid) == PCI_CHIP_HASWELL_SDV_B_GT2 || \
  244. (devid) == PCI_CHIP_HASWELL_SDV_E_GT2 || \
  245. (devid) == PCI_CHIP_HASWELL_ULT_GT2 || \
  246. (devid) == PCI_CHIP_HASWELL_ULT_M_GT2 || \
  247. (devid) == PCI_CHIP_HASWELL_ULT_S_GT2 || \
  248. (devid) == PCI_CHIP_HASWELL_ULT_B_GT2 || \
  249. (devid) == PCI_CHIP_HASWELL_ULT_E_GT2 || \
  250. (devid) == PCI_CHIP_HASWELL_CRW_GT2 || \
  251. (devid) == PCI_CHIP_HASWELL_CRW_M_GT2 || \
  252. (devid) == PCI_CHIP_HASWELL_CRW_S_GT2 || \
  253. (devid) == PCI_CHIP_HASWELL_CRW_B_GT2 || \
  254. (devid) == PCI_CHIP_HASWELL_CRW_E_GT2)
  255. #define IS_HSW_GT3(devid) ((devid) == PCI_CHIP_HASWELL_GT3 || \
  256. (devid) == PCI_CHIP_HASWELL_M_GT3 || \
  257. (devid) == PCI_CHIP_HASWELL_S_GT3 || \
  258. (devid) == PCI_CHIP_HASWELL_B_GT3 || \
  259. (devid) == PCI_CHIP_HASWELL_E_GT3 || \
  260. (devid) == PCI_CHIP_HASWELL_SDV_GT3 || \
  261. (devid) == PCI_CHIP_HASWELL_SDV_M_GT3 || \
  262. (devid) == PCI_CHIP_HASWELL_SDV_S_GT3 || \
  263. (devid) == PCI_CHIP_HASWELL_SDV_B_GT3 || \
  264. (devid) == PCI_CHIP_HASWELL_SDV_E_GT3 || \
  265. (devid) == PCI_CHIP_HASWELL_ULT_GT3 || \
  266. (devid) == PCI_CHIP_HASWELL_ULT_M_GT3 || \
  267. (devid) == PCI_CHIP_HASWELL_ULT_S_GT3 || \
  268. (devid) == PCI_CHIP_HASWELL_ULT_B_GT3 || \
  269. (devid) == PCI_CHIP_HASWELL_ULT_E_GT3 || \
  270. (devid) == PCI_CHIP_HASWELL_CRW_GT3 || \
  271. (devid) == PCI_CHIP_HASWELL_CRW_M_GT3 || \
  272. (devid) == PCI_CHIP_HASWELL_CRW_S_GT3 || \
  273. (devid) == PCI_CHIP_HASWELL_CRW_B_GT3 || \
  274. (devid) == PCI_CHIP_HASWELL_CRW_E_GT3)
  275. #define IS_HASWELL(devid) (IS_HSW_GT1(devid) || \
  276. IS_HSW_GT2(devid) || \
  277. IS_HSW_GT3(devid))
  278. #define IS_BROADWELL(devid) (((devid & 0xff00) != 0x1600) ? 0 : \
  279. (((devid & 0x00f0) >> 4) > 3) ? 0 : \
  280. ((devid & 0x000f) == BDW_SPARE) ? 1 : \
  281. ((devid & 0x000f) == BDW_ULT) ? 1 : \
  282. ((devid & 0x000f) == BDW_IRIS) ? 1 : \
  283. ((devid & 0x000f) == BDW_SERVER) ? 1 : \
  284. ((devid & 0x000f) == BDW_WORKSTATION) ? 1 : \
  285. ((devid & 0x000f) == BDW_ULX) ? 1 : 0)
  286. #define IS_CHERRYVIEW(devid) ((devid) == PCI_CHIP_CHERRYVIEW_0 || \
  287. (devid) == PCI_CHIP_CHERRYVIEW_1 || \
  288. (devid) == PCI_CHIP_CHERRYVIEW_2 || \
  289. (devid) == PCI_CHIP_CHERRYVIEW_3)
  290. #define IS_GEN8(devid) (IS_BROADWELL(devid) || \
  291. IS_CHERRYVIEW(devid))
  292. /* New platforms use kernel pci ids */
  293. #include <stdbool.h>
  294. #include <libdrm_macros.h>
  295. #define IS_9XX(dev) (!IS_GEN2(dev))
  296. #endif /* _INTEL_CHIPSET_H */