mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
EmbeddedPkg/DtPlatformDxe: Add DT/ACPI Default Flexibility
Add a PCD to govern whether to use DT or ACPI in case the variable governing this is not found or is not valid. Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
3a63c17ebc
commit
601a18bf08
@ -124,18 +124,21 @@ DtPlatformDxeEntryPoint (
|
|||||||
Status = gRT->GetVariable(DT_ACPI_VARIABLE_NAME, &gDtPlatformFormSetGuid,
|
Status = gRT->GetVariable(DT_ACPI_VARIABLE_NAME, &gDtPlatformFormSetGuid,
|
||||||
NULL, &BufferSize, &DtAcpiPref);
|
NULL, &BufferSize, &DtAcpiPref);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to DT\n",
|
DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to %a\n",
|
||||||
__FUNCTION__));
|
__FUNCTION__, PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"));
|
||||||
DtAcpiPref.Pref = DT_ACPI_SELECT_DT;
|
DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
|
||||||
|
: DT_ACPI_SELECT_ACPI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EFI_ERROR (Status) &&
|
if (!EFI_ERROR (Status) &&
|
||||||
DtAcpiPref.Pref != DT_ACPI_SELECT_ACPI &&
|
DtAcpiPref.Pref != DT_ACPI_SELECT_ACPI &&
|
||||||
DtAcpiPref.Pref != DT_ACPI_SELECT_DT) {
|
DtAcpiPref.Pref != DT_ACPI_SELECT_DT) {
|
||||||
DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to DT\n",
|
DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to %a\n",
|
||||||
__FUNCTION__, DT_ACPI_VARIABLE_NAME));
|
__FUNCTION__, DT_ACPI_VARIABLE_NAME,
|
||||||
DtAcpiPref.Pref = DT_ACPI_SELECT_DT;
|
PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"));
|
||||||
|
DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
|
||||||
|
: DT_ACPI_SELECT_ACPI;
|
||||||
Status = EFI_INVALID_PARAMETER; // trigger setvar below
|
Status = EFI_INVALID_PARAMETER; // trigger setvar below
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,9 @@
|
|||||||
gEdkiiPlatformHasAcpiGuid
|
gEdkiiPlatformHasAcpiGuid
|
||||||
gFdtTableGuid
|
gFdtTableGuid
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdDefaultDtPref
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiVariableArchProtocolGuid AND
|
gEfiVariableArchProtocolGuid AND
|
||||||
gEfiVariableWriteArchProtocolGuid
|
gEfiVariableWriteArchProtocolGuid
|
||||||
|
@ -185,3 +185,8 @@
|
|||||||
# truncation on overflow to specify negative offsets.
|
# truncation on overflow to specify negative offsets.
|
||||||
#
|
#
|
||||||
gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x0|UINT64|0x0000058
|
gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x0|UINT64|0x0000058
|
||||||
|
|
||||||
|
#
|
||||||
|
# Selection between DT and ACPI as a default
|
||||||
|
#
|
||||||
|
gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x0000059
|
||||||
|
Loading…
x
Reference in New Issue
Block a user