Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * inteltool - dump all registers on an Intel CPU + chipset based system. |
| 3 | * |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 4 | * Copyright (C) 2008-2010 by coresystems GmbH |
| 5 | * written by Stefan Reinauer <stepan@coresystems.de> |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 6 | * Copyright (C) 2009 Carl-Daniel Hailfinger |
Nico Huber | da94e17 | 2017-03-30 17:47:24 +0200 | [diff] [blame] | 7 | * Copyright (C) 2017 secunet Security Networks AG |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 8 | * |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; version 2 of the License. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 19 | #include <stdio.h> |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 20 | #include <stdlib.h> |
Nico Huber | d91c932 | 2017-10-03 15:45:45 +0200 | [diff] [blame] | 21 | #include <string.h> |
Stefan Reinauer | a7b296d | 2011-11-14 12:40:34 -0800 | [diff] [blame] | 22 | #include <inttypes.h> |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 23 | #include <getopt.h> |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 24 | #include <fcntl.h> |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 25 | #include <sys/mman.h> |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 26 | #include <unistd.h> |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 27 | #include <errno.h> |
Stefan Tauner | 0c8b7d1 | 2013-04-05 20:38:08 +0200 | [diff] [blame] | 28 | #include "inteltool.h" |
Nico Huber | 99b02a1 | 2017-04-05 17:39:57 +0200 | [diff] [blame] | 29 | #include "pcr.h" |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 30 | |
Andrey Korolyov | 046d217 | 2016-01-05 19:59:06 +0300 | [diff] [blame] | 31 | #ifdef __NetBSD__ |
| 32 | #include <machine/sysarch.h> |
| 33 | #endif |
| 34 | |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 35 | #define MAX_PCR_PORTS 8 /* how often may `--pcr` be specified */ |
| 36 | |
| 37 | enum long_only_opts { |
| 38 | LONG_OPT_PCR = 0x100, |
| 39 | }; |
| 40 | |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 41 | /* |
| 42 | * http://pci-ids.ucw.cz/read/PC/8086 |
| 43 | * http://en.wikipedia.org/wiki/Intel_Tick-Tock |
| 44 | * http://en.wikipedia.org/wiki/List_of_Intel_chipsets |
| 45 | * http://en.wikipedia.org/wiki/Intel_Xeon_chipsets |
| 46 | */ |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 47 | static const struct { |
| 48 | uint16_t vendor_id, device_id; |
Uwe Hermann | 9a6b6b5 | 2008-05-14 21:20:55 +0000 | [diff] [blame] | 49 | char *name; |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 50 | } supported_chips_list[] = { |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 51 | /* Host bridges/DRAM controllers (Northbridges) */ |
| 52 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX, "443LX" }, |
| 53 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX, "443BX" }, |
| 54 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_NO_AGP, "443BX without AGP" }, |
| 55 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810, "810" }, |
| 56 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_DC, "810-DC100" }, |
| 57 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_DC, "810E DC-133" }, |
| 58 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82830M, "830M" }, |
| 59 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845, "845" }, |
| 60 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865, "865" }, |
| 61 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915, "915G/P/GV/GL/PL/910GL" }, |
| 62 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945P, "945P" }, |
| 63 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945GM, "945GM" }, |
| 64 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82945GSE, "945GSE" }, |
Stefan Tauner | 1a00cf0 | 2012-10-13 06:23:52 +0200 | [diff] [blame] | 65 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82946, "946GZ/PL" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 66 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82965PM, "965PM" }, |
| 67 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q965, "Q963/82Q965" }, |
| 68 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82975X, "975X" }, |
Loïc Grenié | 8429de7 | 2009-11-02 15:01:49 +0000 | [diff] [blame] | 69 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G33, "P35/G33/G31/P31" }, |
| 70 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q33, "Q33" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 71 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q35, "Q35" }, |
| 72 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82X38, "X38/X48" }, |
| 73 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_32X0, "3200/3210" }, |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 74 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82XX4X, |
| 75 | "GL40/GS40/GM45/GS45/PM45" }, |
Damien Zammit | 9c98664 | 2015-08-17 21:04:41 +1000 | [diff] [blame] | 76 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82Q45, "Q45/Q43" }, |
| 77 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G45, "G45/G43/P45/P43" }, |
| 78 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82G41, "G41" }, |
| 79 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82B43, "B43 (Base)" }, |
| 80 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82B43_2, "B43 (Soft)" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 81 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82X58, "X58" }, |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 82 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000P, |
| 83 | "Intel i5000P Memory Controller Hub" }, |
| 84 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000X, |
| 85 | "Intel i5000X Memory Controller Hub" }, |
| 86 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000Z, |
| 87 | "Intel i5000Z Memory Controller Hub" }, |
| 88 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000V, |
| 89 | "Intel i5000V Memory Controller Hub" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 90 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_POULSBO, "SCH Poulsbo" }, |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 91 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ATOM_DXXX, |
| 92 | "Atom D400/500 Series" }, |
Idwer Vollering | 312fc96 | 2010-12-17 22:34:58 +0000 | [diff] [blame] | 93 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ATOM_NXXX, "Atom N400 Series" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 94 | /* Host bridges /DRAM controllers integrated in CPUs */ |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 95 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_0TH_GEN, |
| 96 | "0th generation (Nehalem family) Core Processor" }, |
| 97 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_1ST_GEN, |
| 98 | "1st generation (Westmere family) Core Processor" }, |
| 99 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_D, |
| 100 | "2nd generation (Sandy Bridge family) Core Processor (Desktop)" }, |
| 101 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_M, |
| 102 | "2nd generation (Sandy Bridge family) Core Processor (Mobile)" }, |
| 103 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_E3, |
| 104 | "2nd generation (Sandy Bridge family) Core Processor (Xeon E3)" }, |
| 105 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_D, |
| 106 | "3rd generation (Ivy Bridge family) Core Processor (Desktop)" }, |
| 107 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_M, |
| 108 | "3rd generation (Ivy Bridge family) Core Processor (Mobile)" }, |
| 109 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_E3, |
| 110 | "3rd generation (Ivy Bridge family) Core Processor (Xeon E3 v2)" }, |
| 111 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_015c, |
| 112 | "3rd generation (Ivy Bridge family) Core Processor" }, |
| 113 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_D, |
| 114 | "4th generation (Haswell family) Core Processor (Desktop)" }, |
| 115 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_M, |
| 116 | "4th generation (Haswell family) Core Processor (Mobile)" }, |
| 117 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_E3, |
| 118 | "4th generation (Haswell family) Core Processor (Xeon E3 v3)" }, |
| 119 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_U, |
| 120 | "4th generation (Haswell family) Core Processor ULT" }, |
| 121 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_U, |
| 122 | "5th generation (Broadwell family) Core Processor ULT" }, |
Maximilian Schander | cb2d21d | 2017-10-28 14:45:48 +0200 | [diff] [blame] | 123 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M, |
| 124 | "6th generation (Skylake-H family) Core Processor (Mobile)" }, |
| 125 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST, |
| 126 | "6th generation (Skylake-S/H family) Core Processor (Workstation)" }, |
Christoph Pomaska | 48ac29e | 2018-01-01 01:48:21 +0100 | [diff] [blame] | 127 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D, |
| 128 | "6th generation (Skylake-S family) Core Processor (Desktop)" }, |
Nico Huber | 54fe32f | 2017-10-03 16:03:07 +0200 | [diff] [blame] | 129 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D2, |
| 130 | "6th generation (Skylake-S family) Core Processor (Desktop)" }, |
Maxim Polyakov | 1317689 | 2019-08-27 18:20:08 +0300 | [diff] [blame] | 131 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_E, |
| 132 | "6th generation (Skylake family) Core Processor Xeon E (Server)" }, |
Martin Roth | 51dde6f | 2014-12-07 22:11:54 -0700 | [diff] [blame] | 133 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL, "Bay Trail" }, |
Matthew Garrett | 2bf28e5 | 2018-07-23 21:09:47 -0700 | [diff] [blame] | 134 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U, |
| 135 | "7th generation (Kaby Lake family) Core Processor (Mobile)" }, |
| 136 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_Y, |
| 137 | "7th generation (Kaby Lake family) Core Processor (Mobile)" }, |
| 138 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U_Q, |
| 139 | "7th generation (Kaby Lake family) Core Processor (Mobile)" }, |
Christian Walter | 9a8c5e7 | 2019-05-06 17:50:57 +0200 | [diff] [blame] | 140 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_E3, |
| 141 | "7th generation (Kaby Lake family) Core Processor Xeon E3-1200" }, |
Johanna Schander | d756c27 | 2019-12-29 14:31:01 +0100 | [diff] [blame] | 142 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CORE_10TH_GEN_U, |
| 143 | "10th generation (Icelake family) Core Processor (Mobile)" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 144 | /* Southbridges (LPC controllers) */ |
| 145 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371XX, "371AB/EB/MB" }, |
Arthur Heymans | 026f7df | 2017-04-10 22:26:13 +0200 | [diff] [blame] | 146 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10, "ICH10" }, |
Warren Turkal | 9702b6b | 2009-06-30 14:11:42 +0000 | [diff] [blame] | 147 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10R, "ICH10R" }, |
Anton Kochkov | da0b456 | 2010-05-30 12:33:12 +0000 | [diff] [blame] | 148 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9DH, "ICH9DH" }, |
| 149 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9DO, "ICH9DO" }, |
| 150 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9R, "ICH9R" }, |
| 151 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9, "ICH9" }, |
| 152 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9M, "ICH9M" }, |
| 153 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9ME, "ICH9M-E" }, |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 154 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8M, "ICH8-M" }, |
Lubomir Rintel | 2a13bad | 2015-03-01 10:14:15 +0100 | [diff] [blame] | 155 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8ME, "ICH8M-E" }, |
Corey Osgood | f366ce0 | 2010-08-17 08:33:44 +0000 | [diff] [blame] | 156 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8, "ICH8" }, |
| 157 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_NM10, "NM10" }, |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 158 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7MDH, "ICH7-M DH" }, |
Stefan Reinauer | f9b9945 | 2008-05-14 20:05:00 +0000 | [diff] [blame] | 159 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7M, "ICH7-M" }, |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 160 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7, "ICH7" }, |
Stefan Reinauer | f9b9945 | 2008-05-14 20:05:00 +0000 | [diff] [blame] | 161 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7DH, "ICH7DH" }, |
Pat Erley | ca3548e | 2010-04-21 06:23:19 +0000 | [diff] [blame] | 162 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6, "ICH6" }, |
Idwer Vollering | 312fc96 | 2010-12-17 22:34:58 +0000 | [diff] [blame] | 163 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH5, "ICH5" }, |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 164 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4M, "ICH4-M" }, |
| 165 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4, "ICH4" }, |
Uwe Hermann | 710e8b1 | 2008-05-17 21:33:35 +0000 | [diff] [blame] | 166 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH2, "ICH2" }, |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 167 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH0, "ICH0" }, |
Maciej Pijanka | 90d1740 | 2009-09-30 17:05:46 +0000 | [diff] [blame] | 168 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH, "ICH" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 169 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I63XX, "631xESB/632xESB/3100" }, |
| 170 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_POULSBO_LPC, "SCH Poulsbo" }, |
Stefan Tauner | 088f569 | 2013-05-28 11:30:25 +0200 | [diff] [blame] | 171 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_DESKTOP, "3400 Desktop" }, |
| 172 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_MOBILE, "3400 Mobile" }, |
| 173 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_P55, "P55" }, |
| 174 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PM55, "PM55" }, |
| 175 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H55, "H55" }, |
| 176 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM57, "QM57" }, |
| 177 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H57, "H57" }, |
| 178 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM55, "HM55" }, |
| 179 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q57, "Q57" }, |
| 180 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM57, "HM57" }, |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 181 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400_MOBILE_SFF, |
| 182 | "3400 Mobile SFF" }, |
Stefan Tauner | 088f569 | 2013-05-28 11:30:25 +0200 | [diff] [blame] | 183 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B55_A, "B55" }, |
| 184 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS57, "QS57" }, |
| 185 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3400, "3400" }, |
| 186 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3420, "3420" }, |
| 187 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_3450, "3450" }, |
| 188 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B55_B, "B55" }, |
Nico Huber | 76d6049 | 2013-03-29 17:57:15 +0100 | [diff] [blame] | 189 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z68, "Z68" }, |
| 190 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_P67, "P67" }, |
| 191 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UM67, "UM67" }, |
| 192 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM65, "HM65" }, |
| 193 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H67, "H67" }, |
| 194 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM67, "HM67" }, |
| 195 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q65, "Q65" }, |
| 196 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS67, "QS67" }, |
| 197 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q67, "Q67" }, |
| 198 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM67, "QM67" }, |
| 199 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B65, "B65" }, |
| 200 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C202, "C202" }, |
| 201 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C204, "C204" }, |
| 202 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C206, "C206" }, |
| 203 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H61, "H61" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 204 | { PCI_VENDOR_ID_INTEL, 0x1d40, "X79" }, |
| 205 | { PCI_VENDOR_ID_INTEL, 0x1d41, "X79" }, |
Nico Huber | 76d6049 | 2013-03-29 17:57:15 +0100 | [diff] [blame] | 206 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z77, "Z77" }, |
| 207 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z75, "Z75" }, |
| 208 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q77, "Q77" }, |
| 209 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q75, "Q75" }, |
| 210 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B75, "B75" }, |
| 211 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H77, "H77" }, |
| 212 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C216, "C216" }, |
| 213 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM77, "QM77" }, |
| 214 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QS77, "QS77" }, |
| 215 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM77, "HM77" }, |
| 216 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UM77, "UM77" }, |
| 217 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM76, "HM76" }, |
| 218 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM75, "HM75" }, |
| 219 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM70, "HM70" }, |
| 220 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_NM70, "NM70" }, |
Johanna Schander | d756c27 | 2019-12-29 14:31:01 +0100 | [diff] [blame] | 221 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICELAKE_LP_U, |
| 222 | "Icelake U LPC" }, |
Youness Alaoui | 085d87b | 2017-04-13 12:55:31 -0400 | [diff] [blame] | 223 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_FULL, |
| 224 | "Lynx Point Low Power Full Featured Engineering Sample" }, |
| 225 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_PREM, |
| 226 | "Lynx Point Low Power Premium SKU" }, |
| 227 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_BASE, |
| 228 | "Lynx Point Low Power Base SKU" }, |
| 229 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP, |
| 230 | "Wildcat Point Low Power SKU" }, |
Stefan Tauner | 04c0600 | 2012-10-13 02:19:30 +0200 | [diff] [blame] | 231 | { PCI_VENDOR_ID_INTEL, 0x2310, "DH89xxCC" }, |
Martin Roth | 51dde6f | 2014-12-07 22:11:54 -0700 | [diff] [blame] | 232 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC, "Bay Trail" }, |
Maximilian Schander | cb2d21d | 2017-10-28 14:45:48 +0200 | [diff] [blame] | 233 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_PRE, |
| 234 | "Sunrise Point Desktop Engineering Sample" }, |
Felix Singer | 0a7543d | 2019-02-19 23:49:11 +0100 | [diff] [blame] | 235 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_PRE, |
| 236 | "Sunrise Point-LP Engineering Sample" }, |
| 237 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_BASE_SKL, |
| 238 | "Sunrise Point-LP U Base/Skylake" }, |
| 239 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_PREM_SKL, |
| 240 | "Sunrise Point-LP Y Premium/Skylake" }, |
| 241 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_PREM_SKL, |
| 242 | "Sunrise Point-LP U Premium/Skylake" }, |
| 243 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_BASE_KBL, |
| 244 | "Sunrise Point-LP U Base/Kabylake" }, |
| 245 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_PREM_KBL, |
| 246 | "Sunrise Point-LP Y Premium/Kabylake" }, |
| 247 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_PREM_KBL, |
| 248 | "Sunrise Point-LP U Premium/Kabylake" }, |
Matthew Garrett | 2bf28e5 | 2018-07-23 21:09:47 -0700 | [diff] [blame] | 249 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_IHDCP_BASE, |
Felix Singer | 0a7543d | 2019-02-19 23:49:11 +0100 | [diff] [blame] | 250 | "Sunrise Point-LP U iHDCP 2.2 Base/Kabylake" }, |
Matthew Garrett | 2bf28e5 | 2018-07-23 21:09:47 -0700 | [diff] [blame] | 251 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_U_IHDCP_PREM, |
Felix Singer | 0a7543d | 2019-02-19 23:49:11 +0100 | [diff] [blame] | 252 | "Sunrise Point-LP U iHDCP 2.2 Premium/Kabylake" }, |
Matthew Garrett | 2bf28e5 | 2018-07-23 21:09:47 -0700 | [diff] [blame] | 253 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_Y_IHDCP_PREM, |
Felix Singer | 0a7543d | 2019-02-19 23:49:11 +0100 | [diff] [blame] | 254 | "Sunrise Point-LP Y iHDCP 2.2 Premium/Kabylake" }, |
Maximilian Schander | cb2d21d | 2017-10-28 14:45:48 +0200 | [diff] [blame] | 255 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H110, "H110" }, |
| 256 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H170, "H170" }, |
| 257 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z170, "Z170" }, |
| 258 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q170, "Q170" }, |
| 259 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q150, "Q150" }, |
| 260 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B150, "B150" }, |
| 261 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C236, "C236" }, |
| 262 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C232, "C232" }, |
| 263 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM170, "QM170" }, |
| 264 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM170, "HM170" }, |
Nico Huber | ed9c9ce | 2017-03-30 17:45:36 +0200 | [diff] [blame] | 265 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM236, "CM236" }, |
Maximilian Schander | cb2d21d | 2017-10-28 14:45:48 +0200 | [diff] [blame] | 266 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM175, "HM175" }, |
| 267 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM175, "QM175" }, |
| 268 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM238, "CM238" }, |
Maxim Polyakov | ec32e61 | 2019-08-16 19:15:12 +0300 | [diff] [blame] | 269 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C621, "C621" }, |
| 270 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C622, "C622" }, |
| 271 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C624, "C624" }, |
| 272 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C625, "C625" }, |
| 273 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C626, "C626" }, |
| 274 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627, "C627" }, |
| 275 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C628, "C628" }, |
| 276 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C629, "C629" }, |
| 277 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C624_SUPER, "C624 Super SKU" }, |
| 278 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627_SUPER_1, "C627 Super SKU" }, |
| 279 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C621_SUPER, "C621 Super SKU" }, |
| 280 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C627_SUPER_2, "C627 Super SKU" }, |
| 281 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C628_SUPER, "C628 Super SKU" }, |
Thomas Heijligen | 725369f | 2019-02-19 10:51:34 +0000 | [diff] [blame] | 282 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H310, "H310" }, |
| 283 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H370, "H370" }, |
| 284 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z390, "Z390" }, |
| 285 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q370, "Q370" }, |
| 286 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B360, "B360" }, |
| 287 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C246, "C246" }, |
| 288 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C242, "C242" }, |
| 289 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM370, "QM370" }, |
| 290 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM370, "HM370" }, |
| 291 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CM246, "CM246" }, |
qeed | b775a62 | 2018-06-19 19:52:19 -0400 | [diff] [blame] | 292 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C8_MOBILE, "C8 Mobile"}, |
| 293 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C8_DESKTOP, "C8 Desktop"}, |
| 294 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z87, "Z87"}, |
| 295 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z85, "Z85"}, |
| 296 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM86, "HM86"}, |
| 297 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H87, "H87"}, |
| 298 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HM87, "HM87"}, |
| 299 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q85, "Q85"}, |
| 300 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q87, "Q87"}, |
| 301 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QM87, "QM87"}, |
| 302 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B85, "B85"}, |
| 303 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C222, "C222"}, |
| 304 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C224, "C224"}, |
| 305 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_C226, "C226"}, |
| 306 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H81, "H81"}, |
Nico Huber | 94473af | 2018-11-20 12:10:29 +0100 | [diff] [blame] | 307 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL_LPC, "Apollo Lake" }, |
Thomas Heijligen | da02719 | 2019-01-12 19:20:50 +0100 | [diff] [blame] | 308 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_LPC, "Denverton" }, |
Patrick Rudolph | 2d26a36 | 2017-11-07 19:51:21 +0100 | [diff] [blame] | 309 | /* Intel GPUs */ |
| 310 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G35_EXPRESS, |
| 311 | "Intel(R) G35 Express Chipset Family" }, |
| 312 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G35_EXPRESS_1, |
| 313 | "Intel(R) G35 Express Chipset Family" }, |
| 314 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS, |
| 315 | "Mobile Intel(R) 965 Express Chipset Family" }, |
| 316 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_1, |
| 317 | "Mobile Intel(R) 965 Express Chipset Family" }, |
| 318 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_2, |
| 319 | "Mobile Intel(R) 965 Express Chipset Family" }, |
| 320 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_965_EXPRESS_3, |
| 321 | "Mobile Intel(R) 965 Express Chipset Family" }, |
| 322 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_4_SERIES, |
| 323 | "Mobile Intel(R) 4 Series Express Chipset Family" }, |
| 324 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_4_SERIES_1, |
| 325 | "Mobile Intel(R) 4 Series Express Chipset Family" }, |
| 326 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G45, |
| 327 | "Intel(R) G45/G43 Express Chipset Family" }, |
| 328 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G45_1, |
| 329 | "Intel(R) G45/G43 Express Chipset Family" }, |
| 330 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q45, |
| 331 | "Intel(R) Q45/Q43 Express Chipset Family" }, |
| 332 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Q45_1, |
| 333 | "Intel(R) Q45/Q43 Express Chipset Family" }, |
| 334 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G41, |
| 335 | "Intel(R) G41 Express Chipset Family" }, |
| 336 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_G41_1, |
| 337 | "Intel(R) G41 Express Chipset Family" }, |
| 338 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43, |
| 339 | "Intel(R) B43 Express Chipset Family" }, |
| 340 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_1, |
| 341 | "Intel(R) B43 Express Chipset Family" }, |
| 342 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_2, |
| 343 | "Intel(R) B43 Express Chipset Family" }, |
| 344 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_B43_3, |
| 345 | "Intel(R) B43 Express Chipset Family" }, |
| 346 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS, |
| 347 | "Intel(R) HD Graphics" }, |
| 348 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS_1, |
| 349 | "Intel(R) HD Graphics" }, |
| 350 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_GRAPHICS_2, |
| 351 | "Intel(R) HD Graphics" }, |
| 352 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2000, |
| 353 | "Intel(R) HD 2000 Graphics" }, |
| 354 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2000_1, |
| 355 | "Intel(R) HD 2000 Graphics" }, |
| 356 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000, |
| 357 | "Intel(R) HD 3000 Graphics" }, |
| 358 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_1, |
| 359 | "Intel(R) HD 3000 Graphics" }, |
| 360 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_2, |
| 361 | "Intel(R) HD 3000 Graphics" }, |
| 362 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_3, |
| 363 | "Intel(R) HD 3000 Graphics" }, |
| 364 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_4, |
| 365 | "Intel(R) HD 3000 Graphics" }, |
| 366 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_3000_5, |
| 367 | "Intel(R) HD 3000 Graphics" }, |
| 368 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500, |
| 369 | "Intel(R) HD 2500 Graphics" }, |
| 370 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500_1, |
| 371 | "Intel(R) HD 2500 Graphics" }, |
| 372 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_2500_2, |
| 373 | "Intel(R) HD 2500 Graphics" }, |
| 374 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000, |
| 375 | "Intel(R) HD 4000 Graphics" }, |
| 376 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000_1, |
| 377 | "Intel(R) HD 4000 Graphics" }, |
| 378 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4000_2, |
| 379 | "Intel(R) HD 4000 Graphics" }, |
Sellerie | 409a5dc | 2019-07-26 15:09:18 +0200 | [diff] [blame] | 380 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4400, |
| 381 | "Intel(R) HD 4400 Graphics" }, |
Patrick Rudolph | 2d26a36 | 2017-11-07 19:51:21 +0100 | [diff] [blame] | 382 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4600, |
| 383 | "Intel(R) HD 4600 Graphics" }, |
| 384 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_4600_1, |
| 385 | "Intel(R) HD 4600 Graphics" }, |
| 386 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000, |
| 387 | "Intel(R) HD 5000 Graphics" }, |
| 388 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000_1, |
| 389 | "Intel(R) HD 5000 Graphics" }, |
| 390 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_5000_2, |
| 391 | "Intel(R) HD 5000 Graphics" }, |
Felix Singer | 24b000a | 2019-01-02 14:44:54 +0100 | [diff] [blame] | 392 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_510, |
| 393 | "Intel(R) HD Graphics 510" }, |
| 394 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_515, |
| 395 | "Intel(R) HD Graphics 515" }, |
| 396 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_520, |
| 397 | "Intel(R) HD Graphics 520" }, |
| 398 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_530_1, |
| 399 | "Intel(R) HD Graphics 530" }, |
| 400 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HD_530_2, |
| 401 | "Intel(R) HD Graphics 530" }, |
| 402 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_615_1, |
| 403 | "Intel(R) UHD Graphics 615" }, |
| 404 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_615_2, |
| 405 | "Intel(R) UHD Graphics 615" }, |
| 406 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_617, |
| 407 | "Intel(R) UHD Graphics 617" }, |
| 408 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_1, |
| 409 | "Intel(R) UHD Graphics 620" }, |
| 410 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_2, |
| 411 | "Intel(R) UHD Graphics 620" }, |
| 412 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_620_3, |
| 413 | "Intel(R) UHD Graphics 620" }, |
| 414 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_1, |
| 415 | "Intel(R) UHD Graphics 630" }, |
| 416 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_2, |
| 417 | "Intel(R) UHD Graphics 630" }, |
| 418 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_3, |
| 419 | "Intel(R) UHD Graphics 630" }, |
| 420 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_4, |
| 421 | "Intel(R) UHD Graphics 630" }, |
| 422 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_5, |
| 423 | "Intel(R) UHD Graphics 630" }, |
| 424 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_6, |
| 425 | "Intel(R) UHD Graphics 630" }, |
| 426 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_630_7, |
| 427 | "Intel(R) UHD Graphics 630" }, |
| 428 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UHD_640, |
| 429 | "Intel(R) UHD Graphics 640" }, |
| 430 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_540, |
| 431 | "Intel(R) Iris Graphics 540" }, |
| 432 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_550, |
| 433 | "Intel(R) Iris Graphics 550" }, |
| 434 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PRO_580, |
| 435 | "Intel(R) Iris Pro Graphics 580" }, |
| 436 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_650, |
| 437 | "Intel(R) Iris Plus Graphics 650" }, |
| 438 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_655, |
| 439 | "Intel(R) Iris Plus Graphics 655" }, |
Johanna Schander | d756c27 | 2019-12-29 14:31:01 +0100 | [diff] [blame] | 440 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IRIS_PLUS_G7, |
| 441 | "Intel(R) Iris Plus Graphics G7" }, |
Stefan Reinauer | 9f7af6e | 2008-05-14 14:22:59 +0000 | [diff] [blame] | 442 | }; |
| 443 | |
Stefan Reinauer | f7f2f25 | 2009-09-01 09:52:14 +0000 | [diff] [blame] | 444 | #ifndef __DARWIN__ |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 445 | static int fd_mem; |
| 446 | |
Stefan Reinauer | cff573d | 2011-03-18 22:08:39 +0000 | [diff] [blame] | 447 | void *map_physical(uint64_t phys_addr, size_t len) |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 448 | { |
| 449 | void *virt_addr; |
| 450 | |
| 451 | virt_addr = mmap(0, len, PROT_WRITE | PROT_READ, MAP_SHARED, |
| 452 | fd_mem, (off_t) phys_addr); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 453 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 454 | if (virt_addr == MAP_FAILED) { |
Stefan Reinauer | a7b296d | 2011-11-14 12:40:34 -0800 | [diff] [blame] | 455 | printf("Error mapping physical memory 0x%08" PRIx64 "[0x%zx]\n", |
| 456 | phys_addr, len); |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 457 | return NULL; |
| 458 | } |
| 459 | |
| 460 | return virt_addr; |
| 461 | } |
| 462 | |
Stefan Reinauer | f7f2f25 | 2009-09-01 09:52:14 +0000 | [diff] [blame] | 463 | void unmap_physical(void *virt_addr, size_t len) |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 464 | { |
| 465 | munmap(virt_addr, len); |
| 466 | } |
| 467 | #endif |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 468 | |
Jacob Garber | 6faccd1 | 2019-07-01 11:21:55 -0600 | [diff] [blame] | 469 | static void print_version(void) |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 470 | { |
| 471 | printf("inteltool v%s -- ", INTELTOOL_VERSION); |
| 472 | printf("Copyright (C) 2008 coresystems GmbH\n\n"); |
| 473 | printf( |
| 474 | "This program is free software: you can redistribute it and/or modify\n" |
| 475 | "it under the terms of the GNU General Public License as published by\n" |
| 476 | "the Free Software Foundation, version 2 of the License.\n\n" |
| 477 | "This program is distributed in the hope that it will be useful,\n" |
| 478 | "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" |
| 479 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" |
Martin Roth | eb20e60 | 2016-01-12 13:30:50 -0700 | [diff] [blame] | 480 | "GNU General Public License for more details.\n\n"); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 481 | } |
| 482 | |
Jacob Garber | 6faccd1 | 2019-07-01 11:21:55 -0600 | [diff] [blame] | 483 | static void print_usage(const char *name) |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 484 | { |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 485 | printf("usage: %s [-vh?gGrpmedPMaAsfSRx]\n", name); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 486 | printf("\n" |
| 487 | " -v | --version: print the version\n" |
| 488 | " -h | --help: print this help\n\n" |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 489 | " -s | --spi: dump southbridge spi and bios_cntrl registers\n" |
Stefan Tauner | 37fcd58 | 2016-05-10 23:16:33 +0200 | [diff] [blame] | 490 | " -f | --gfx: dump graphics registers (UNSAFE: may hang system!)\n" |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 491 | " -R | --ahci: dump AHCI registers\n" |
Idwer Vollering | b123e0d | 2014-08-25 23:59:42 +0200 | [diff] [blame] | 492 | " -g | --gpio: dump southbridge GPIO registers\n" |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 493 | " -G | --gpio-diffs: show GPIO differences from defaults\n" |
Idwer Vollering | b123e0d | 2014-08-25 23:59:42 +0200 | [diff] [blame] | 494 | " -r | --rcba: dump southbridge RCBA registers\n" |
| 495 | " -p | --pmbase: dump southbridge Power Management registers\n\n" |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 496 | " -m | --mchbar: dump northbridge Memory Controller registers\n" |
Stefan Tauner | 572f074 | 2016-05-05 17:29:39 +0200 | [diff] [blame] | 497 | " -S FILE | --spd=FILE: create a file storing current timings (implies -m)\n" |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 498 | " -e | --epbar: dump northbridge EPBAR registers\n" |
| 499 | " -d | --dmibar: dump northbridge DMIBAR registers\n" |
| 500 | " -P | --pciexpress: dump northbridge PCIEXBAR registers\n\n" |
| 501 | " -M | --msrs: dump CPU MSRs\n" |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 502 | " -A | --ambs: dump AMB registers\n" |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 503 | " -x | --sgx: dump SGX status\n" |
Stefan Tauner | 37fcd58 | 2016-05-10 23:16:33 +0200 | [diff] [blame] | 504 | " -a | --all: dump all known (safe) registers\n" |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 505 | " --pcr=PORT_ID: dump all registers of a PCR port\n" |
| 506 | " (may be specified max %d times)\n" |
| 507 | "\n", MAX_PCR_PORTS); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 508 | exit(1); |
| 509 | } |
| 510 | |
Felix Singer | 19e3534 | 2019-10-25 00:16:22 +0200 | [diff] [blame] | 511 | static void print_system_info(struct pci_dev *nb, struct pci_dev *sb, struct pci_dev *gfx) |
| 512 | { |
| 513 | unsigned int id, i; |
| 514 | char *sbname = "unknown", *nbname = "unknown", *gfxname = "unknown"; |
| 515 | |
| 516 | id = cpuid(1); |
| 517 | |
| 518 | /* Determine names */ |
| 519 | for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { |
| 520 | if (nb->device_id == supported_chips_list[i].device_id) |
| 521 | nbname = supported_chips_list[i].name; |
| 522 | } |
| 523 | for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) { |
| 524 | if (sb->device_id == supported_chips_list[i].device_id) |
| 525 | sbname = supported_chips_list[i].name; |
| 526 | } |
| 527 | if (gfx) { |
| 528 | for (i = 0; i < ARRAY_SIZE(supported_chips_list); i++) |
| 529 | if (gfx->device_id == supported_chips_list[i].device_id) |
| 530 | gfxname = supported_chips_list[i].name; |
| 531 | } |
| 532 | |
| 533 | /* Intel has suggested applications to display the family of a CPU as |
| 534 | * the sum of the "Family" and the "Extended Family" fields shown |
| 535 | * above, and the model as the sum of the "Model" and the 4-bit |
| 536 | * left-shifted "Extended Model" fields. |
| 537 | * http://download.intel.com/design/processor/applnots/24161832.pdf |
| 538 | */ |
| 539 | printf("CPU: ID 0x%x, Processor Type 0x%x, Family 0x%x, Model 0x%x, Stepping 0x%x\n", |
| 540 | id, (id >> 12) & 0x3, ((id >> 8) & 0xf) + ((id >> 20) & 0xff), |
| 541 | ((id >> 12) & 0xf0) + ((id >> 4) & 0xf), (id & 0xf)); |
| 542 | |
| 543 | printf("Northbridge: %04x:%04x (%s)\n", |
| 544 | nb->vendor_id, nb->device_id, nbname); |
| 545 | |
| 546 | printf("Southbridge: %04x:%04x (%s)\n", |
| 547 | sb->vendor_id, sb->device_id, sbname); |
| 548 | |
| 549 | if (gfx) |
| 550 | printf("IGD: %04x:%04x (%s)\n", |
| 551 | gfx->vendor_id, gfx->device_id, gfxname); |
| 552 | } |
| 553 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 554 | int main(int argc, char *argv[]) |
| 555 | { |
| 556 | struct pci_access *pacc; |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 557 | struct pci_dev *sb = NULL, *nb, *gfx = NULL, *ahci = NULL, *dev; |
Stefan Tauner | 572f074 | 2016-05-05 17:29:39 +0200 | [diff] [blame] | 558 | const char *dump_spd_file = NULL; |
Maciej Suminski | 3455672 | 2017-08-09 11:30:14 +0200 | [diff] [blame] | 559 | int opt, option_index = 0; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 560 | |
Uwe Hermann | 9a6b6b5 | 2008-05-14 21:20:55 +0000 | [diff] [blame] | 561 | int dump_gpios = 0, dump_mchbar = 0, dump_rcba = 0; |
| 562 | int dump_pmbase = 0, dump_epbar = 0, dump_dmibar = 0; |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 563 | int dump_pciexbar = 0, dump_coremsrs = 0, dump_ambs = 0; |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 564 | int dump_spi = 0, dump_gfx = 0, dump_ahci = 0, dump_sgx = 0; |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 565 | int show_gpio_diffs = 0; |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 566 | size_t pcr_count = 0; |
| 567 | uint8_t dump_pcr[MAX_PCR_PORTS]; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 568 | |
| 569 | static struct option long_options[] = { |
| 570 | {"version", 0, 0, 'v'}, |
| 571 | {"help", 0, 0, 'h'}, |
| 572 | {"gpios", 0, 0, 'g'}, |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 573 | {"gpio-diffs", 0, 0, 'G'}, |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 574 | {"mchbar", 0, 0, 'm'}, |
| 575 | {"rcba", 0, 0, 'r'}, |
| 576 | {"pmbase", 0, 0, 'p'}, |
| 577 | {"epbar", 0, 0, 'e'}, |
| 578 | {"dmibar", 0, 0, 'd'}, |
| 579 | {"pciexpress", 0, 0, 'P'}, |
| 580 | {"msrs", 0, 0, 'M'}, |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 581 | {"ambs", 0, 0, 'A'}, |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 582 | {"spi", 0, 0, 's'}, |
Vladimir Serbinenko | fb69a69 | 2015-10-10 13:20:32 +0200 | [diff] [blame] | 583 | {"spd", 0, 0, 'S'}, |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 584 | {"all", 0, 0, 'a'}, |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 585 | {"gfx", 0, 0, 'f'}, |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 586 | {"ahci", 0, 0, 'R'}, |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 587 | {"sgx", 0, 0, 'x'}, |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 588 | {"pcr", required_argument, 0, LONG_OPT_PCR}, |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 589 | {0, 0, 0, 0} |
| 590 | }; |
| 591 | |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 592 | while ((opt = getopt_long(argc, argv, "vh?gGrpmedPMaAsfRS:x", |
Uwe Hermann | 9a6b6b5 | 2008-05-14 21:20:55 +0000 | [diff] [blame] | 593 | long_options, &option_index)) != EOF) { |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 594 | switch (opt) { |
| 595 | case 'v': |
| 596 | print_version(); |
| 597 | exit(0); |
| 598 | break; |
Vladimir Serbinenko | fb69a69 | 2015-10-10 13:20:32 +0200 | [diff] [blame] | 599 | case 'S': |
| 600 | dump_spd_file = optarg; |
| 601 | dump_mchbar = 1; |
| 602 | break; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 603 | case 'g': |
| 604 | dump_gpios = 1; |
| 605 | break; |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 606 | case 'f': |
| 607 | dump_gfx = 1; |
| 608 | break; |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 609 | case 'R': |
| 610 | dump_ahci = 1; |
| 611 | break; |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 612 | case 'G': |
| 613 | show_gpio_diffs = 1; |
| 614 | break; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 615 | case 'm': |
| 616 | dump_mchbar = 1; |
| 617 | break; |
| 618 | case 'r': |
| 619 | dump_rcba = 1; |
| 620 | break; |
| 621 | case 'p': |
| 622 | dump_pmbase = 1; |
| 623 | break; |
| 624 | case 'e': |
| 625 | dump_epbar = 1; |
| 626 | break; |
| 627 | case 'd': |
| 628 | dump_dmibar = 1; |
| 629 | break; |
| 630 | case 'P': |
| 631 | dump_pciexbar = 1; |
| 632 | break; |
| 633 | case 'M': |
| 634 | dump_coremsrs = 1; |
| 635 | break; |
| 636 | case 'a': |
| 637 | dump_gpios = 1; |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 638 | show_gpio_diffs = 1; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 639 | dump_mchbar = 1; |
| 640 | dump_rcba = 1; |
| 641 | dump_pmbase = 1; |
| 642 | dump_epbar = 1; |
| 643 | dump_dmibar = 1; |
| 644 | dump_pciexbar = 1; |
| 645 | dump_coremsrs = 1; |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 646 | dump_ambs = 1; |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 647 | dump_spi = 1; |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 648 | dump_ahci = 1; |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 649 | dump_sgx = 1; |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 650 | break; |
| 651 | case 'A': |
| 652 | dump_ambs = 1; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 653 | break; |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 654 | case 's': |
| 655 | dump_spi = 1; |
| 656 | break; |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 657 | case 'x': |
| 658 | dump_sgx = 1; |
| 659 | break; |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 660 | case LONG_OPT_PCR: |
| 661 | if (pcr_count < MAX_PCR_PORTS) { |
| 662 | errno = 0; |
| 663 | const unsigned long int pcr = |
| 664 | strtoul(optarg, NULL, 0); |
| 665 | if (strlen(optarg) == 0 || errno) { |
| 666 | print_usage(argv[0]); |
| 667 | exit(1); |
| 668 | } |
| 669 | dump_pcr[pcr_count++] = (uint8_t)pcr; |
| 670 | } else { |
| 671 | print_usage(argv[0]); |
| 672 | exit(1); |
| 673 | } |
| 674 | break; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 675 | case 'h': |
| 676 | case '?': |
| 677 | default: |
| 678 | print_usage(argv[0]); |
| 679 | exit(0); |
| 680 | break; |
| 681 | } |
| 682 | } |
| 683 | |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 684 | #if defined(__FreeBSD__) |
Stefan Tauner | 0c8b7d1 | 2013-04-05 20:38:08 +0200 | [diff] [blame] | 685 | if (open("/dev/io", O_RDWR) < 0) { |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 686 | perror("/dev/io"); |
Andrey Korolyov | 046d217 | 2016-01-05 19:59:06 +0300 | [diff] [blame] | 687 | #elif defined(__NetBSD__) |
| 688 | # ifdef __i386__ |
| 689 | if (i386_iopl(3)) { |
| 690 | perror("iopl"); |
| 691 | # else |
| 692 | if (x86_64_iopl(3)) { |
| 693 | perror("iopl"); |
| 694 | # endif |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 695 | #else |
Uwe Hermann | 9a6b6b5 | 2008-05-14 21:20:55 +0000 | [diff] [blame] | 696 | if (iopl(3)) { |
Idwer Vollering | 3f91d81 | 2010-10-24 13:50:13 +0000 | [diff] [blame] | 697 | perror("iopl"); |
| 698 | #endif |
Uwe Hermann | 9a6b6b5 | 2008-05-14 21:20:55 +0000 | [diff] [blame] | 699 | printf("You need to be root.\n"); |
| 700 | exit(1); |
| 701 | } |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 702 | |
Stefan Reinauer | f7f2f25 | 2009-09-01 09:52:14 +0000 | [diff] [blame] | 703 | #ifndef __DARWIN__ |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 704 | if ((fd_mem = open("/dev/mem", O_RDWR)) < 0) { |
| 705 | perror("Can not open /dev/mem"); |
| 706 | exit(1); |
| 707 | } |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 708 | #endif |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 709 | |
| 710 | pacc = pci_alloc(); |
Nico Huber | 99b02a1 | 2017-04-05 17:39:57 +0200 | [diff] [blame] | 711 | pacc->method = PCI_ACCESS_I386_TYPE1; |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 712 | pci_init(pacc); |
| 713 | pci_scan_bus(pacc); |
| 714 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 715 | /* Find the required devices */ |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 716 | for (dev = pacc->devices; dev; dev = dev->next) { |
Maciej Pijanka | 90d1740 | 2009-09-30 17:05:46 +0000 | [diff] [blame] | 717 | pci_fill_info(dev, PCI_FILL_CLASS); |
| 718 | /* The ISA/LPC bridge can be 0x1f, 0x07, or 0x04 so we probe. */ |
| 719 | if (dev->device_class == 0x0601) { /* ISA/LPC bridge */ |
Mathias Krause | 5ad6ec5 | 2014-11-05 21:27:01 +0100 | [diff] [blame] | 720 | if (sb == NULL) { |
Maciej Pijanka | 90d1740 | 2009-09-30 17:05:46 +0000 | [diff] [blame] | 721 | sb = dev; |
Mathias Krause | 5ad6ec5 | 2014-11-05 21:27:01 +0100 | [diff] [blame] | 722 | } else { |
Maciej Pijanka | 90d1740 | 2009-09-30 17:05:46 +0000 | [diff] [blame] | 723 | fprintf(stderr, "Multiple devices with class ID" |
| 724 | " 0x0601, using %02x%02x:%02x.%02x\n", |
Mathias Krause | 5ad6ec5 | 2014-11-05 21:27:01 +0100 | [diff] [blame] | 725 | sb->domain, sb->bus, sb->dev, sb->func); |
| 726 | break; |
| 727 | } |
Maciej Pijanka | 90d1740 | 2009-09-30 17:05:46 +0000 | [diff] [blame] | 728 | } |
| 729 | } |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 730 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 731 | if (!sb) { |
| 732 | printf("No southbridge found.\n"); |
| 733 | exit(1); |
| 734 | } |
| 735 | |
Nico Huber | ac826c8 | 2017-03-31 12:09:58 +0200 | [diff] [blame] | 736 | pci_fill_info(sb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 737 | |
| 738 | if (sb->vendor_id != PCI_VENDOR_ID_INTEL) { |
| 739 | printf("Not an Intel(R) southbridge.\n"); |
| 740 | exit(1); |
| 741 | } |
| 742 | |
| 743 | nb = pci_get_dev(pacc, 0, 0, 0x00, 0); |
| 744 | if (!nb) { |
| 745 | printf("No northbridge found.\n"); |
| 746 | exit(1); |
| 747 | } |
| 748 | |
Nico Huber | ac826c8 | 2017-03-31 12:09:58 +0200 | [diff] [blame] | 749 | pci_fill_info(nb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 750 | |
| 751 | if (nb->vendor_id != PCI_VENDOR_ID_INTEL) { |
| 752 | printf("Not an Intel(R) northbridge.\n"); |
| 753 | exit(1); |
| 754 | } |
| 755 | |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 756 | gfx = pci_get_dev(pacc, 0, 0, 0x02, 0); |
| 757 | |
| 758 | if (gfx) { |
Nico Huber | ac826c8 | 2017-03-31 12:09:58 +0200 | [diff] [blame] | 759 | pci_fill_info(gfx, PCI_FILL_IDENT | PCI_FILL_BASES | |
| 760 | PCI_FILL_CLASS); |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 761 | |
| 762 | if (gfx->vendor_id != PCI_VENDOR_ID_INTEL) |
| 763 | gfx = 0; |
| 764 | } |
| 765 | |
Nico Huber | da94e17 | 2017-03-30 17:47:24 +0200 | [diff] [blame] | 766 | if (sb->device_id == PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC) { |
Marshall Dawson | 5c32549 | 2016-11-17 16:51:13 -0700 | [diff] [blame] | 767 | ahci = pci_get_dev(pacc, 0, 0, 0x13, 0); |
Nico Huber | da94e17 | 2017-03-30 17:47:24 +0200 | [diff] [blame] | 768 | } else { |
Marshall Dawson | 5c32549 | 2016-11-17 16:51:13 -0700 | [diff] [blame] | 769 | ahci = pci_get_dev(pacc, 0, 0, 0x1f, 2); |
Nico Huber | da94e17 | 2017-03-30 17:47:24 +0200 | [diff] [blame] | 770 | if (ahci) { |
| 771 | pci_fill_info(ahci, PCI_FILL_CLASS); |
| 772 | if (ahci->device_class != PCI_CLASS_STORAGE_SATA) |
| 773 | ahci = pci_get_dev(pacc, 0, 0, 0x17, 0); |
| 774 | } |
| 775 | } |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 776 | |
| 777 | if (ahci) { |
Nico Huber | ac826c8 | 2017-03-31 12:09:58 +0200 | [diff] [blame] | 778 | pci_fill_info(ahci, PCI_FILL_IDENT | PCI_FILL_BASES | |
| 779 | PCI_FILL_CLASS); |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 780 | |
Nico Huber | da94e17 | 2017-03-30 17:47:24 +0200 | [diff] [blame] | 781 | if (ahci->vendor_id != PCI_VENDOR_ID_INTEL || |
| 782 | ahci->device_class != PCI_CLASS_STORAGE_SATA) |
| 783 | ahci = NULL; |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 784 | } |
| 785 | |
Felix Singer | 19e3534 | 2019-10-25 00:16:22 +0200 | [diff] [blame] | 786 | print_system_info(nb, sb, gfx); |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 787 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 788 | /* Now do the deed */ |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 789 | if (dump_gpios) { |
Nico Huber | 09dcbf0 | 2013-04-01 15:08:04 +0200 | [diff] [blame] | 790 | print_gpios(sb, 1, show_gpio_diffs); |
| 791 | printf("\n\n"); |
| 792 | } else if (show_gpio_diffs) { |
| 793 | print_gpios(sb, 0, show_gpio_diffs); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 794 | printf("\n\n"); |
| 795 | } |
| 796 | |
| 797 | if (dump_rcba) { |
| 798 | print_rcba(sb); |
| 799 | printf("\n\n"); |
| 800 | } |
| 801 | |
| 802 | if (dump_pmbase) { |
Tobias Diedrich | 3645e61 | 2010-11-27 14:44:19 +0000 | [diff] [blame] | 803 | print_pmbase(sb, pacc); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 804 | printf("\n\n"); |
| 805 | } |
| 806 | |
| 807 | if (dump_mchbar) { |
Vladimir Serbinenko | fb69a69 | 2015-10-10 13:20:32 +0200 | [diff] [blame] | 808 | print_mchbar(nb, pacc, dump_spd_file); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 809 | printf("\n\n"); |
| 810 | } |
| 811 | |
| 812 | if (dump_epbar) { |
| 813 | print_epbar(nb); |
| 814 | printf("\n\n"); |
| 815 | } |
| 816 | |
| 817 | if (dump_dmibar) { |
| 818 | print_dmibar(nb); |
| 819 | printf("\n\n"); |
| 820 | } |
| 821 | |
| 822 | if (dump_pciexbar) { |
| 823 | print_pciexbar(nb); |
| 824 | printf("\n\n"); |
| 825 | } |
| 826 | |
| 827 | if (dump_coremsrs) { |
| 828 | print_intel_core_msrs(); |
| 829 | printf("\n\n"); |
| 830 | } |
| 831 | |
Pratik Prajapati | 015082d | 2017-07-25 11:16:55 -0700 | [diff] [blame] | 832 | if (dump_ambs) |
Sven Schnelle | 4b7b320 | 2012-01-08 15:27:18 +0100 | [diff] [blame] | 833 | print_ambs(nb, pacc); |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 834 | |
Pratik Prajapati | 015082d | 2017-07-25 11:16:55 -0700 | [diff] [blame] | 835 | if (dump_spi) |
Alexander Couzens | aa3dd5d | 2015-01-03 02:52:10 +0100 | [diff] [blame] | 836 | print_spi(sb); |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 837 | |
Pratik Prajapati | 015082d | 2017-07-25 11:16:55 -0700 | [diff] [blame] | 838 | if (dump_gfx) |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 839 | print_gfx(gfx); |
Vladimir Serbinenko | 188aec0 | 2015-05-20 14:04:41 +0200 | [diff] [blame] | 840 | |
Pratik Prajapati | 015082d | 2017-07-25 11:16:55 -0700 | [diff] [blame] | 841 | if (dump_ahci) |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 842 | print_ahci(ahci); |
Iru Cai | 904538b | 2016-06-08 22:39:22 +0800 | [diff] [blame] | 843 | |
Pratik Prajapati | 91664d4 | 2017-07-24 13:53:26 -0700 | [diff] [blame] | 844 | if (dump_sgx) |
| 845 | print_sgx(); |
| 846 | |
Youness Alaoui | d8214d7e | 2018-03-13 16:58:52 -0400 | [diff] [blame] | 847 | if (pcr_count) |
| 848 | print_pcr_ports(sb, dump_pcr, pcr_count); |
| 849 | |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 850 | /* Clean up */ |
Nico Huber | 99b02a1 | 2017-04-05 17:39:57 +0200 | [diff] [blame] | 851 | pcr_cleanup(); |
Nico Huber | 0660c6c | 2017-04-05 17:33:46 +0200 | [diff] [blame] | 852 | if (ahci) |
| 853 | pci_free_dev(ahci); |
| 854 | if (gfx) |
| 855 | pci_free_dev(gfx); |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 856 | pci_free_dev(nb); |
Nico Huber | 0660c6c | 2017-04-05 17:33:46 +0200 | [diff] [blame] | 857 | /* `sb` wasn't allocated by pci_get_dev() */ |
Stefan Reinauer | 03646be | 2008-05-13 22:14:21 +0000 | [diff] [blame] | 858 | pci_cleanup(pacc); |
| 859 | |
| 860 | return 0; |
| 861 | } |