diff options
author | Robert Moore <Robert.Moore@intel.com> | 2021-03-10 12:46:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 12:46:14 -0800 |
commit | 018fd93aaad8abcc08e0fa9691bacabc4fa3bfd7 (patch) | |
tree | 4619ce63bd3f037da0088d9bc6781a416feee15c | |
parent | d3eb8cbb54723c1294f5bec36f7f83c5993783af (diff) | |
parent | 187e2f286f503cce9f57748da639dfccaeaecf96 (diff) | |
download | acpica-018fd93aaad8abcc08e0fa9691bacabc4fa3bfd7.tar.gz |
Merge pull request #669 from bwidawsk/cedt
Add CEDT support (from CXL 2.0)
-rw-r--r-- | source/common/ahtable.c | 1 | ||||
-rw-r--r-- | source/common/dmtable.c | 5 | ||||
-rw-r--r-- | source/common/dmtbdump1.c | 76 | ||||
-rw-r--r-- | source/common/dmtbinfo1.c | 27 | ||||
-rw-r--r-- | source/compiler/dtcompiler.h | 1 | ||||
-rw-r--r-- | source/compiler/dttemplate.h | 14 | ||||
-rw-r--r-- | source/include/acdisasm.h | 6 | ||||
-rw-r--r-- | source/include/actbinfo.h | 2 | ||||
-rw-r--r-- | source/include/actbl1.h | 51 | ||||
-rw-r--r-- | source/tools/acpisrc/astable.c | 1 |
10 files changed, 182 insertions, 2 deletions
diff --git a/source/common/ahtable.c b/source/common/ahtable.c index ac3c416bb..9666aed37 100644 --- a/source/common/ahtable.c +++ b/source/common/ahtable.c @@ -203,6 +203,7 @@ const AH_TABLE AcpiGbl_SupportedTables[] = {ACPI_SIG_BERT, "Boot Error Record Table"}, {ACPI_SIG_BGRT, "Boot Graphics Resource Table"}, {ACPI_SIG_BOOT, "Simple Boot Flag Table"}, + {ACPI_SIG_CEDT, "CXL Early Discovery Table"}, {ACPI_SIG_CPEP, "Corrected Platform Error Polling table"}, {ACPI_SIG_CSRT, "Core System Resource Table"}, {ACPI_SIG_DBG2, "Debug Port table type 2"}, diff --git a/source/common/dmtable.c b/source/common/dmtable.c index d602e1a30..77ff3a4f7 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -476,8 +476,8 @@ static const char *AcpiDmGasAccessWidth[] = * handler. This table must be NULL terminated. RSDP and FACS are * special-cased elsewhere. * - * Note: Any tables added here should be duplicated within AcpiSupportedTables - * in the file common/ahtable.c + * Note: Any tables added here should be duplicated within + * AcpiGbl_SupportedTables in the file common/ahtable.c * ******************************************************************************/ @@ -487,6 +487,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, + {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c index 72d667e97..8fc53acf4 100644 --- a/source/common/dmtbdump1.c +++ b/source/common/dmtbdump1.c @@ -329,6 +329,82 @@ AcpiDmDumpAsf ( } } +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpCedt + * + * PARAMETERS: Table - A CEDT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a CEDT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpCedt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_CEDT_HEADER *Subtable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_CEDT); + ACPI_DMTABLE_INFO *InfoTable; + + + /* There is no main table (other than the standard ACPI header) */ + + Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common subtable header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedtHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (Subtable->Type) + { + case ACPI_CEDT_TYPE_CHBS: + + InfoTable = AcpiDmTableInfoCedt0; + break; + + default: + + AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", + Subtable->Type); + + /* Attempt to continue */ + + if (!Subtable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubtable; + } + + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + +NextSubtable: + /* Point to next subtable */ + + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, + Subtable->Length); + } +} /******************************************************************************* * diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c index 9917853c1..936a930a5 100644 --- a/source/common/dmtbinfo1.c +++ b/source/common/dmtbinfo1.c @@ -346,6 +346,33 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = /******************************************************************************* * + * CEDT - CXL Early Discovery Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = +{ + {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +}; + +/* 0: CXL Host Bridge Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = +{ + {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Uid), "Associated host bridge", 0}, + {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (CxlVersion), "Specification version", 0}, + {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Base), "Register base", 0}, + {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Length), "Register length", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * CPEP - Corrected Platform Error Polling table * ******************************************************************************/ diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index 7bc403ebb..f0662b6a7 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -733,6 +733,7 @@ extern const unsigned char TemplateAsf[]; extern const unsigned char TemplateBoot[]; extern const unsigned char TemplateBert[]; extern const unsigned char TemplateBgrt[]; +extern const unsigned char TemplateCedt[]; extern const unsigned char TemplateCpep[]; extern const unsigned char TemplateCsrt[]; extern const unsigned char TemplateDbg2[]; diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index d2b1dd672..34db3092e 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -204,6 +204,20 @@ const unsigned char TemplateBoot[] = 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ }; +const unsigned char TemplateCedt[] = +{ + /* FIXME: This is from QEMU */ + 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */ + 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */ + 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */ + 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00 /* 00000040 "...." */ +}; + const unsigned char TemplateCpep[] = { 0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */ diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 2703d5e90..0741da176 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -365,6 +365,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; @@ -649,6 +651,10 @@ AcpiDmDumpAsf ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpCedt ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table); diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h index e2ae28370..332bb85cf 100644 --- a/source/include/actbinfo.h +++ b/source/include/actbinfo.h @@ -213,6 +213,8 @@ #define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) #define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) +#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) +#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) diff --git a/source/include/actbl1.h b/source/include/actbl1.h index ef97f3cb9..f1847f798 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -172,6 +172,7 @@ #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ +#define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */ #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ @@ -491,6 +492,56 @@ typedef struct acpi_table_boot } ACPI_TABLE_BOOT; +/******************************************************************************* + * + * CEDT - CXL Early Discovery Table + * Version 1 + * + * Conforms to the "CXL Early Discovery Table" (CXL 2.0) + * + ******************************************************************************/ + +typedef struct acpi_table_cedt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_CEDT; + +/* CEDT subtable header (Performance Record Structure) */ + +typedef struct acpi_cedt_header +{ + UINT8 Type; + UINT8 Reserved; + UINT16 Length; + +} ACPI_CEDT_HEADER; + +/* Values for Type field above */ + +enum AcpiCedtType +{ + ACPI_CEDT_TYPE_CHBS = 0, +}; + + +/* + * CEDT subtables + */ + +/* 0: CXL Host Bridge Structure */ + +typedef struct acpi_cedt_chbs +{ + ACPI_CEDT_HEADER Header; + UINT32 Uid; + UINT32 CxlVersion; + UINT32 Reserved; + UINT64 Base; + UINT64 Length; + +} ACPI_CEDT_CHBS; + /******************************************************************************* * diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 6a6950c82..5f7d9af35 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -641,6 +641,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_BERT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, |