2020-05-08 19:28:13 +02:00
|
|
|
/* inteltool - dump all registers on an Intel CPU + chipset based system */
|
util/: Replace GPLv2 boiler plate with SPDX header
Used commands:
perl -i -p0e 's|\/\*[\s*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-only */|' $(cat filelist)
perl -i -p0e 's|This[\s*]*program[\s*]*is[\s*]*free[\s*]*software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*either[\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License,[\s*]*or[\s*]*.at[\s*]*your[\s*]*option.*[\s*]*any[\s*]*later[\s*]*version.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-or-later */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*This[\s*#]*program[\s*#]*is[\s*#]*free[\s*#]*software[;:,][\s*#]*you[\s*#]*can[\s*#]*redistribute[\s*#]*it[\s*#]*and/or[\s*#]*modify[\s*#]*it[\s*#]*under[\s*#]*the[\s*#]*terms[\s*#]*of[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*as[\s*#]*published[\s*#]*by[\s*#]*the[\s*#]*Free[\s*#]*Software[\s*#]*Foundation[;:,][\s*#]*either[\s*#]*version[\s*#]*3[\s*#]*of[\s*#]*the[\s*#]*License[;:,][\s*#]*or[\s*#]*.at[\s*#]*your[\s*#]*option.*[\s*#]*any[\s*#]*later[\s*#]*version.[\s*#]*This[\s*#]*program[\s*#]*is[\s*#]*distributed[\s*#]*in[\s*#]*the[\s*#]*hope[\s*#]*that[\s*#]*it[\s*#]*will[\s*#]*be[\s*#]*useful[;:,][\s*#]*but[\s*#]*WITHOUT[\s*#]*ANY[\s*#]*WARRANTY[;:,][\s*#]*without[\s*#]*even[\s*#]*the[\s*#]*implied[\s*#]*warranty[\s*#]*of[\s*#]*MERCHANTABILITY[\s*#]*or[\s*#]*FITNESS[\s*#]*FOR[\s*#]*A[\s*#]*PARTICULAR[\s*#]*PURPOSE.[\s*#]*See[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*for[\s*#]*more[\s*#]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-3.0-or-later */|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w]*.*is free software[:;][\#\s]*you[\#\s]*can[\#\s]*redistribute[\#\s]*it[\#\s]*and\/or[\#\s]*modify[\#\s]*it[\s\#]*under[\s \#]*the[\s\#]*terms[\s\#]*of[\s\#]*the[\s\#]*GNU[\s\#]*General[\s\#]*Public[\s\#]*License[\s\#]*as[\s\#]*published[\s\#]*by[\s\#]*the[\s\#]*Free[\s\#]*Software[\s\#]*Foundation[;,][\s\#]*version[\s\#]*2[\s\#]*of[\s\#]*the[\s\#]*License.*[\s\#]*This[\s\#]*program[\s\#]*is[\s\#]*distributed[\s\#]*in[\s\#]*the[\s\#]*hope[\s\#]*that[\s\#]*it[\s\#]*will[\#\s]*be[\#\s]*useful,[\#\s]*but[\#\s]*WITHOUT[\#\s]*ANY[\#\s]*WARRANTY;[\#\s]*without[\#\s]*even[\#\s]*the[\#\s]*implied[\#\s]*warranty[\#\s]*of[\#\s]*MERCHANTABILITY[\#\s]*or[\#\s]*FITNESS[\#\s]*FOR[\#\s]*A[\#\s]*PARTICULAR[\#\s]*PURPOSE.[\#\s]*See[\#\s]*the[\#\s]*GNU[\#\s]*General[\#\s]*Public[\#\s]*License[\#\s]*for[\#\s]*more[\#\s]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
Change-Id: I1008a63b804f355a916221ac994701d7584f60ff
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-08 20:48:04 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2008-08-20 15:41:24 +02:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2011-11-14 21:40:34 +01:00
|
|
|
#include <inttypes.h>
|
2008-08-20 15:41:24 +02:00
|
|
|
#include "inteltool.h"
|
|
|
|
|
2013-06-20 18:05:06 +02:00
|
|
|
/* 320766 */
|
|
|
|
static const io_register_t nehalem_dmi_registers[] = {
|
|
|
|
{ 0x00, 4, "DMIVCH" }, // DMI Virtual Channel Capability Header
|
|
|
|
{ 0x04, 4, "DMIVCCAP1" }, // DMI Port VC Capability Register 1
|
|
|
|
{ 0x08, 4, "DMIVCCAP2" }, // DMI Port VC Capability Register 2
|
|
|
|
{ 0x0C, 4, "DMIVCCTL" }, // DMI Port VC Control
|
|
|
|
{ 0x10, 4, "DMIVC0RCAP" }, // DMI VC0 Resource Capability
|
|
|
|
{ 0x14, 4, "DMIVC0RCTL" }, // DMI VC0 Resource Control
|
|
|
|
/* { 0x18, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x1A, 2, "DMIVC0RSTS" }, // DMI VC0 Resource Status
|
|
|
|
{ 0x1C, 4, "DMIVC1RCAP" }, // DMI VC1 Resource Capability
|
|
|
|
{ 0x20, 4, "DMIVC1RCTL" }, // DMI VC1 Resource Control
|
|
|
|
/* { 0x24, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x26, 2, "DMIVC1RSTS" }, // DMI VC1 Resource Status
|
|
|
|
/* ... - Reserved */
|
|
|
|
{ 0x84, 4, "DMILCAP" }, // DMI Link Capabilities
|
|
|
|
{ 0x88, 2, "DMILCTL" }, // DMI Link Control
|
|
|
|
{ 0x8A, 2, "DMILSTS" }, // DMI Link Status
|
|
|
|
/* ... - Reserved */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 322812 */
|
|
|
|
static const io_register_t westmere_dmi_registers[] = {
|
|
|
|
{ 0x00, 4, "DMIVCECH" }, // DMI Virtual Channel Enhanced Capability
|
|
|
|
{ 0x04, 4, "DMIPVCCAP1" }, // DMI Port VC Capability Register 1
|
|
|
|
{ 0x08, 4, "DMIPVCCAP2" }, // DMI Port VC Capability Register 2
|
|
|
|
{ 0x0C, 2, "DMIPVCCTL" }, // DMI Port VC Control
|
|
|
|
/* { 0x0E, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x10, 4, "DMIVC0RCAP" }, // DMI VC0 Resource Capability
|
|
|
|
{ 0x14, 4, "DMIVC0RCTL" }, // DMI VC0 Resource Control
|
|
|
|
/* { 0x18, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x1A, 2, "DMIVC0RSTS" }, // DMI VC0 Resource Status
|
|
|
|
{ 0x1C, 4, "DMIVC1RCAP" }, // DMI VC1 Resource Capability
|
|
|
|
{ 0x20, 4, "DMIVC1RCTL1" }, // DMI VC1 Resource Control
|
|
|
|
/* { 0x24, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x26, 2, "DMIC1RSTS" }, // DMI VC1 Resource Status
|
|
|
|
/* ... - Reserved */
|
|
|
|
{ 0x84, 4, "DMILCAP" }, // DMI Link Capabilities
|
|
|
|
{ 0x88, 2, "DMILCTL" }, // DMI Link Control
|
|
|
|
{ 0x8A, 2, "DMILSTS" }, // DMI Link Status
|
|
|
|
/* ... - Reserved */
|
|
|
|
};
|
|
|
|
|
2012-07-21 04:36:47 +02:00
|
|
|
static const io_register_t sandybridge_dmi_registers[] = {
|
|
|
|
{ 0x00, 4, "DMI VCECH" }, // DMI Virtual Channel Enhanced Capability
|
|
|
|
{ 0x04, 4, "DMI PVCCAP1" }, // DMI Port VC Capability Register 1
|
|
|
|
{ 0x08, 4, "DMI PVVAP2" }, // DMI Port VC Capability Register 2
|
|
|
|
{ 0x0C, 2, "DMI PVCCTL" }, // DMI Port VC Control
|
|
|
|
/* { 0x0E, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x10, 4, "DMI VC0RCAP" }, // DMI VC0 Resource Capability
|
|
|
|
{ 0x14, 4, "DMI VC0RCTL" }, // DMI VC0 Resource Control
|
|
|
|
/* { 0x18, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x1A, 2, "DMI VC0RSTS" }, // DMI VC0 Resource Status
|
|
|
|
{ 0x1C, 4, "DMI VC1RCAP" }, // DMI VC1 Resource Capability
|
|
|
|
{ 0x20, 4, "DMI VC1RCTL" }, // DMI VC1 Resource Control
|
|
|
|
/* { 0x24, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x26, 2, "DMI VC1RSTS" }, // DMI VC1 Resource Status
|
|
|
|
{ 0x28, 4, "DMI VCPRCAP" }, // DMI VCp Resource Capability
|
|
|
|
{ 0x2C, 4, "DMI VCPRCTL" }, // DMI VCp Resource Control
|
|
|
|
/* { 0x30, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x32, 2, "DMI VCPRSTS" }, // DMI VCp Resource Status
|
|
|
|
{ 0x34, 4, "DMI VCMRCAP" }, // DMI VCm Resource Capability
|
|
|
|
{ 0x38, 4, "DMI VCMRCTL" }, // DMI VCm Resource Control
|
|
|
|
/* { 0x3C, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x3E, 2, "DMI VCMRSTS" }, // DMI VCm Resource Status
|
|
|
|
/* { 0x40, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x44, 4, "DMI ESC" }, // DMI Element Self Description
|
|
|
|
/* { 0x48, 8, "RSVD" }, // Reserved */
|
|
|
|
{ 0x50, 4, "DMI LE1D" }, // DMI Link Entry 1 Description
|
|
|
|
/* { 0x54, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x58, 4, "DMI LE1A" }, // DMI Link Entry 1 Address
|
|
|
|
{ 0x5C, 4, "DMI LUE1A" }, // DMI Link Upper Entry 1 Address
|
|
|
|
{ 0x60, 4, "DMI LE2D" }, // DMI Link Entry 2 Description
|
|
|
|
/* { 0x64, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x68, 4, "DMI LE2A" }, // DMI Link Entry 2 Address
|
|
|
|
/* { 0x6C, 4, "RSVD" }, // Reserved
|
|
|
|
{ 0x70, 8, "RSVD" }, // Reserved
|
|
|
|
{ 0x78, 8, "RSVD" }, // Reserved
|
|
|
|
{ 0x80, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x84, 4, "LCAP" }, // Link Capabilities
|
|
|
|
{ 0x88, 2, "LCTL" }, // Link Control
|
|
|
|
{ 0x8A, 2, "LSTS" }, // Link Status
|
|
|
|
/* { 0x8C, 4, "RSVD" }, // Reserved
|
|
|
|
{ 0x90, 4, "RSVD" }, // Reserved
|
|
|
|
{ 0x94, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x98, 2, "LCTL2" }, // Link Control 2
|
|
|
|
{ 0x9A, 2, "LSTS2" }, // Link Status 2
|
|
|
|
/* ... - Reserved */
|
|
|
|
{ 0xBC0, 4, "AFE_BMUF0" }, // AFE BMU Configuration Function 0
|
|
|
|
{ 0xBC4, 4, "RSVD" }, // Reserved
|
|
|
|
{ 0xBC8, 4, "RSVD" }, // Reserved
|
|
|
|
{ 0xBCC, 4, "AFE_BMUT0" }, // AFE BMU Configuration Test 0
|
|
|
|
/* ... - Reserved */
|
|
|
|
};
|
|
|
|
|
2014-10-30 10:30:40 +01:00
|
|
|
/*
|
|
|
|
* All Haswell DMI Registers per
|
|
|
|
*
|
|
|
|
* Mobile 4th Generation Intel Core TM Processor Family, Mobile Intel Pentium Processor Family,
|
|
|
|
* and Mobile Intel Celeron Processor Family
|
|
|
|
* Datasheet Volume 2
|
|
|
|
* 329002-002
|
|
|
|
*/
|
|
|
|
static const io_register_t haswell_ult_dmi_registers[] = {
|
2016-10-19 17:59:10 +02:00
|
|
|
{ 0x00, 4, "DMIVCECH" }, // DMI Virtual Channel Enhanced Capability
|
|
|
|
{ 0x04, 4, "DMIPVCCAP1" }, // DMI Port VC Capability Register 1
|
|
|
|
{ 0x08, 4, "DMIPVCCAP2" }, // DMI Port VC Capability Register 2
|
|
|
|
{ 0x0C, 2, "DMI PVCCTL" }, // DMI Port VC Control
|
|
|
|
/* { 0x0E, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x10, 4, "DMIVC0RCAP" }, // DMI VC0 Resource Capability
|
|
|
|
{ 0x14, 4, "DMIVC0RCTL" }, // DMI VC0 Resource Control
|
|
|
|
/* { 0x18, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x1A, 2, "DMIVC0RSTS" }, // DMI VC0 Resource Status
|
|
|
|
{ 0x1C, 4, "DMIVC1RCAP" }, // DMI VC1 Resource Capability
|
|
|
|
{ 0x20, 4, "DMIVC1RCTL" }, // DMI VC1 Resource Control
|
|
|
|
/* { 0x24, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x26, 2, "DMIVC1RSTS" }, // DMI VC1 Resource Status
|
|
|
|
{ 0x28, 4, "DMIVCPRCAP" }, // DMI VCp Resource Capability
|
|
|
|
{ 0x2C, 4, "DMIVCPRCTL" }, // DMI VCp Resource Control
|
|
|
|
/* { 0x30, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x32, 2, "DMIVCPRSTS" }, // DMI VCp Resource Status
|
|
|
|
{ 0x34, 4, "DMIVCMRCAP" }, // DMI VCm Resource Capability
|
|
|
|
{ 0x38, 4, "DMIVCMRCTL" }, // DMI VCm Resource Control
|
|
|
|
/* { 0x3C, 2, "RSVD" }, // Reserved */
|
|
|
|
{ 0x3E, 2, "DMIVCMRSTS" }, // DMI VCm Resource Status
|
|
|
|
{ 0x40, 4, "DMIRCLDECH" }, // DMI Root Complex Link Declaration */
|
|
|
|
{ 0x44, 4, "DMIESD" }, // DMI Element Self Description
|
|
|
|
/* { 0x48, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x4C, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x50, 4, "DMILE1D" }, // DMI Link Entry 1 Description
|
|
|
|
/* { 0x54, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x58, 4, "DMILE1A" }, // DMI Link Entry 1 Address
|
|
|
|
{ 0x5C, 4, "DMILUE1A" }, // DMI Link Upper Entry 1 Address
|
|
|
|
{ 0x60, 4, "DMILE2D" }, // DMI Link Entry 2 Description
|
|
|
|
/* { 0x64, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x68, 4, "DMILE2A" }, // DMI Link Entry 2 Address
|
|
|
|
/* { 0x6C, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x70, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x74, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x78, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x7C, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x80, 4, "RSVD" }, // Reserved */
|
|
|
|
/* { 0x84, 4, "RSVD" }, // Reserved */
|
|
|
|
{ 0x88, 2, "LCTL" }, // Link Control
|
|
|
|
/* ... - Reserved */
|
|
|
|
{ 0x1C4, 4, "DMIUESTS" }, // DMI Uncorrectable Error Status
|
|
|
|
{ 0x1C8, 4, "DMIUEMSK" }, // DMI Uncorrectable Error Mask
|
|
|
|
{ 0x1D0, 4, "DMICESTS" }, // DMI Correctable Error Status
|
|
|
|
{ 0x1D4, 4, "DMICEMSK" }, // DMI Correctable Error Mask
|
2014-10-30 10:30:40 +01:00
|
|
|
/* ... - Reserved */
|
|
|
|
};
|
|
|
|
|
2017-11-05 05:52:13 +01:00
|
|
|
/*
|
|
|
|
* All Skylake-S/H DMI Registers per
|
|
|
|
*
|
|
|
|
* 6th Generation Intel Processor Families for S-Platform Volume 2 of 2
|
|
|
|
* Page 117
|
|
|
|
* 332688-003E
|
|
|
|
*
|
|
|
|
* 6th Generation Intel Processor Families for H-Platform Volume 2 of 2
|
|
|
|
* Page 117
|
|
|
|
* 332987-002EN
|
|
|
|
*/
|
|
|
|
static const io_register_t skylake_dmi_registers[] = {
|
|
|
|
{ 0x00, 4, "DMIVCECH" }, // DMI Virtual Channel Enhanced Capability
|
|
|
|
{ 0x04, 4, "DMIPVCCAP1" }, // DMI Port VC Capability Register 1
|
|
|
|
{ 0x08, 4, "DMIPVCCAP2" }, // DMI Port VC Capability Register 2
|
|
|
|
{ 0x0C, 2, "DMIPVCCTL" }, // DMI Port VC Control
|
|
|
|
{ 0x10, 4, "DMIVC0RCAP" }, // DMI VC0 Resource Capability
|
|
|
|
{ 0x14, 4, "DMIVC0RCTL" }, // DMI VC0 Resource Control
|
|
|
|
{ 0x1A, 2, "DMIVC0RSTS" }, // DMI VC0 Resource Status
|
|
|
|
{ 0x1C, 4, "DMIVC1RCAP" }, // DMI VC1 Resource Capability
|
|
|
|
{ 0x20, 4, "DMIVC1RCTL" }, // DMI VC1 Resource Control
|
|
|
|
{ 0x26, 2, "DMIVC1RSTS" }, // DMI VC1 Resource Status
|
|
|
|
{ 0x34, 4, "DMIVCMRCAP" }, // DMI VCm Resource Capability
|
|
|
|
{ 0x38, 4, "DMIVCMRCTL" }, // DMI VCm Resource Control
|
|
|
|
{ 0x3E, 2, "DMIVCMRSTS" }, // DMI VCm Resource Status
|
|
|
|
{ 0x40, 4, "DMIRCLDECH" }, // DMI Root Complex Link Declaration */
|
|
|
|
{ 0x44, 4, "DMIESD" }, // DMI Element Self Description
|
|
|
|
{ 0x50, 4, "DMILE1D" }, // DMI Link Entry 1 Description
|
|
|
|
{ 0x58, 4, "DMILE1A" }, // DMI Link Entry 1 Address
|
|
|
|
{ 0x5C, 4, "DMILUE1A" }, // DMI Link Upper Entry 1 Address
|
|
|
|
{ 0x60, 4, "DMILE2D" }, // DMI Link Entry 2 Description
|
|
|
|
{ 0x68, 4, "DMILE2A" }, // DMI Link Entry 2 Address
|
|
|
|
{ 0x84, 4, "LCAP" }, // Link Capabilities
|
|
|
|
{ 0x88, 2, "LCTL" }, // Link Control
|
|
|
|
{ 0x8A, 2, "LSTS" }, // DMI Link Status
|
|
|
|
{ 0x98, 2, "LCTL2" }, // Link Control 2
|
|
|
|
{ 0x9A, 2, "LSTS2" }, // DMI Link Status 2
|
|
|
|
{ 0x1C4, 4, "DMIUESTS" }, // DMI Uncorrectable Error Status
|
|
|
|
{ 0x1C8, 4, "DMIUEMSK" }, // DMI Uncorrectable Error Mask
|
|
|
|
{ 0x1CC, 4, "DMIUESEV" }, // DMI Uncorrectable Error Mask
|
|
|
|
{ 0x1D0, 4, "DMICESTS" }, // DMI Correctable Error Status
|
|
|
|
{ 0x1D4, 4, "DMICEMSK" }, // DMI Correctable Error Mask
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-08-20 15:41:24 +02:00
|
|
|
/*
|
|
|
|
* Egress Port Root Complex MMIO configuration space
|
|
|
|
*/
|
|
|
|
int print_epbar(struct pci_dev *nb)
|
|
|
|
{
|
|
|
|
int i, size = (4 * 1024);
|
|
|
|
volatile uint8_t *epbar;
|
2008-12-04 16:18:20 +01:00
|
|
|
uint64_t epbar_phys;
|
2008-08-20 15:41:24 +02:00
|
|
|
|
|
|
|
printf("\n============= EPBAR =============\n\n");
|
|
|
|
|
|
|
|
switch (nb->device_id) {
|
2010-04-21 08:23:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82915:
|
2008-08-20 15:41:24 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GM:
|
2010-08-01 17:33:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GSE:
|
2008-11-02 12:11:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945P:
|
2012-10-13 06:23:52 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82946:
|
2008-12-04 16:18:20 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82975X:
|
2008-08-20 15:41:24 +02:00
|
|
|
epbar_phys = pci_read_long(nb, 0x40) & 0xfffffffe;
|
|
|
|
break;
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82965PM:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q965:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q35:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G33:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q33:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82X38:
|
2011-04-04 07:53:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_32X0:
|
2015-08-17 13:04:41 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82XX4X:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G41:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43_2:
|
2010-07-29 21:25:31 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
|
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
|
2014-11-09 00:11:28 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_E3:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_E3:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_015c:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_E3:
|
2014-10-30 10:30:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_U:
|
2015-05-15 04:58:33 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_U:
|
2017-10-03 16:03:07 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D2:
|
2020-07-01 21:20:40 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_Y:
|
2017-11-05 06:14:55 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
|
2018-01-01 01:48:21 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
|
2019-08-27 17:20:08 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_E:
|
2018-07-24 06:09:47 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_Y:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U_Q:
|
2019-05-06 17:50:57 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_E3:
|
2019-06-12 06:23:46 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_1:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_2:
|
2012-10-13 02:19:30 +02:00
|
|
|
epbar_phys = pci_read_long(nb, 0x40) & 0xfffffffe;
|
|
|
|
epbar_phys |= ((uint64_t)pci_read_long(nb, 0x44)) << 32;
|
|
|
|
break;
|
2009-08-29 17:45:43 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810_DC:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82810E_DC:
|
2010-02-22 12:26:06 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82830M:
|
2010-12-17 23:34:58 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82865:
|
|
|
|
printf("This northbridge does not have EPBAR.\n");
|
2008-08-20 15:41:24 +02:00
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
printf("Error: Dumping EPBAR on this northbridge is not (yet) supported.\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
epbar = map_physical(epbar_phys, size);
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
if (epbar == NULL) {
|
2008-08-20 15:41:24 +02:00
|
|
|
perror("Error mapping EPBAR");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2011-11-14 21:40:34 +01:00
|
|
|
printf("EPBAR = 0x%08" PRIx64 " (MEM)\n\n", epbar_phys);
|
2008-08-20 15:41:24 +02:00
|
|
|
for (i = 0; i < size; i += 4) {
|
2020-03-13 19:08:21 +01:00
|
|
|
if (read32(epbar + i))
|
|
|
|
printf("0x%04x: 0x%08x\n", i, read32(epbar+i));
|
2008-08-20 15:41:24 +02:00
|
|
|
}
|
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
unmap_physical((void *)epbar, size);
|
2008-08-20 15:41:24 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MCH-ICH Serial Interconnect Ingress Root Complex MMIO configuration space
|
|
|
|
*/
|
|
|
|
int print_dmibar(struct pci_dev *nb)
|
|
|
|
{
|
|
|
|
int i, size = (4 * 1024);
|
|
|
|
volatile uint8_t *dmibar;
|
2008-12-04 16:18:20 +01:00
|
|
|
uint64_t dmibar_phys;
|
2012-07-21 04:36:47 +02:00
|
|
|
const io_register_t *dmi_registers = NULL;
|
2008-08-20 15:41:24 +02:00
|
|
|
|
|
|
|
printf("\n============= DMIBAR ============\n\n");
|
|
|
|
|
|
|
|
switch (nb->device_id) {
|
2010-04-21 08:23:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82915:
|
2008-08-20 15:41:24 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GM:
|
2010-08-01 17:33:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GSE:
|
2008-11-02 12:11:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945P:
|
2008-12-04 16:18:20 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82975X:
|
2008-08-20 15:41:24 +02:00
|
|
|
dmibar_phys = pci_read_long(nb, 0x4c) & 0xfffffffe;
|
|
|
|
break;
|
2012-10-13 06:23:52 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82946:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82965PM:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q965:
|
2010-09-03 11:32:17 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82Q35:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G33:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q33:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82X38:
|
2011-04-04 07:53:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_32X0:
|
2015-08-17 13:04:41 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82XX4X:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G41:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43_2:
|
2010-07-29 21:25:31 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
|
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
|
2010-09-03 11:32:17 +02:00
|
|
|
dmibar_phys = pci_read_long(nb, 0x68) & 0xfffffffe;
|
|
|
|
dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
|
|
|
|
break;
|
2009-08-29 17:45:43 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810_DC:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82810E_DC:
|
2010-12-17 23:34:58 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82865:
|
|
|
|
printf("This northbridge does not have DMIBAR.\n");
|
2008-08-20 15:41:24 +02:00
|
|
|
return 1;
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82X58:
|
2010-09-03 11:31:13 +02:00
|
|
|
dmibar_phys = pci_read_long(nb, 0x50) & 0xfffff000;
|
|
|
|
break;
|
2013-06-20 18:05:06 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_0TH_GEN:
|
|
|
|
/* DMIBAR is called DMIRCBAR in Nehalem */
|
|
|
|
dmibar_phys = pci_read_long(nb, 0x50) & 0xfffff000; /* 31:12 */
|
|
|
|
dmi_registers = nehalem_dmi_registers;
|
|
|
|
size = ARRAY_SIZE(nehalem_dmi_registers);
|
|
|
|
break;
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_1ST_GEN:
|
|
|
|
dmibar_phys = pci_read_long(nb, 0x68);
|
|
|
|
dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
|
|
|
|
dmibar_phys &= 0x0000000ffffff000UL; /* 35:12 */
|
2013-06-20 18:05:06 +02:00
|
|
|
dmi_registers = westmere_dmi_registers;
|
|
|
|
size = ARRAY_SIZE(westmere_dmi_registers);
|
2012-10-13 02:19:30 +02:00
|
|
|
break;
|
2014-11-05 03:18:44 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_M:
|
2014-11-09 00:11:28 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_E3:
|
2012-07-21 04:36:47 +02:00
|
|
|
dmi_registers = sandybridge_dmi_registers;
|
|
|
|
size = ARRAY_SIZE(sandybridge_dmi_registers);
|
2017-03-19 20:12:43 +01:00
|
|
|
/* fall through */
|
2014-11-09 00:11:28 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_D: /* pretty printing not implemented yet */
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_E3:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_015c:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_E3:
|
2012-10-13 02:19:30 +02:00
|
|
|
dmibar_phys = pci_read_long(nb, 0x68);
|
|
|
|
dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
|
|
|
|
dmibar_phys &= 0x0000007ffffff000UL; /* 38:12 */
|
2012-07-21 04:36:47 +02:00
|
|
|
break;
|
2014-10-30 10:30:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_U:
|
2015-05-15 04:58:33 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_U:
|
2014-10-30 10:30:40 +01:00
|
|
|
dmi_registers = haswell_ult_dmi_registers;
|
|
|
|
size = ARRAY_SIZE(haswell_ult_dmi_registers);
|
|
|
|
dmibar_phys = pci_read_long(nb, 0x68);
|
|
|
|
dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
|
|
|
|
dmibar_phys &= 0x0000007ffffff000UL; /* 38:12 */
|
|
|
|
break;
|
2017-10-03 16:03:07 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D2:
|
2020-07-01 21:20:40 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_Y:
|
2017-11-05 05:52:13 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
|
2018-01-01 01:48:21 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
|
2019-08-27 17:20:08 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_E:
|
2018-07-24 06:09:47 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_Y:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U_Q:
|
2019-05-06 17:50:57 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_E3:
|
2019-06-12 06:23:46 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_1:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_2:
|
2017-11-05 05:52:13 +01:00
|
|
|
dmi_registers = skylake_dmi_registers;
|
|
|
|
size = ARRAY_SIZE(skylake_dmi_registers);
|
|
|
|
dmibar_phys = pci_read_long(nb, 0x68);
|
|
|
|
dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
|
|
|
|
dmibar_phys &= 0x0000007ffffff000UL; /* 38:12 */
|
|
|
|
break;
|
2008-08-20 15:41:24 +02:00
|
|
|
default:
|
|
|
|
printf("Error: Dumping DMIBAR on this northbridge is not (yet) supported.\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
dmibar = map_physical(dmibar_phys, size);
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
if (dmibar == NULL) {
|
2008-08-20 15:41:24 +02:00
|
|
|
perror("Error mapping DMIBAR");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2011-11-14 21:40:34 +01:00
|
|
|
printf("DMIBAR = 0x%08" PRIx64 " (MEM)\n\n", dmibar_phys);
|
2012-07-21 04:36:47 +02:00
|
|
|
if (dmi_registers != NULL) {
|
|
|
|
for (i = 0; i < size; i++) {
|
|
|
|
switch (dmi_registers[i].size) {
|
|
|
|
case 4:
|
|
|
|
printf("dmibase+0x%04x: 0x%08x (%s)\n",
|
|
|
|
dmi_registers[i].addr,
|
2020-03-13 19:08:21 +01:00
|
|
|
read32(dmibar+dmi_registers[i].addr),
|
2012-07-21 04:36:47 +02:00
|
|
|
dmi_registers[i].name);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
printf("dmibase+0x%04x: 0x%04x (%s)\n",
|
|
|
|
dmi_registers[i].addr,
|
2020-03-13 19:08:21 +01:00
|
|
|
read16(dmibar+dmi_registers[i].addr),
|
2012-07-21 04:36:47 +02:00
|
|
|
dmi_registers[i].name);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
printf("dmibase+0x%04x: 0x%02x (%s)\n",
|
|
|
|
dmi_registers[i].addr,
|
2020-03-13 19:08:21 +01:00
|
|
|
read8(dmibar+dmi_registers[i].addr),
|
2012-07-21 04:36:47 +02:00
|
|
|
dmi_registers[i].name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < size; i += 4) {
|
2020-03-13 19:08:21 +01:00
|
|
|
if (read32(dmibar + i))
|
|
|
|
printf("0x%04x: 0x%08x\n", i, read32(dmibar+i));
|
2012-07-21 04:36:47 +02:00
|
|
|
}
|
2008-08-20 15:41:24 +02:00
|
|
|
}
|
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
unmap_physical((void *)dmibar, size);
|
2008-08-20 15:41:24 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PCIe MMIO configuration space
|
|
|
|
*/
|
|
|
|
int print_pciexbar(struct pci_dev *nb)
|
|
|
|
{
|
2008-12-04 16:18:20 +01:00
|
|
|
uint64_t pciexbar_reg;
|
|
|
|
uint64_t pciexbar_phys;
|
2008-08-20 15:41:24 +02:00
|
|
|
volatile uint8_t *pciexbar;
|
|
|
|
int max_busses, devbase, i;
|
|
|
|
int bus, dev, fn;
|
|
|
|
|
|
|
|
printf("========= PCIEXBAR ========\n\n");
|
|
|
|
|
|
|
|
switch (nb->device_id) {
|
2010-04-21 08:23:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82915:
|
2008-08-20 15:41:24 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GM:
|
2010-08-01 17:33:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945GSE:
|
2008-11-02 12:11:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82945P:
|
2008-12-04 16:18:20 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82975X:
|
2008-08-20 15:41:24 +02:00
|
|
|
pciexbar_reg = pci_read_long(nb, 0x48);
|
|
|
|
break;
|
2012-10-13 06:23:52 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82946:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82965PM:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q965:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q35:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G33:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q33:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82X38:
|
2011-04-04 07:53:19 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_32X0:
|
2015-08-17 13:04:41 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82XX4X:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82Q45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G45:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82G41:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82B43_2:
|
2010-07-29 21:25:31 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
|
|
|
|
case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
|
2014-11-09 00:11:28 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_2ND_GEN_E3:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_E3:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_3RD_GEN_015c:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_D:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_E3:
|
2014-10-30 10:30:40 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_4TH_GEN_U:
|
2015-05-15 04:58:33 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_5TH_GEN_U:
|
2017-10-03 16:03:07 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D2:
|
2020-07-01 21:20:40 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_Y:
|
2017-11-05 06:14:55 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
|
2018-01-01 01:48:21 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
|
2019-08-27 17:20:08 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_E:
|
2018-07-24 06:09:47 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_Y:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_U_Q:
|
2019-05-06 17:50:57 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_E3:
|
2019-06-12 06:23:46 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_1:
|
|
|
|
case PCI_DEVICE_ID_INTEL_CORE_8TH_GEN_U_2:
|
2012-10-13 02:19:30 +02:00
|
|
|
pciexbar_reg = pci_read_long(nb, 0x60);
|
|
|
|
pciexbar_reg |= ((uint64_t)pci_read_long(nb, 0x64)) << 32;
|
|
|
|
break;
|
2009-08-29 17:45:43 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810:
|
2012-10-13 02:19:30 +02:00
|
|
|
case PCI_DEVICE_ID_INTEL_82810_DC:
|
|
|
|
case PCI_DEVICE_ID_INTEL_82810E_DC:
|
2010-12-17 23:34:58 +01:00
|
|
|
case PCI_DEVICE_ID_INTEL_82865:
|
|
|
|
printf("Error: This northbridge does not have PCIEXBAR.\n");
|
2008-08-20 15:41:24 +02:00
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
printf("Error: Dumping PCIEXBAR on this northbridge is not (yet) supported.\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(pciexbar_reg & (1 << 0))) {
|
|
|
|
printf("PCIEXBAR register is disabled.\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ((pciexbar_reg >> 1) & 3) {
|
|
|
|
case 0: // 256MB
|
2013-04-03 10:00:33 +02:00
|
|
|
pciexbar_phys = pciexbar_reg & (0xffULL << 28);
|
2008-08-20 15:41:24 +02:00
|
|
|
max_busses = 256;
|
|
|
|
break;
|
|
|
|
case 1: // 128M
|
2013-04-03 10:00:33 +02:00
|
|
|
pciexbar_phys = pciexbar_reg & (0x1ffULL << 27);
|
2008-08-20 15:41:24 +02:00
|
|
|
max_busses = 128;
|
|
|
|
break;
|
|
|
|
case 2: // 64M
|
2013-04-03 10:00:33 +02:00
|
|
|
pciexbar_phys = pciexbar_reg & (0x3ffULL << 26);
|
2008-08-20 15:41:24 +02:00
|
|
|
max_busses = 64;
|
|
|
|
break;
|
|
|
|
default: // RSVD
|
|
|
|
printf("Undefined address base. Bailing out.\n");
|
|
|
|
return 1;
|
2010-04-27 08:56:47 +02:00
|
|
|
}
|
2008-08-20 15:41:24 +02:00
|
|
|
|
2011-11-14 21:40:34 +01:00
|
|
|
printf("PCIEXBAR: 0x%08" PRIx64 "\n", pciexbar_phys);
|
2008-08-20 15:41:24 +02:00
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
pciexbar = map_physical(pciexbar_phys, (max_busses * 1024 * 1024));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
if (pciexbar == NULL) {
|
2008-08-20 15:41:24 +02:00
|
|
|
perror("Error mapping PCIEXBAR");
|
|
|
|
exit(1);
|
|
|
|
}
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2008-08-20 15:41:24 +02:00
|
|
|
for (bus = 0; bus < max_busses; bus++) {
|
|
|
|
for (dev = 0; dev < 32; dev++) {
|
|
|
|
for (fn = 0; fn < 8; fn++) {
|
|
|
|
devbase = (bus * 1024 * 1024) + (dev * 32 * 1024) + (fn * 4 * 1024);
|
|
|
|
|
2020-03-13 19:08:21 +01:00
|
|
|
if (read16(pciexbar + devbase) == 0xffff)
|
2008-08-20 15:41:24 +02:00
|
|
|
continue;
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2008-08-20 15:41:24 +02:00
|
|
|
/* This is a heuristics. Anyone got a better check? */
|
2020-03-13 19:08:21 +01:00
|
|
|
if( (read32(pciexbar + devbase + 256) == 0xffffffff) &&
|
|
|
|
(read32(pciexbar + devbase + 512) == 0xffffffff) ) {
|
2008-08-20 15:41:24 +02:00
|
|
|
#if DEBUG
|
|
|
|
printf("Skipped non-PCIe device %02x:%02x.%01x\n", bus, dev, fn);
|
|
|
|
#endif
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("\nPCIe %02x:%02x.%01x extended config space:", bus, dev, fn);
|
|
|
|
for (i = 0; i < 4096; i++) {
|
|
|
|
if((i % 0x10) == 0)
|
|
|
|
printf("\n%04x:", i);
|
|
|
|
printf(" %02x", *(pciexbar+devbase+i));
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-04 16:18:20 +01:00
|
|
|
unmap_physical((void *)pciexbar, (max_busses * 1024 * 1024));
|
2008-08-20 15:41:24 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|