diff options
author | Robert Moore <Robert.Moore@intel.com> | 2022-01-27 13:38:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 13:38:16 -0800 |
commit | bcc26083d5ecde3e3d90946134b68d308de29aec (patch) | |
tree | 02f3c9d339641176e00c6e5dbe5603dc9e332e49 | |
parent | 3d944bdff041ce338da25573b27630fd79fad0fb (diff) | |
parent | d9798f5275bb20ab88ac854ba04e6e3bdb22cf6d (diff) | |
download | acpica-bcc26083d5ecde3e3d90946134b68d308de29aec.tar.gz |
Merge pull request #742 from MasterDrogo/add-cedt-subtable_CFMWS
Add the sub-table CFMWS to the CEDT table
-rw-r--r-- | source/common/dmtbdump1.c | 42 | ||||
-rw-r--r-- | source/common/dmtbinfo1.c | 22 | ||||
-rw-r--r-- | source/compiler/dttable1.c | 65 | ||||
-rw-r--r-- | source/compiler/dttemplate.h | 65 | ||||
-rw-r--r-- | source/include/acdisasm.h | 2 | ||||
-rw-r--r-- | source/include/actbinfo.h | 2 | ||||
-rw-r--r-- | source/include/actbl1.h | 5 |
7 files changed, 164 insertions, 39 deletions
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c index fd5e2fd99..8d6768747 100644 --- a/source/common/dmtbdump1.c +++ b/source/common/dmtbdump1.c @@ -567,7 +567,6 @@ AcpiDmDumpCedt ( 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) */ @@ -588,35 +587,50 @@ AcpiDmDumpCedt ( switch (Subtable->Type) { case ACPI_CEDT_TYPE_CHBS: + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedt0); + if (ACPI_FAILURE (Status)) { + return; + } + break; + + case ACPI_CEDT_TYPE_CFMWS: { + ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; + unsigned int i, max = 0x01 << (ptr->InterleaveWays); + + // print out table with first "Interleave target" + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedt1); + if (ACPI_FAILURE (Status)) { + return; + } - InfoTable = AcpiDmTableInfoCedt0; + // Now, print out any interleave targets beyond the first. + for (i = 1; i < max; i++) { + unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); + unsigned int *trg = &(ptr->InterleaveTargets[i]); + Status = AcpiDmDumpTable (Length, loc_offset, trg, + Subtable->Length, AcpiDmTableInfoCedt1_te); + if (ACPI_FAILURE (Status)) { + return; + } + } 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 b30cafa9f..b54bac562 100644 --- a/source/common/dmtbinfo1.c +++ b/source/common/dmtbinfo1.c @@ -521,6 +521,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = ACPI_DMT_TERMINATOR }; +/* 1: CXL Fixed Memory Window Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] = +{ + {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0}, + {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Restrictions), "Restrictions", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (QtgId), "QtgId", 0}, + {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (InterleaveTargets), "First Target", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] = +{ + {ACPI_DMT_UINT32, ACPI_CEDT1_TE_OFFSET (InterleaveTarget), "Next Target", 0}, + ACPI_DMT_TERMINATOR +}; /******************************************************************************* * diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c index 2e6a85691..4718c1ab6 100644 --- a/source/compiler/dttable1.c +++ b/source/compiler/dttable1.c @@ -587,6 +587,7 @@ DtCompileCedt ( while (*PFieldList) { + int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later SubtableStart = *PFieldList; /* CEDT Header */ @@ -607,25 +608,69 @@ DtCompileCedt ( switch (CedtHeader->Type) { case ACPI_CEDT_TYPE_CHBS: + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + case ACPI_CEDT_TYPE_CFMWS: { + unsigned char *dump; + unsigned int idx, offset, max = 0; + + // Compile table with first "Interleave target" + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + // Look in buffer for the number of targets + offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); + dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1 + max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX + if (max > 8) max=1; // Error in encoding Interleaving Ways. + if (max == 1) // if only one target, then break here. + break; // break if only one target. + + // We need to add more interleave targets, so write the current Subtable. + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in + DtPushSubtable (Subtable); // the targets > the first. + + // Now, find out all interleave targets beyond the first. + for (idx = 1; idx < max; idx++) { + ParentTable = DtPeekSubtable (); + + if (*PFieldList) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1_te, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (Subtable) + { + DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table. + InsertFlag = 0; + } + } + } + DtPopSubtable (); + ParentTable = DtPeekSubtable (); 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); + if (InsertFlag == 1) { + DtInsertSubtable (ParentTable, Subtable); + } DtPopSubtable (); } diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index e9272f3ae..8450d1c1f 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -320,23 +320,58 @@ const unsigned char TemplateBoot[] = const unsigned char TemplateCedt[] = { - 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#.." */ + 0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */ + 0x01,0x87,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ + 0x17,0x12,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ + 0x00,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000028 ".^......" */ + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000038 "..... .." */ 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#.." */ + 0x01,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".^......" */ + 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000050 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000058 "..... .." */ 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 "...." */ + 0x02,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".^......" */ + 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, /* 00000070 ".....0.." */ + 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000078 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000080 "...... ." */ + 0x03,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000088 ".^......" */ + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 00000090 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000098 "..... .." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x00, /* 000000a0 "......(." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */ + 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000c0 "........" */ + 0x00,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000c8 ".^....(." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */ + 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000e8 "........" */ + 0x01,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000f0 ".^....(." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ + 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000110 "........" */ + 0x02,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 00000118 ".^....(." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000138 "........" */ + 0x03,0x5e,0xba,0x00,0x01,0x00,0x2c,0x00, /* 00000140 ".^....,." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ + 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ + 0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ + 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000160 "........" */ + 0x00,0x5e,0xba,0x00,0x01,0x5e,0xba,0x00, /* 00000160 ".^...^.." */ + 0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x00, /* 00000170 "..,....." */ + 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000180 "........" */ + 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000188 "........" */ + 0x0a,0x00,0x01,0x00,0x02,0x5e,0xba,0x00, /* 00000190 ".....^.." */ + 0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */ }; const unsigned char TemplateCpep[] = diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index c3d429152..cd36ca2a6 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -402,6 +402,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h index ff7c0c15e..cb9c34f13 100644 --- a/source/include/actbinfo.h +++ b/source/include/actbinfo.h @@ -234,6 +234,8 @@ #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_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f) +#define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, 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 09e68293a..ea486d905 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -574,6 +574,11 @@ typedef struct acpi_cedt_cfmws } ACPI_CEDT_CFMWS; +typedef struct acpi_cedt_cfmws_target_element +{ + UINT32 InterleaveTarget; +} ACPI_CEDT_CFMWS_TARGET_ELEMENT; + /* Values for Interleave Arithmetic field above */ #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) |