Blame SOURCES/CEDT-support_01.patch

ed51cc
commit 0b03aa8ebd7a5b2b9407893f123ee587af45926f
ed51cc
Author: Ben Widawsky <ben@bwidawsk.net>
ed51cc
Date:   Thu Feb 25 13:54:56 2021 -0800
ed51cc
ed51cc
    CXL 2.0: CEDT: Add new CEDT table
ed51cc
    
ed51cc
    This sets up all of the boilerplate without actually doing anything.
ed51cc
    
ed51cc
    Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
ed51cc
ed51cc
diff --git a/source/common/ahtable.c b/source/common/ahtable.c
ed51cc
index a313c7f..2679fae 100644
ed51cc
--- a/source/common/ahtable.c
ed51cc
+++ b/source/common/ahtable.c
ed51cc
@@ -95,6 +95,7 @@ const AH_TABLE      Gbl_AcpiSupportedTables[] =
ed51cc
     {ACPI_SIG_BERT, "Boot Error Record Table"},
ed51cc
     {ACPI_SIG_BGRT, "Boot Graphics Resource Table"},
ed51cc
     {ACPI_SIG_BOOT, "Simple Boot Flag Table"},
ed51cc
+    {ACPI_SIG_CEDT, "CXL Early Discovery Table"},
ed51cc
     {ACPI_SIG_CPEP, "Corrected Platform Error Polling table"},
ed51cc
     {ACPI_SIG_CSRT, "Core System Resource Table"},
ed51cc
     {ACPI_SIG_DBG2, "Debug Port table type 2"},
ed51cc
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
ed51cc
index 0908e44..137b5b9 100644
ed51cc
--- a/source/common/dmtable.c
ed51cc
+++ b/source/common/dmtable.c
ed51cc
@@ -376,6 +376,7 @@ const ACPI_DMTABLE_DATA     AcpiDmTableData[] =
ed51cc
     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert},
ed51cc
     {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt},
ed51cc
     {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot},
ed51cc
+    {ACPI_SIG_CEDT, NULL,                   NULL,           NULL,           NULL},
ed51cc
     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep},
ed51cc
     {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt},
ed51cc
     {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2},
ed51cc
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
ed51cc
index 4adb42a..cb41915 100644
ed51cc
--- a/source/common/dmtbinfo1.c
ed51cc
+++ b/source/common/dmtbinfo1.c
ed51cc
@@ -236,6 +236,33 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoBoot[] =
ed51cc
 };
ed51cc
 
ed51cc
 
ed51cc
+/*******************************************************************************
ed51cc
+ *
ed51cc
+ * CEDT - CXL Early Discovery Table
ed51cc
+ *
ed51cc
+ ******************************************************************************/
ed51cc
+
ed51cc
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCedtHdr[] =
ed51cc
+{
ed51cc
+    {ACPI_DMT_UINT8,    ACPI_CEDT_OFFSET (Type),               "Subtable Type", 0},
ed51cc
+    {ACPI_DMT_UINT8,    ACPI_CEDT_OFFSET (Reserved),           "Reserved", 0},
ed51cc
+    {ACPI_DMT_UINT16,   ACPI_CEDT_OFFSET (Length),             "Length", DT_LENGTH},
ed51cc
+    ACPI_DMT_TERMINATOR
ed51cc
+};
ed51cc
+
ed51cc
+/* 0: CXL Host Bridge Structure */
ed51cc
+
ed51cc
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCedt0[] =
ed51cc
+{
ed51cc
+    {ACPI_DMT_UINT32,   ACPI_CEDT0_OFFSET (Uid),               "Associated host bridge", 0},
ed51cc
+    {ACPI_DMT_UINT32,   ACPI_CEDT0_OFFSET (CxlVersion),        "Specification version", 0},
ed51cc
+    {ACPI_DMT_UINT32,   ACPI_CEDT0_OFFSET (Reserved),          "Reserved", 0},
ed51cc
+    {ACPI_DMT_UINT64,   ACPI_CEDT0_OFFSET (Base),              "Register base", 0},
ed51cc
+    {ACPI_DMT_UINT64,   ACPI_CEDT0_OFFSET (Length),            "Register length", 0},
ed51cc
+    ACPI_DMT_TERMINATOR
ed51cc
+};
ed51cc
+
ed51cc
+
ed51cc
 /*******************************************************************************
ed51cc
  *
ed51cc
  * CPEP - Corrected Platform Error Polling table
ed51cc
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
ed51cc
index e9b7a48..5e94ee3 100644
ed51cc
--- a/source/include/acdisasm.h
ed51cc
+++ b/source/include/acdisasm.h
ed51cc
@@ -256,6 +256,8 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoAsfHdr[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoBoot[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoBert[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoBgrt[];
ed51cc
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCedtHdr[];
ed51cc
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCedt0[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCpep[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCpep0[];
ed51cc
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCsrt0[];
ed51cc
diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h
ed51cc
index 8a1fd74..9735f22 100644
ed51cc
--- a/source/include/actbinfo.h
ed51cc
+++ b/source/include/actbinfo.h
ed51cc
@@ -104,6 +104,8 @@
ed51cc
 #define ACPI_ASF2a_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
ed51cc
 #define ACPI_ASF3_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
ed51cc
 #define ACPI_ASF4_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
ed51cc
+#define ACPI_CEDT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f)
ed51cc
+#define ACPI_CEDT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f)
ed51cc
 #define ACPI_CPEP0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
ed51cc
 #define ACPI_CSRT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
ed51cc
 #define ACPI_CSRT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
ed51cc
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
ed51cc
index b76195f..ce4737d 100644
ed51cc
--- a/source/include/actbl1.h
ed51cc
+++ b/source/include/actbl1.h
ed51cc
@@ -64,6 +64,7 @@
ed51cc
 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
ed51cc
 #define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
ed51cc
 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
ed51cc
+#define ACPI_SIG_CEDT           "CEDT"      /* CXL Early Discovery Table */
ed51cc
 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
