Blame SOURCES/CEDT-support_01.patch

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