DynamicTablesPkg: Add OEM Info

Added option for OEMs to provide OEM Table ID and
OEM Revision for ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
This commit is contained in:
Sami Mujawar
2019-02-14 11:01:20 +00:00
parent 1d49a75367
commit c788bdaba4
10 changed files with 46 additions and 16 deletions

View File

@@ -342,7 +342,7 @@ BuildDbg2Table (
CfgMgrProtocol,
This,
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
sizeof (DBG2_TABLE)
);
if (EFI_ERROR (Status)) {

View File

@@ -537,7 +537,7 @@ BuildFadtTable (
CfgMgrProtocol,
This,
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
sizeof (EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE)
);
if (EFI_ERROR (Status)) {

View File

@@ -518,7 +518,7 @@ BuildGtdtTable (
CfgMgrProtocol,
This,
&Gtdt->Header,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
TableSize
);
if (EFI_ERROR (Status)) {

View File

@@ -1798,7 +1798,7 @@ BuildIortTable (
CfgMgrProtocol,
This,
&Iort->Header,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
TableSize
);
if (EFI_ERROR (Status)) {

View File

@@ -569,7 +569,7 @@ BuildMadtTable (
CfgMgrProtocol,
This,
&Madt->Header,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
TableSize
);
if (EFI_ERROR (Status)) {

View File

@@ -220,7 +220,7 @@ BuildMcfgTable (
CfgMgrProtocol,
This,
&Mcfg->Header,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
TableSize
);
if (EFI_ERROR (Status)) {

View File

@@ -211,7 +211,7 @@ BuildSpcrTable (
CfgMgrProtocol,
This,
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr,
AcpiTableInfo->AcpiTableRevision,
AcpiTableInfo,
sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE)
);
if (EFI_ERROR (Status)) {

View File

@@ -100,7 +100,7 @@ GetCgfMgrInfo (
@param [in] Generator Pointer to the ACPI table Generator.
@param [in,out] AcpiHeader Pointer to the ACPI table header to be
updated.
@param [in] Revision Revision of the ACPI table.
@param [in] AcpiTableInfo Pointer to the ACPI table info structure.
@param [in] Length Length of the ACPI table.
@retval EFI_SUCCESS The ACPI table is updated successfully.
@@ -116,7 +116,7 @@ AddAcpiHeader (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
IN CONST UINT32 Revision,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
IN CONST UINT32 Length
)
{
@@ -151,7 +151,7 @@ AddAcpiHeader (
// UINT32 Length
AcpiHeader->Length = Length;
// UINT8 Revision
AcpiHeader->Revision = Revision;
AcpiHeader->Revision = AcpiTableInfo->AcpiTableRevision;
// UINT8 Checksum
AcpiHeader->Checksum = 0;
@@ -159,12 +159,24 @@ AddAcpiHeader (
CopyMem (AcpiHeader->OemId, CfgMfrInfo->OemId, sizeof (AcpiHeader->OemId));
// UINT64 OemTableId
AcpiHeader->OemTableId = Generator->CreatorId;
AcpiHeader->OemTableId <<= 32;
AcpiHeader->OemTableId |= Generator->AcpiTableSignature;
if (AcpiTableInfo->OemTableId != 0) {
AcpiHeader->OemTableId = AcpiTableInfo->OemTableId;
} else {
AcpiHeader->OemTableId = SIGNATURE_32 (
CfgMfrInfo->OemId[0],
CfgMfrInfo->OemId[1],
CfgMfrInfo->OemId[2],
CfgMfrInfo->OemId[3]
) |
((UINT64)Generator->AcpiTableSignature << 32);
}
// UINT32 OemRevision
AcpiHeader->OemRevision = CfgMfrInfo->Revision;
if (AcpiTableInfo->OemRevision != 0) {
AcpiHeader->OemRevision = AcpiTableInfo->OemRevision;
} else {
AcpiHeader->OemRevision = CfgMfrInfo->Revision;
}
// UINT32 CreatorId
AcpiHeader->CreatorId = Generator->CreatorId;