ed51cc
 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
ed51cc
 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
ed51cc
@@ -383,6 +384,56 @@ typedef struct acpi_table_boot
ed51cc
 
ed51cc
 } ACPI_TABLE_BOOT;
ed51cc
 
ed51cc
+/*******************************************************************************
ed51cc
+ *
ed51cc
+ * CEDT - CXL Early Discovery Table
ed51cc
+ *        Version 1
ed51cc
+ *
ed51cc
+ * Conforms to the "CXL Early Discovery Table" (CXL 2.0)
ed51cc
+ *
ed51cc
+ ******************************************************************************/
ed51cc
+
ed51cc
+typedef struct acpi_table_cedt
ed51cc
+{
ed51cc
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
ed51cc
+
ed51cc
+} ACPI_TABLE_CEDT;
ed51cc
+
ed51cc
+/* CEDT subtable header (Performance Record Structure) */
ed51cc
+
ed51cc
+typedef struct acpi_cedt_header
ed51cc
+{
ed51cc
+    UINT8                   Type;
ed51cc
+    UINT8                   Reserved;
ed51cc
+    UINT16                  Length;
ed51cc
+
ed51cc
+} ACPI_CEDT_HEADER;
ed51cc
+
ed51cc
+/* Values for Type field above */
ed51cc
+
ed51cc
+enum AcpiCedtType
ed51cc
+{
ed51cc
+    ACPI_CEDT_TYPE_CHBS                 = 0,
ed51cc
+};
ed51cc
+
ed51cc
+
ed51cc
+/*
ed51cc
+ * CEDT subtables
ed51cc
+ */
ed51cc
+
ed51cc
+/* 0: CXL Host Bridge Structure */
ed51cc
+
ed51cc
+typedef struct acpi_cedt_chbs
ed51cc
+{
ed51cc
+    ACPI_CEDT_HEADER        Header;
ed51cc
+    UINT32                  Uid;
ed51cc
+    UINT32                  CxlVersion;
ed51cc
+    UINT32                  Reserved;
ed51cc
+    UINT64                  Base;
ed51cc
+    UINT64                  Length;
ed51cc
+
ed51cc
+} ACPI_CEDT_CHBS;
ed51cc
+
ed51cc
 
ed51cc
 /*******************************************************************************
ed51cc
  *
ed51cc
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
ed51cc
index ef74f17..8aa35fe 100644
ed51cc
--- a/source/tools/acpisrc/astable.c
ed51cc
+++ b/source/tools/acpisrc/astable.c
ed51cc
@@ -529,6 +529,7 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
ed51cc
     {"ACPI_TABLE_BERT",                     SRC_TYPE_STRUCT},
ed51cc
     {"ACPI_TABLE_BGRT",                     SRC_TYPE_STRUCT},
ed51cc
     {"ACPI_TABLE_BOOT",                     SRC_TYPE_STRUCT},
ed51cc
+    {"ACPI_TABLE_CEDT",                     SRC_TYPE_STRUCT},
ed51cc
     {"ACPI_TABLE_CPEP",                     SRC_TYPE_STRUCT},
ed51cc
     {"ACPI_TABLE_CSRT",                     SRC_TYPE_STRUCT},
ed51cc
     {"ACPI_TABLE_DBG2",                     SRC_TYPE_STRUCT},