diff --git a/source/common/dmtable.c b/source/common/dmtable.c index 47fc40d464..d8ef678d2a 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -184,6 +184,12 @@ static const char *AcpiDmAsfSubnames[] = "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmCedtSubnames[] = +{ + "CXL Host Bridge Structure", + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmDmarSubnames[] = { "Hardware Unit Definition", @@ -494,7 +500,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_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, @@ -948,6 +954,7 @@ AcpiDmDumpTable ( case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: case ACPI_DMT_ACCWIDTH: + case ACPI_DMT_CEDT: case ACPI_DMT_IVRS: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: @@ -1370,6 +1377,20 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]); break; + case ACPI_DMT_CEDT: + + /* CEDT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_CEDT_TYPE_RESERVED) + { + Temp8 = ACPI_CEDT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmCedtSubnames[Temp8]); + break; + case ACPI_DMT_DMAR: /* DMAR subtable types */ diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c index 936a930a54..ea545f53a5 100644 --- a/source/common/dmtbinfo1.c +++ b/source/common/dmtbinfo1.c @@ -352,7 +352,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = { - {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_CEDT, 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 diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index 62bb0786c5..f2d006440d 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -573,6 +573,10 @@ ACPI_STATUS DtCompileCpep ( void **PFieldList); +ACPI_STATUS +DtCompileCedt ( + void **PFieldList); + ACPI_STATUS DtCompileCsrt ( void **PFieldList); diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c index 286ecaa7fe..222eb27335 100644 --- a/source/compiler/dttable1.c +++ b/source/compiler/dttable1.c @@ -342,6 +342,80 @@ DtCompileAsf ( } +/****************************************************************************** + * + * FUNCTION: DtCompileCedt + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile CEDT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileCedt ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + ACPI_CEDT_HEADER *CedtHeader; + DT_FIELD *SubtableStart; + + + /* Walk the parse tree */ + + while (*PFieldList) + { + SubtableStart = *PFieldList; + + /* CEDT Header */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedtHdr, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + CedtHeader = ACPI_CAST_PTR (ACPI_CEDT_HEADER, Subtable->Buffer); + + switch (CedtHeader->Type) + { + case ACPI_CEDT_TYPE_CHBS: + + break; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); + return (AE_ERROR); + } + + /* CEDT Subtable */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPopSubtable (); + } + + return (AE_OK); +} + + /****************************************************************************** * * FUNCTION: DtCompileCpep diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index a948579976..85bab9e82b 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -206,16 +206,23 @@ const unsigned char TemplateBoot[] = 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 "...." */ + 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */ + 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ + 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */ + 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */ + 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ + 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */ + 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */ + 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ + 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */ + 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */ + 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */ + 0x00,0x00,0x00,0x00 /* 00000080 "...." */ }; const unsigned char TemplateCpep[] = diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c index a02994953d..996cb2eb39 100644 --- a/source/compiler/dtutils.c +++ b/source/compiler/dtutils.c @@ -574,6 +574,7 @@ DtGetFieldLength ( case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: case ACPI_DMT_ACCWIDTH: + case ACPI_DMT_CEDT: case ACPI_DMT_IVRS: case ACPI_DMT_GTDT: case ACPI_DMT_MADT: diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index ded9923ee7..be102cea82 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -251,6 +251,7 @@ typedef enum /* Types that are specific to particular ACPI tables */ ACPI_DMT_ASF, + ACPI_DMT_CEDT, ACPI_DMT_DMAR, ACPI_DMT_DMAR_SCOPE, ACPI_DMT_EINJACT, diff --git a/source/include/actbl1.h b/source/include/actbl1.h index f1847f7984..437a122b1a 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -492,6 +492,7 @@ typedef struct acpi_table_boot } ACPI_TABLE_BOOT; + /******************************************************************************* * * CEDT - CXL Early Discovery Table @@ -522,6 +523,7 @@ typedef struct acpi_cedt_header enum AcpiCedtType { ACPI_CEDT_TYPE_CHBS = 0, + ACPI_CEDT_TYPE_RESERVED = 1 }; diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 37679be1be..3438f13af7 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -648,6 +648,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, {"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT}, {"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT}, {"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT}, @@ -710,6 +711,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_ASF_REMOTE", SRC_TYPE_STRUCT}, {"ACPI_ASF_RMCP", SRC_TYPE_STRUCT}, {"ACPI_BERT_REGION", SRC_TYPE_STRUCT}, + {"ACPI_CEDT_CHBS", SRC_TYPE_STRUCT}, + {"ACPI_CEDT_HEADER", SRC_TYPE_STRUCT}, {"ACPI_CPEP_POLLING", SRC_TYPE_STRUCT}, {"ACPI_CSRT_GROUP", SRC_TYPE_STRUCT}, {"ACPI_CSRT_DESCRIPTOR", SRC_TYPE_STRUCT},