ec/google/chromeec: Publish LPC GMR address range via CREC _CRS
[coreboot2.git] / util / inteltool / inteltool.c
blobb7dbd62223f0675b4c2e6b85b6db182e4af3c2eb
1 /* inteltool - dump all registers on an Intel CPU + chipset based system */
2 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include <inttypes.h>
8 #include <getopt.h>
9 #include <fcntl.h>
10 #include <sys/mman.h>
11 #include <unistd.h>
12 #include <errno.h>
13 #include <limits.h>
14 #include "inteltool.h"
15 #include "pcr.h"
17 #ifdef __NetBSD__
18 #include <machine/sysarch.h>
19 #endif
21 #define MAX_PCR_PORTS 8 /* how often may `--pcr` be specified */
23 enum long_only_opts {
24 LONG_OPT_PCR = 0x100,
25 LONG_OPT_RANGE = 0x101,
29 * http://pci-ids.ucw.cz/read/PC/8086
30 * http://en.wikipedia.org/wiki/Intel_Tick-Tock
31 * http://en.wikipedia.org/wiki/List_of_Intel_chipsets
32 * http://en.wikipedia.org/wiki/Intel_Xeon_chipsets
34 static const struct {
35 uint16_t vendor_id, device_id;
36 char *name;
37 } supported_chips_list[] = {
38 /* Host bridges/DRAM controllers (Northbridges) */
39 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX, "443LX" },
40 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX, "443BX" },
41 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_NO_AGP, "443BX without AGP" },
42 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810, "810" },
43 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_DC, "810-DC100" },
44 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_DC, "810E DC-133" },
45 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82830M, "830M" },
46 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845, "845" },
47 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865, "865" },
48 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915, "915G/P/GV/GL/PL/910GL" },
49 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945P, "945P" },
50 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945GM, "945GM" },
51 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945GSE, "945GSE" },
52 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82946, "946GZ/PL" },
53 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82965PM, "965PM" },
54 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q965, "Q963/82Q965" },
55 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82975X, "975X" },
56 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G33, "P35/G33/G31/P31" },
57 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q33, "Q33" },
58 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q35, "Q35" },
59 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82X38, "X38/X48" },
60 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_32X0, "3200/3210" },
61 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82XX4X,
62 "GL40/GS40/GM45/GS45/PM45" },
63 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q45, "Q45/Q43" },
64 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G45, "G45/G43/P45/P43" },
65 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G41, "G41" },
66 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82B43, "B43 (Base)" },
67 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82B43_2, "B43 (Soft)" },
68 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82X58, "X58" },
69 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000P,
70 "Intel i5000P Memory Controller Hub" },
71 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000X,
72 "Intel i5000X Memory Controller Hub" },
73 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000Z,
74 "Intel i5000Z Memory Controller Hub" },
75 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000V,
76 "Intel i5000V Memory Controller Hub" },
77 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_POULSBO, "SCH Poulsbo" },
78 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ATOM_DXXX,
79 "Atom D400/500 Series" },
80 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ATOM_NXXX, "Atom N400 Series" },
81 /* Host bridges /DRAM controllers integrated in CPUs */
82 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_0TH_GEN,
83 "0th generation (Nehalem family) Core Processor" },
84 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_1ST_GEN_D,
85 "1st generation (Westmere family) Core Processor" },
86 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_1ST_GEN_M,
87 "1st generation (Westmere family) Core Processor" },
88 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_1ST_GEN_0048,
89 "1st generation (Westmere family) Core Processor" },
90 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_D,
91 "2nd generation (Sandy Bridge family) Core Processor (Desktop)" },
92 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_M,
93 "2nd generation (Sandy Bridge family) Core Processor (Mobile)" },
94 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_E3,
95 "2nd generation (Sandy Bridge family) Core Processor (Xeon E3)" },
96 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_D,
97 "3rd generation (Ivy Bridge family) Core Processor (Desktop)" },
98 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_M,
99 "3rd generation (Ivy Bridge family) Core Processor (Mobile)" },
100 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_E3,
101 "3rd generation (Ivy Bridge family) Core Processor (Xeon E3 v2)" },
102 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_015c,
103 "3rd generation (Ivy Bridge family) Core Processor" },
104 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_D,
105 "4th generation (Haswell family) Core Processor (Desktop)" },
106 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_M,
107 "4th generation (Haswell family) Core Processor (Mobile)" },
108 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_E3,
109 "4th generation (Haswell family) Core Processor (Xeon E3 v3)" },
110 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_U,
111 "4th generation (Haswell family) Core Processor ULT" },
112 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_U,
113 "5th generation (Broadwell family) Core Processor ULT" },
114 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_D,
115 "5th generation (Broadwell family) Core Processor (Desktop)" },
116 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_M,
117 "5th generation (Broadwell family) Core Processor (Mobile)" },
118 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M,
119 "6th generation (Skylake-H family) Core Processor (Mobile)" },
120 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST,
121 "6th generation (Skylake-S/H family) Core Processor (Workstation)" },
122 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D,
123 "6th generation (Skylake-S family) Core Processor (Desktop)" },
124 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D2,
125 "6th generation (Skylake-S family) Core Processor (Desktop)" },
126 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_E,
127 "6th generation (Skylake family) Core Processor Xeon E (Server)" },
128 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_U,
129 "6th generation (Skylake family) Core Processor (Mobile)" },
130 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_Y,
131 "6th generation (Skylake family) Core Processor (Mobile)" },
132 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL, "Bay Trail" },
133 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U,
134 "7th generation (Kaby Lake family) Core Processor (Mobile)" },
135 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_Y,
136 "7th generation (Kaby Lake family) Core Processor (Mobile)" },
137 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U_Q,
138 "7th generation (Kaby Lake family) Core Processor (Mobile)" },
139 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_E3,
140 "7th generation (Kaby Lake family) Core Processor Xeon E3-1200" },
141 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_1,
142 "8th generation (Coffee Lake family) Core Processor (Mobile)" },
143 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_2,
144 "8th generation (Whiskey Lake family) Core Processor (Mobile)" },
145 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_10TH_GEN_U,
146 "10th generation (Icelake family) Core Processor (Mobile)" },
147 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_CML_U1,
148 "10th generation (Comet Lake family) Core Processor (Mobile)" },
149 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_CML_U2,
150 "10th generation (Comet Lake family) Core Processor (Mobile)" },
151 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_CML_U3,
152 "10th generation (Comet Lake family) Core Processor (Mobile)" },
153 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HEWITTLAKE,
154 "Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D (Hewitt Lake)" },
155 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SAPPHIRERAPIDS_SP,
156 "Xeon Scalable Processor 4th generation (Sapphire Rapids SP)" },
157 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_U_2,
158 "11th generation (Tiger Lake UP3 family) Core Processor (Mobile)" },
159 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_U_4,
160 "11th generation (Tiger Lake UP3 family) Core Processor (Mobile)" },
161 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_Y_2,
162 "11th generation (Tiger Lake UP4 family) Core Processor (Mobile)" },
163 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_Y_4,
164 "11th generation (Tiger Lake UP4 family) Core Processor (Mobile)" },
165 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_H_4,
166 "11th generation (Tiger Lake H family) Core Processor (Mobile)" },
167 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_H_6,
168 "11th generation (Tiger Lake H family) Core Processor (Mobile)" },
169 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_TGL_ID_H_8,
170 "11th generation (Tiger Lake H family) Core Processor (Mobile)" },
171 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_S_8_8,
172 "12th generation (Alder Lake S family) Core Processor (Desktop)" },
173 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_S_8_4,
174 "12th generation (Alder Lake S family) Core Processor (Desktop)" },
175 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_S_6_4,
176 "12th generation (Alder Lake S family) Core Processor (Desktop)" },
177 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_S_8_0,
178 "12th generation (Alder Lake S family) Core Processor (Desktop)" },
179 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_S_6_0,
180 "12th generation (Alder Lake S family) Core Processor (Desktop)" },
181 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_P_6_8,
182 "12th generation (Alder Lake P family) Core Processor"},
183 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_P_4_8,
184 "12th generation (Alder Lake P family) Core Processor"},
185 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_P_2_8,
186 "12th generation (Alder Lake P family) Core Processor"},
187 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_N_0_8,
188 "12th generation (Alder Lake N family) Intel Processor"},
189 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_N_0_4,
190 "12th generation (Alder Lake N family) Intel Processor"},
191 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_ADL_ID_N_0_4_1,
192 "12th generation (Alder Lake N family) Intel Processor"},
193 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_RPL_ID_H_8_6,
194 "13th generation (Raptor Lake H family) Core Processor"},
195 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_M,
196 "14th generation (Meteor Lake M family) Core Processor"},
197 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_P_1,
198 "14th generation (Meteor Lake P family) Core Processor"},
199 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_P_2,
200 "14th generation (Meteor Lake P family) Core Processor"},
201 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_P_3,
202 "14th generation (Meteor Lake P family) Core Processor"},
203 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_P_4,
204 "14th generation (Meteor Lake P family) Core Processor"},
205 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_MTL_ID_P_5,
206 "14th generation (Meteor Lake P family) Core Processor"},
208 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_1,
209 "Elkhart Lake Processor" },
210 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_2,
211 "Elkhart Lake Processor" },
212 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_3,
213 "Elkhart Lake Processor" },
214 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_4,
215 "Elkhart Lake Processor" },
216 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_5,
217 "Elkhart Lake Processor" },
218 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_6,
219 "Elkhart Lake Processor" },
220 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_7,
221 "Elkhart Lake Processor" },
222 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_8,
223 "Elkhart Lake Processor" },
224 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_9,
225 "Elkhart Lake Processor" },
226 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_10,
227 "Elkhart Lake Processor" },
228 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_11,
229 "Elkhart Lake Processor" },
231 /* Southbridges (LPC controllers) */
232 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371XX, "371AB/EB/MB" },
233 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10, "ICH10" },
234 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10D, "ICH10D" },
235 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10DO, "ICH10DO" },
236 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10R, "ICH10R" },
237 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9DH, "ICH9DH" },
238 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9DO, "ICH9DO" },
239 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9R, "ICH9R" },
240 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9, "ICH9" },
241 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9M, "ICH9M" },
242 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9ME, "ICH9M-E" },
243 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8M, "ICH8-M" },
244 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8ME, "ICH8M-E" },
245 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8, "ICH8" },
246 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_NM10, "NM10" },
247 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7MDH, "ICH7-M DH" },
248 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7M, "ICH7-M" },
249 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7, "ICH7" },
250 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7DH, "ICH7DH" },
251 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6, "ICH6" },
252 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH5, "ICH5" },
253 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4M, "ICH4-M" },
254 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4, "ICH4" },
255 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH2, "ICH2" },
256 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH0, "ICH0" },
257 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH, "ICH" },
258 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I63XX, "631xESB/632xESB/3100" },
259 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_POULSBO_LPC, "SCH Poulsbo" },
260 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_DESKTOP, "3400 Desktop" },
261 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_MOBILE, "3400 Mobile" },
262 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_P55, "P55" },
263 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PM55, "PM55" },
264 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H55, "H55" },
265 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM57, "QM57" },
266 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H57, "H57" },
267 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM55, "HM55" },
268 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q57, "Q57" },
269 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM57, "HM57" },
270 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_MOBILE_SFF,
271 "3400 Mobile SFF" },
272 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B55_A, "B55" },
273 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS57, "QS57" },
274 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400, "3400" },
275 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3420, "3420" },
276 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3450, "3450" },
277 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B55_B, "B55" },
278 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z68, "Z68" },
279 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_P67, "P67" },
280 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UM67, "UM67" },
281 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM65, "HM65" },
282 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H67, "H67" },
283 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM67, "HM67" },
284 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q65, "Q65" },
285 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS67, "QS67" },
286 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q67, "Q67" },
287 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM67, "QM67" },
288 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B65, "B65" },
289 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C202, "C202" },
290 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C204, "C204" },
291 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C206, "C206" },
292 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H61, "H61" },
293 { PCI_VENDOR_ID_INTEL, 0x1d40, "X79" },
294 { PCI_VENDOR_ID_INTEL, 0x1d41, "X79" },
295 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z77, "Z77" },
296 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z75, "Z75" },
297 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q77, "Q77" },
298 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q75, "Q75" },
299 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B75, "B75" },
300 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H77, "H77" },
301 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C216, "C216" },
302 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM77, "QM77" },
303 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS77, "QS77" },
304 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM77, "HM77" },
305 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UM77, "UM77" },
306 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM76, "HM76" },
307 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM75, "HM75" },
308 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM70, "HM70" },
309 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_NM70, "NM70" },
310 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICELAKE_LP_U,
311 "Icelake U LPC" },
312 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_FULL,
313 "Lynx Point Low Power Full Featured Engineering Sample" },
314 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_PREM,
315 "Lynx Point Low Power Premium SKU" },
316 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_BASE,
317 "Lynx Point Low Power Base SKU" },
318 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_PREM,
319 "Wildcat Point Low Power Premium SKU" },
320 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP,
321 "Wildcat Point Low Power Base SKU" },
322 { PCI_VENDOR_ID_INTEL, 0x2310, "DH89xxCC" },
323 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC, "Bay Trail" },
324 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_PRE,
325 "Sunrise Point Desktop Engineering Sample" },
326 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_PRE,
327 "Sunrise Point-LP Engineering Sample" },
328 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_BASE_SKL,
329 "Sunrise Point-LP U Base/Skylake" },
330 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_PREM_SKL,
331 "Sunrise Point-LP Y Premium/Skylake" },
332 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_PREM_SKL,
333 "Sunrise Point-LP U Premium/Skylake" },
334 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_BASE_KBL,
335 "Sunrise Point-LP U Base/Kabylake" },
336 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_PREM_KBL,
337 "Sunrise Point-LP Y Premium/Kabylake" },
338 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_PREM_KBL,
339 "Sunrise Point-LP U Premium/Kabylake" },
340 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_IHDCP_BASE,
341 "Sunrise Point-LP U iHDCP 2.2 Base/Kabylake" },
342 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_IHDCP_PREM,
343 "Sunrise Point-LP U iHDCP 2.2 Premium/Kabylake" },
344 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_IHDCP_PREM,
345 "Sunrise Point-LP Y iHDCP 2.2 Premium/Kabylake" },
346 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CANNONPOINT_LP_U_PREM,
347 "Cannon Point-LP U Premium/CoffeeLake/Whiskeylake" },
348 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETPOINT_LP_U_PREM,
349 "Comet Point-LP U Premium/Cometlake" },
350 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETPOINT_LP_U_BASE,
351 "Comet Point-LP U Base/Cometlake" },
352 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERPOINT_U_SUPER,
353 "Tiger Point U Engineering Sample" },
354 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERPOINT_U_PREM,
355 "Tiger Point U Premium/Tigerlake" },
356 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERPOINT_U_BASE,
357 "Tiger Point U Base/Tigerlake" },
358 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERPOINT_Y_SUPER,
359 "Tiger Point Y Engineering Sample" },
360 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERPOINT_Y_PREM,
361 "Tiger Point Y Premium/Tigerlake" },
362 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H110, "H110" },
363 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H170, "H170" },
364 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z170, "Z170" },
365 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q170, "Q170" },
366 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q150, "Q150" },
367 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B150, "B150" },
368 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C236, "C236" },
369 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C232, "C232" },
370 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM170, "QM170" },
371 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM170, "HM170" },
372 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM236, "CM236" },
373 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM175, "HM175" },
374 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM175, "QM175" },
375 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM238, "CM238" },
376 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C621, "C621" },
377 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C621A, "C621A" },
378 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C622, "C622" },
379 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C624, "C624" },
380 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C625, "C625" },
381 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C626, "C626" },
382 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627, "C627" },
383 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C628, "C628" },
384 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C629, "C629" },
385 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C624_SUPER, "C624 Super SKU" },
386 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627_SUPER_1, "C627 Super SKU" },
387 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C621_SUPER, "C621 Super SKU" },
388 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627_SUPER_2, "C627 Super SKU" },
389 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C628_SUPER, "C628 Super SKU" },
390 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EBG, "Emmits Burg" },
391 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H270, "H270" },
392 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z270, "Z270" },
393 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q270, "Q270" },
394 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q250, "Q250" },
395 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B250, "B250" },
396 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z370, "Z370" },
397 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H310C, "H310C" },
398 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X299, "X299" },
399 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H310, "H310" },
400 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H370, "H370" },
401 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z390, "Z390" },
402 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q370, "Q370" },
403 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B360, "B360" },
404 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C246, "C246" },
405 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C242, "C242" },
406 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM370, "QM370" },
407 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM370, "HM370" },
408 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM246, "CM246" },
409 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C8_MOBILE, "C8 Mobile"},
410 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C8_DESKTOP, "C8 Desktop"},
411 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z87, "Z87"},
412 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z85, "Z85"},
413 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM86, "HM86"},
414 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H87, "H87"},
415 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM87, "HM87"},
416 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q85, "Q85"},
417 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q87, "Q87"},
418 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM87, "QM87"},
419 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B85, "B85"},
420 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C222, "C222"},
421 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C224, "C224"},
422 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C226, "C226"},
423 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H81, "H81"},
424 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C9_MOBILE, "C9 Mobile"},
425 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C9_DESKTOP, "C9 Desktop"},
426 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM97, "HM97"},
427 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z97, "Z97"},
428 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H97, "H97"},
429 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL_LPC, "Apollo Lake" },
430 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_LPC, "Denverton" },
431 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK_LPC, "Gemini Lake" },
432 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H510, "H510" },
433 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H570, "H570" },
434 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z590, "Z590" },
435 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q570, "Q570" },
436 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B560, "B560" },
437 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_W580, "W580" },
438 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C256, "C256" },
439 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C252, "C252" },
440 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM570, "HM570" },
441 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM580, "QM580" },
442 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WM590, "WM590" },
443 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H610E, "H610E" },
444 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q670E, "Q670E" },
445 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_R680E, "R680E" },
446 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H610, "H610" },
447 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B660, "B660" },
448 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H670, "H670" },
449 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q670, "Q670" },
450 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z690, "Z690" },
451 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_W680, "W680" },
452 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WM690, "WM690" },
453 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM670, "HM670" },
454 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_W790, "W790" },
455 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z790, "Z790" },
456 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H770, "H770" },
457 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B760, "B760" },
458 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM770, "HM770" },
459 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WM790, "WM790" },
460 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C262, "C262" },
461 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C266, "C266" },
462 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL, "Elkhart Lake" },
463 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_JSL, "Jasper Lake" },
464 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_N, "Alder Lake-N"},
465 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_RPL_P, "Raptor Lake" },
467 /* Intel GPUs */
468 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G35_EXPRESS,
469 "Intel(R) G35 Express Chipset Family" },
470 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G35_EXPRESS_1,
471 "Intel(R) G35 Express Chipset Family" },
472 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS,
473 "Mobile Intel(R) 965 Express Chipset Family" },
474 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_1,
475 "Mobile Intel(R) 965 Express Chipset Family" },
476 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_2,
477 "Mobile Intel(R) 965 Express Chipset Family" },
478 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_3,
479 "Mobile Intel(R) 965 Express Chipset Family" },
480 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_4_SERIES,
481 "Mobile Intel(R) 4 Series Express Chipset Family" },
482 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_4_SERIES_1,
483 "Mobile Intel(R) 4 Series Express Chipset Family" },
484 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G45,
485 "Intel(R) G45/G43 Express Chipset Family" },
486 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G45_1,
487 "Intel(R) G45/G43 Express Chipset Family" },
488 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q45,
489 "Intel(R) Q45/Q43 Express Chipset Family" },
490 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q45_1,
491 "Intel(R) Q45/Q43 Express Chipset Family" },
492 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G41,
493 "Intel(R) G41 Express Chipset Family" },
494 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G41_1,
495 "Intel(R) G41 Express Chipset Family" },
496 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43,
497 "Intel(R) B43 Express Chipset Family" },
498 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_1,
499 "Intel(R) B43 Express Chipset Family" },
500 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_2,
501 "Intel(R) B43 Express Chipset Family" },
502 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_3,
503 "Intel(R) B43 Express Chipset Family" },
504 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS,
505 "Intel(R) HD Graphics" },
506 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS_1,
507 "Intel(R) HD Graphics" },
508 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS_2,
509 "Intel(R) HD Graphics" },
510 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2000,
511 "Intel(R) HD 2000 Graphics" },
512 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2000_1,
513 "Intel(R) HD 2000 Graphics" },
514 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000,
515 "Intel(R) HD 3000 Graphics" },
516 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_1,
517 "Intel(R) HD 3000 Graphics" },
518 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_2,
519 "Intel(R) HD 3000 Graphics" },
520 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_3,
521 "Intel(R) HD 3000 Graphics" },
522 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_4,
523 "Intel(R) HD 3000 Graphics" },
524 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_5,
525 "Intel(R) HD 3000 Graphics" },
526 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500,
527 "Intel(R) HD 2500 Graphics" },
528 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500_1,
529 "Intel(R) HD 2500 Graphics" },
530 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500_2,
531 "Intel(R) HD 2500 Graphics" },
532 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000,
533 "Intel(R) HD 4000 Graphics" },
534 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000_1,
535 "Intel(R) HD 4000 Graphics" },
536 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000_2,
537 "Intel(R) HD 4000 Graphics" },
538 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4400,
539 "Intel(R) HD 4400 Graphics" },
540 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4400_1,
541 "Intel(R) HD 4400 Graphics" },
542 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4600,
543 "Intel(R) HD 4600 Graphics" },
544 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4600_1,
545 "Intel(R) HD 4600 Graphics" },
546 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000,
547 "Intel(R) HD 5000 Graphics" },
548 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000_1,
549 "Intel(R) HD 5000 Graphics" },
550 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000_2,
551 "Intel(R) HD 5000 Graphics" },
552 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_510,
553 "Intel(R) HD Graphics 510" },
554 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_515,
555 "Intel(R) HD Graphics 515" },
556 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_520,
557 "Intel(R) HD Graphics 520" },
558 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_530_1,
559 "Intel(R) HD Graphics 530" },
560 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_530_2,
561 "Intel(R) HD Graphics 530" },
562 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_615_1,
563 "Intel(R) UHD Graphics 615" },
564 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_615_2,
565 "Intel(R) UHD Graphics 615" },
566 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_617,
567 "Intel(R) UHD Graphics 617" },
568 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_1,
569 "Intel(R) UHD Graphics 620" },
570 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_2,
571 "Intel(R) UHD Graphics 620" },
572 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_3,
573 "Intel(R) UHD Graphics 620" },
574 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_1,
575 "Intel(R) UHD Graphics 630" },
576 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_2,
577 "Intel(R) UHD Graphics 630" },
578 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_3,
579 "Intel(R) UHD Graphics 630" },
580 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_4,
581 "Intel(R) UHD Graphics 630" },
582 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_5,
583 "Intel(R) UHD Graphics 630" },
584 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_6,
585 "Intel(R) UHD Graphics 630" },
586 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_7,
587 "Intel(R) UHD Graphics 630" },
588 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_640,
589 "Intel(R) UHD Graphics 640" },
590 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_540,
591 "Intel(R) Iris Graphics 540" },
592 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_550,
593 "Intel(R) Iris Graphics 550" },
594 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PRO_580,
595 "Intel(R) Iris Pro Graphics 580" },
596 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_650,
597 "Intel(R) Iris Plus Graphics 650" },
598 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_655,
599 "Intel(R) Iris Plus Graphics 655" },
600 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_G7,
601 "Intel(R) Iris Plus Graphics G7" },
602 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT2_UY,
603 "Intel(R) Iris Xe Graphics" },
604 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT2_Y,
605 "Intel(R) Iris Xe Graphics" },
606 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT1,
607 "Intel(R) UHD Graphics for 11th Gen Intel(R) Processors" },
608 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT1_2,
609 "Intel(R) UHD Graphics for 11th Gen Intel(R) Processors" },
610 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT2_ULT_1,
611 "Intel(R) UHD Graphics for 11th Gen Intel(R) Processors" },
612 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGL_GT2_ULT_2,
613 "Intel(R) UHD Graphics for 11th Gen Intel(R) Processors" },
614 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_S_GT1,
615 "Intel(R) AlderLake-S GT1" },
616 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_S_GT1_2,
617 "Intel(R) AlderLake-S GT1" },
618 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_S_GT1_3,
619 "Intel(R) AlderLake-S GT1" },
620 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_S_GT1_4,
621 "Intel(R) AlderLake-S GT1" },
622 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_N_UHD,
623 "Intel(R) UHD Graphics" },
624 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_N_UHD_2,
625 "Intel(R) UHD Graphics" },
626 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ADL_N_UHD_3,
627 "Intel(R) UHD Graphics" },
628 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_RPL_H_IRIS_XE,
629 "Intel(R) Iris Xe Graphics [RPL-P]" },
630 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MTL_M_GT2,
631 "Intel(R) MeteorLake-M GT2" },
632 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MTL_P_GT2_1,
633 "Intel(R) MeteorLake-P GT2" },
634 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MTL_P_GT2_2,
635 "Intel(R) MeteorLake-P GT2" },
636 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MTL_P_GT2_3,
637 "Intel(R) MeteorLake-P GT2" },
638 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MTL_P_GT2_4,
639 "Intel(R) MeteorLake-P GT2" },
640 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_1,
641 "Intel(R) Elkhart Lake GT1" },
642 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_2,
643 "Intel(R) Elkhart Lake GT1" },
644 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_3,
645 "Intel(R) Elkhart Lake GT1" },
646 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_4,
647 "Intel(R) Elkhart Lake GT1" },
648 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_5,
649 "Intel(R) Elkhart Lake GT1" },
650 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EHL_GT1_6,
651 "Intel(R) Elkhart Lake GT1" },
654 #ifndef __DARWIN__
655 static int fd_mem;
657 void *map_physical(uint64_t phys_addr, size_t len)
659 void *virt_addr;
661 virt_addr = mmap(0, len, PROT_WRITE | PROT_READ, MAP_SHARED,
662 fd_mem, (off_t) phys_addr);
664 if (virt_addr == MAP_FAILED) {
665 printf("Error mapping physical memory 0x%08" PRIx64 "[0x%zx]\n",
666 phys_addr, len);
667 return NULL;
670 return virt_addr;
673 void unmap_physical(void *virt_addr, size_t len)
675 munmap(virt_addr, len);
677 #endif
679 static void print_version(void)
681 printf("inteltool v%s -- ", INTELTOOL_VERSION);
682 printf("Copyright (C) 2008 coresystems GmbH\n\n");
683 printf(
684 "This program is free software: you can redistribute it and/or modify\n"
685 "it under the terms of the GNU General Public License as published by\n"
686 "the Free Software Foundation, version 2 of the License.\n\n"
687 "This program is distributed in the hope that it will be useful,\n"
688 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
689 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
690 "GNU General Public License for more details.\n\n");
693 static void print_usage(const char *name)
695 printf("usage: %s [-vh?gGrplmedPMaAsfSRx]\n", name);
696 printf("\n"
697 " -v | --version: print the version\n"
698 " -h | --help: print this help\n\n"
699 " -s | --spi: dump southbridge spi and bios_cntrl registers\n"
700 " -f | --gfx: dump graphics registers (UNSAFE: may hang system!)\n"
701 " -R | --ahci: dump AHCI registers\n"
702 " -g | --gpio: dump southbridge GPIO registers\n"
703 " -G | --gpio-diffs: show GPIO differences from defaults\n"
704 " -r | --rcba: dump southbridge RCBA registers\n"
705 " -p | --pmbase: dump southbridge Power Management registers\n\n"
706 " -l | --lpc: dump southbridge LPC/eSPI Interface registers\n\n"
707 " -m | --mchbar: dump northbridge Memory Controller registers\n"
708 " -S FILE | --spd=FILE: create a file storing current timings (implies -m)\n"
709 " -e | --epbar: dump northbridge EPBAR registers\n"
710 " -d | --dmibar: dump northbridge DMIBAR registers\n"
711 " -P | --pciexpress: dump northbridge PCIEXBAR registers\n\n"
712 " -M | --msrs: dump CPU MSRs\n"
713 " --cpu-range <start>[-<end>]: (optional) set CPU cores range for -M (--msrs) option\n"
714 " -A | --ambs: dump AMB registers\n"
715 " -x | --sgx: dump SGX status\n"
716 " -t | --tme: dump TME status\n"
717 " -k | --keylocker: dump Key Locker status\n"
718 " -a | --all: dump all known (safe) registers\n"
719 " --pcr=PORT_ID: dump all registers of a PCR port\n"
720 " (may be specified max %d times)\n"
721 "\n", MAX_PCR_PORTS);
722 exit(1);
725 static void print_system_info(struct pci_dev *nb, struct pci_dev *sb, struct pci_dev *gfx)
727 unsigned int id, i;
728 char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown";
730 id = cpuid(1);
732 /* Determine names */
733 for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) {
734 if (nb->device_id == supported_chips_list[i].device_id)
735 nbname = supported_chips_list[i].name;
737 for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) {
738 if (sb->device_id == supported_chips_list[i].device_id)
739 sbname = supported_chips_list[i].name;
741 if (gfx) {
742 for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++)
743 if (gfx->device_id == supported_chips_list[i].device_id)
744 gfxname = supported_chips_list[i].name;
747 /* Intel has suggested applications to display the family of a CPU as
748 * the sum of the "Family" and the "Extended Family" fields shown
749 * above, and the model as the sum of the "Model" and the 4-bit
750 * left-shifted "Extended Model" fields.
751 * http://download.intel.com/design/processor/applnots/24161832.pdf
753 printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n",
754 id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff),
755 ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf));
757 printf("Northbridge: %04x:%04x (%s)\n",
758 nb->vendor_id, nb->device_id, nbname);
760 printf("Southbridge: %04x:%04x (%s)\n",
761 sb->vendor_id, sb->device_id, sbname);
763 if (gfx)
764 printf("IGD: %04x:%04x (%s)\n",
765 gfx->vendor_id, gfx->device_id, gfxname);
768 int main(int argc, char *argv[])
770 struct pci_access *pacc;
771 struct pci_dev *sb = NULL, *nb, *gfx = NULL, *ahci = NULL, *dev;
772 const char *dump_spd_file = NULL;
773 int opt, option_index = 0;
775 int dump_gpios = 0, dump_mchbar = 0, dump_rcba = 0;
776 int dump_pmbase = 0, dump_epbar = 0, dump_dmibar = 0;
777 int dump_pciexbar = 0, dump_coremsrs = 0, dump_ambs = 0;
778 int dump_spi = 0, dump_gfx = 0, dump_ahci = 0, dump_sgx = 0, dump_tme = 0;
779 int dump_lpc = 0, dump_keylocker = 0;
780 int show_gpio_diffs = 0;
781 size_t pcr_count = 0;
782 uint8_t dump_pcr[MAX_PCR_PORTS];
784 unsigned int cores_range_start = 0, cores_range_end = UINT_MAX;
786 static struct option long_options[] = {
787 {"version", 0, 0, 'v'},
788 {"help", 0, 0, 'h'},
789 {"gpios", 0, 0, 'g'},
790 {"gpio-diffs", 0, 0, 'G'},
791 {"mchbar", 0, 0, 'm'},
792 {"rcba", 0, 0, 'r'},
793 {"pmbase", 0, 0, 'p'},
794 {"lpc", 0, 0, 'l'},
795 {"epbar", 0, 0, 'e'},
796 {"dmibar", 0, 0, 'd'},
797 {"pciexpress", 0, 0, 'P'},
798 {"msrs", 0, 0, 'M'},
799 {"cpu-range", required_argument, 0, LONG_OPT_RANGE},
800 {"ambs", 0, 0, 'A'},
801 {"spi", 0, 0, 's'},
802 {"spd", 0, 0, 'S'},
803 {"all", 0, 0, 'a'},
804 {"gfx", 0, 0, 'f'},
805 {"ahci", 0, 0, 'R'},
806 {"sgx", 0, 0, 'x'},
807 {"pcr", required_argument, 0, LONG_OPT_PCR},
808 {"tme", 0, 0, 't'},
809 {"keylocker", 0, 0, 'k'},
810 {0, 0, 0, 0}
813 while ((opt = getopt_long(argc, argv, "vh?gGrplmedPMaAsfRS:xtk",
814 long_options, &option_index)) != EOF) {
815 switch (opt) {
816 case 'v':
817 print_version();
818 exit(0);
819 break;
820 case 'S':
821 dump_spd_file = optarg;
822 dump_mchbar = 1;
823 break;
824 case 'g':
825 dump_gpios = 1;
826 break;
827 case 'f':
828 dump_gfx = 1;
829 break;
830 case 'R':
831 dump_ahci = 1;
832 break;
833 case 'G':
834 show_gpio_diffs = 1;
835 break;
836 case 'm':
837 dump_mchbar = 1;
838 break;
839 case 'r':
840 dump_rcba = 1;
841 break;
842 case 'p':
843 dump_pmbase = 1;
844 break;
845 case 'l':
846 dump_lpc = 1;
847 break;
848 case 'e':
849 dump_epbar = 1;
850 break;
851 case 'd':
852 dump_dmibar = 1;
853 break;
854 case 'P':
855 dump_pciexbar = 1;
856 break;
857 case 'M':
858 dump_coremsrs = 1;
859 break;
860 case LONG_OPT_RANGE:
861 if (strlen(optarg) == 0) {
862 print_usage(argv[0]);
863 exit(1);
865 const int sscanf_ret = sscanf(optarg, "%u-%u", &cores_range_start, &cores_range_end);
866 if (sscanf_ret == 1) {
867 /* the end of the range is not specified - only for one core */
868 cores_range_end = cores_range_start;
869 } else if (sscanf_ret != 2) {
870 print_usage(argv[0]);
871 exit(1);
872 } else if (cores_range_end < cores_range_start) {
873 printf("Error: invalid cores range <%u-%u>!\n",
874 cores_range_start, cores_range_end);
875 exit(1);
877 break;
878 case 'a':
879 dump_gpios = 1;
880 show_gpio_diffs = 1;
881 dump_mchbar = 1;
882 dump_rcba = 1;
883 dump_pmbase = 1;
884 dump_lpc = 1;
885 dump_epbar = 1;
886 dump_dmibar = 1;
887 dump_pciexbar = 1;
888 dump_coremsrs = 1;
889 dump_ambs = 1;
890 dump_spi = 1;
891 dump_ahci = 1;
892 dump_sgx = 1;
893 dump_tme = 1;
894 dump_keylocker = 1;
895 break;
896 case 'A':
897 dump_ambs = 1;
898 break;
899 case 's':
900 dump_spi = 1;
901 break;
902 case 'x':
903 dump_sgx = 1;
904 break;
905 case 't':
906 dump_tme = 1;
907 break;
908 case 'k':
909 dump_keylocker = 1;
910 break;
911 case LONG_OPT_PCR:
912 if (pcr_count < MAX_PCR_PORTS) {
913 errno = 0;
914 const unsigned long int pcr =
915 strtoul(optarg, NULL, 0);
916 if (strlen(optarg) == 0 || errno) {
917 print_usage(argv[0]);
918 exit(1);
920 dump_pcr[pcr_count++] = (uint8_t)pcr;
921 } else {
922 print_usage(argv[0]);
923 exit(1);
925 break;
926 case 'h':
927 case '?':
928 default:
929 print_usage(argv[0]);
930 exit(0);
931 break;
935 #if defined(__FreeBSD__)
936 if (open("/dev/io", O_RDWR) < 0) {
937 perror("/dev/io");
938 #elif defined(__NetBSD__)
939 # ifdef __i386__
940 if (i386_iopl(3)) {
941 perror("iopl");
942 # else
943 if (x86_64_iopl(3)) {
944 perror("iopl");
945 # endif
946 #else
947 if (iopl(3)) {
948 perror("iopl");
949 #endif
950 printf("You need to be root.\n");
951 exit(1);
954 #ifndef __DARWIN__
955 if ((fd_mem = open("/dev/mem", O_RDWR)) < 0) {
956 perror("Can not open /dev/mem");
957 exit(1);
959 #endif
961 pacc = pci_alloc();
962 pacc->method = PCI_ACCESS_I386_TYPE1;
963 pci_init(pacc);
964 pci_scan_bus(pacc);
966 /* Find the required devices */
967 for (dev = pacc->devices; dev; dev = dev->next) {
968 pci_fill_info(dev, PCI_FILL_CLASS);
969 /* The ISA/LPC bridge can be 0x1f, 0x07, or 0x04 so we probe. */
970 if (dev->device_class == 0x0601) { /* ISA/LPC bridge */
971 if (sb == NULL) {
972 sb = dev;
973 } else {
974 fprintf(stderr, "Multiple devices with class ID"
975 " 0x0601, using %02x%02x:%02x.%02x\n",
976 sb->domain, sb->bus, sb->dev, sb->func);
977 break;
982 if (!sb) {
983 printf("No southbridge found.\n");
984 exit(1);
987 pci_fill_info(sb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS);
989 if (sb->vendor_id != PCI_VENDOR_ID_INTEL) {
990 printf("Not an Intel(R) southbridge.\n");
991 exit(1);
994 nb = pci_get_dev(pacc, 0, 0, 0x00, 0);
995 if (!nb) {
996 printf("No northbridge found.\n");
997 exit(1);
1000 pci_fill_info(nb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS);
1002 if (nb->vendor_id != PCI_VENDOR_ID_INTEL) {
1003 printf("Not an Intel(R) northbridge.\n");
1004 exit(1);
1007 gfx = pci_get_dev(pacc, 0, 0, 0x02, 0);
1008 if (gfx) {
1009 pci_fill_info(gfx, PCI_FILL_IDENT | PCI_FILL_BASES |
1010 PCI_FILL_CLASS);
1011 if ((gfx->device_class & 0xff00) != 0x0300)
1012 gfx = NULL;
1013 else if (gfx->vendor_id != PCI_VENDOR_ID_INTEL)
1014 gfx = NULL;
1017 if (sb->device_id == PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC) {
1018 ahci = pci_get_dev(pacc, 0, 0, 0x13, 0);
1019 } else {
1020 ahci = pci_get_dev(pacc, 0, 0, 0x1f, 2);
1021 if (ahci) {
1022 pci_fill_info(ahci, PCI_FILL_CLASS);
1023 if (ahci->device_class != PCI_CLASS_STORAGE_SATA)
1024 ahci = pci_get_dev(pacc, 0, 0, 0x17, 0);
1028 if (ahci) {
1029 pci_fill_info(ahci, PCI_FILL_IDENT | PCI_FILL_BASES |
1030 PCI_FILL_CLASS);
1032 if (ahci->vendor_id != PCI_VENDOR_ID_INTEL ||
1033 ahci->device_class != PCI_CLASS_STORAGE_SATA)
1034 ahci = NULL;
1037 print_system_info(nb, sb, gfx);
1039 /* Now do the deed */
1040 if (dump_gpios) {
1041 print_gpios(sb, 1, show_gpio_diffs);
1042 printf("\n\n");
1043 } else if (show_gpio_diffs) {
1044 print_gpios(sb, 0, show_gpio_diffs);
1045 printf("\n\n");
1048 if (dump_rcba) {
1049 print_rcba(sb);
1050 printf("\n\n");
1053 if (dump_pmbase) {
1054 print_pmbase(sb, pacc);
1055 printf("\n\n");
1058 if (dump_lpc) {
1059 print_lpc(sb, pacc);
1060 printf("\n\n");
1063 if (dump_mchbar) {
1064 print_mchbar(nb, pacc, dump_spd_file);
1065 printf("\n\n");
1068 if (dump_epbar) {
1069 print_epbar(nb);
1070 printf("\n\n");
1073 if (dump_dmibar) {
1074 print_dmibar(nb);
1075 printf("\n\n");
1078 if (dump_pciexbar) {
1079 print_pciexbar(nb);
1080 printf("\n\n");
1083 if (dump_coremsrs) {
1084 print_intel_msrs(cores_range_start, cores_range_end);
1085 printf("\n\n");
1088 if (dump_ambs)
1089 print_ambs(nb, pacc);
1091 if (dump_spi)
1092 print_spi(sb, pacc);
1094 if (dump_gfx)
1095 print_gfx(gfx);
1097 if (dump_ahci)
1098 print_ahci(ahci);
1100 if (dump_sgx)
1101 print_sgx();
1103 if (dump_tme)
1104 print_tme();
1106 if (dump_keylocker)
1107 print_keylocker();
1109 if (pcr_count)
1110 print_pcr_ports(sb, dump_pcr, pcr_count);
1112 /* Clean up */
1113 pcr_cleanup();
1114 if (ahci)
1115 pci_free_dev(ahci);
1116 if (gfx)
1117 pci_free_dev(gfx);
1118 pci_free_dev(nb);
1119 /* `sb` wasn't allocated by pci_get_dev() */
1120 pci_cleanup(pacc);
1122 return 0;