mirror of https://github.com/acidanthera/audk.git
DynamicTablesPkg: Add OEM Info
This patch originally merged in edk2 master atc788bdaba4
. However, this was later reverted atbdbbedea94
as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. Added option for OEMs to provide OEM Table ID and OEM Revision for ACPI tables. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> 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:
parent
98a4a7a99b
commit
e12bdeb1c2
|
@ -45,7 +45,7 @@ GetCgfMgrInfo (
|
||||||
@param [in] Generator Pointer to the ACPI table Generator.
|
@param [in] Generator Pointer to the ACPI table Generator.
|
||||||
@param [in,out] AcpiHeader Pointer to the ACPI table header to be
|
@param [in,out] AcpiHeader Pointer to the ACPI table header to be
|
||||||
updated.
|
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.
|
@param [in] Length Length of the ACPI table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The ACPI table is updated successfully.
|
@retval EFI_SUCCESS The ACPI table is updated successfully.
|
||||||
|
@ -61,7 +61,7 @@ AddAcpiHeader (
|
||||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||||
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
|
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
|
||||||
IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
|
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
|
IN CONST UINT32 Length
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,24 @@ typedef struct CmAStdObjAcpiTableInfo {
|
||||||
/// Optional pointer to the ACPI table data
|
/// Optional pointer to the ACPI table data
|
||||||
EFI_ACPI_DESCRIPTION_HEADER * AcpiTableData;
|
EFI_ACPI_DESCRIPTION_HEADER * AcpiTableData;
|
||||||
|
|
||||||
|
/// An OEM-supplied string that the OEM uses to identify the particular
|
||||||
|
/// data table. This field is particularly useful when defining a definition
|
||||||
|
/// block to distinguish definition block functions. The OEM assigns each
|
||||||
|
/// dissimilar table a new OEM Table ID.
|
||||||
|
/// This field could be constructed using the SIGNATURE_64() macro.
|
||||||
|
/// e.g. SIGNATURE_64 ('A','R','M','H','G','T','D','T')
|
||||||
|
/// Note: If this field is not populated (has value of Zero), then the
|
||||||
|
/// Generators shall populate this information using part of the
|
||||||
|
/// CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.OemId field and the
|
||||||
|
/// ACPI table signature.
|
||||||
|
UINT64 OemTableId;
|
||||||
|
|
||||||
|
/// An OEM-supplied revision number. Larger numbers are assumed to be
|
||||||
|
/// newer revisions.
|
||||||
|
/// Note: If this field is not populated (has value of Zero), then the
|
||||||
|
/// Generators shall populate this information using the revision of the
|
||||||
|
/// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
|
||||||
|
UINT32 OemRevision;
|
||||||
} CM_STD_OBJ_ACPI_TABLE_INFO;
|
} CM_STD_OBJ_ACPI_TABLE_INFO;
|
||||||
|
|
||||||
/** A structure used to describe the SMBIOS table generators to be invoked.
|
/** A structure used to describe the SMBIOS table generators to be invoked.
|
||||||
|
|
|
@ -342,7 +342,7 @@ BuildDbg2Table (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2,
|
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
sizeof (DBG2_TABLE)
|
sizeof (DBG2_TABLE)
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -537,7 +537,7 @@ BuildFadtTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
|
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
sizeof (EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE)
|
sizeof (EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE)
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -518,7 +518,7 @@ BuildGtdtTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
&Gtdt->Header,
|
&Gtdt->Header,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
TableSize
|
TableSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -1798,7 +1798,7 @@ BuildIortTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
&Iort->Header,
|
&Iort->Header,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
TableSize
|
TableSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -569,7 +569,7 @@ BuildMadtTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
&Madt->Header,
|
&Madt->Header,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
TableSize
|
TableSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -220,7 +220,7 @@ BuildMcfgTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
&Mcfg->Header,
|
&Mcfg->Header,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
TableSize
|
TableSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -211,7 +211,7 @@ BuildSpcrTable (
|
||||||
CfgMgrProtocol,
|
CfgMgrProtocol,
|
||||||
This,
|
This,
|
||||||
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr,
|
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr,
|
||||||
AcpiTableInfo->AcpiTableRevision,
|
AcpiTableInfo,
|
||||||
sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE)
|
sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE)
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ GetCgfMgrInfo (
|
||||||
@param [in] Generator Pointer to the ACPI table Generator.
|
@param [in] Generator Pointer to the ACPI table Generator.
|
||||||
@param [in,out] AcpiHeader Pointer to the ACPI table header to be
|
@param [in,out] AcpiHeader Pointer to the ACPI table header to be
|
||||||
updated.
|
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.
|
@param [in] Length Length of the ACPI table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The ACPI table is updated successfully.
|
@retval EFI_SUCCESS The ACPI table is updated successfully.
|
||||||
|
@ -116,7 +116,7 @@ AddAcpiHeader (
|
||||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||||
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
|
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
|
||||||
IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
|
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
|
IN CONST UINT32 Length
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ AddAcpiHeader (
|
||||||
// UINT32 Length
|
// UINT32 Length
|
||||||
AcpiHeader->Length = Length;
|
AcpiHeader->Length = Length;
|
||||||
// UINT8 Revision
|
// UINT8 Revision
|
||||||
AcpiHeader->Revision = Revision;
|
AcpiHeader->Revision = AcpiTableInfo->AcpiTableRevision;
|
||||||
// UINT8 Checksum
|
// UINT8 Checksum
|
||||||
AcpiHeader->Checksum = 0;
|
AcpiHeader->Checksum = 0;
|
||||||
|
|
||||||
|
@ -159,12 +159,24 @@ AddAcpiHeader (
|
||||||
CopyMem (AcpiHeader->OemId, CfgMfrInfo->OemId, sizeof (AcpiHeader->OemId));
|
CopyMem (AcpiHeader->OemId, CfgMfrInfo->OemId, sizeof (AcpiHeader->OemId));
|
||||||
|
|
||||||
// UINT64 OemTableId
|
// UINT64 OemTableId
|
||||||
AcpiHeader->OemTableId = Generator->CreatorId;
|
if (AcpiTableInfo->OemTableId != 0) {
|
||||||
AcpiHeader->OemTableId <<= 32;
|
AcpiHeader->OemTableId = AcpiTableInfo->OemTableId;
|
||||||
AcpiHeader->OemTableId |= Generator->AcpiTableSignature;
|
} else {
|
||||||
|
AcpiHeader->OemTableId = SIGNATURE_32 (
|
||||||
|
CfgMfrInfo->OemId[0],
|
||||||
|
CfgMfrInfo->OemId[1],
|
||||||
|
CfgMfrInfo->OemId[2],
|
||||||
|
CfgMfrInfo->OemId[3]
|
||||||
|
) |
|
||||||
|
((UINT64)Generator->AcpiTableSignature << 32);
|
||||||
|
}
|
||||||
|
|
||||||
// UINT32 OemRevision
|
// UINT32 OemRevision
|
||||||
|
if (AcpiTableInfo->OemRevision != 0) {
|
||||||
|
AcpiHeader->OemRevision = AcpiTableInfo->OemRevision;
|
||||||
|
} else {
|
||||||
AcpiHeader->OemRevision = CfgMfrInfo->Revision;
|
AcpiHeader->OemRevision = CfgMfrInfo->Revision;
|
||||||
|
}
|
||||||
|
|
||||||
// UINT32 CreatorId
|
// UINT32 CreatorId
|
||||||
AcpiHeader->CreatorId = Generator->CreatorId;
|
AcpiHeader->CreatorId = Generator->CreatorId;
|
||||||
|
|
Loading…
Reference in New Issue