diff options
author | Ashish Singhal <ashishsingha@nvidia.com> | 2019-11-04 10:49:31 -0700 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2019-11-07 12:54:53 +0100 |
commit | 601a18bf08ca815544b2223208b437a83fba6858 (patch) | |
tree | e1240d53255488b08753b8fa31101da31d6f078c /EmbeddedPkg/Drivers | |
parent | 3a63c17ebc853cbb27d190729d01e27f68e65b94 (diff) | |
download | edk2-601a18bf08ca815544b2223208b437a83fba6858.zip edk2-601a18bf08ca815544b2223208b437a83fba6858.tar.gz edk2-601a18bf08ca815544b2223208b437a83fba6858.tar.bz2 |
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>
Diffstat (limited to 'EmbeddedPkg/Drivers')
-rw-r--r-- | EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 15 | ||||
-rw-r--r-- | EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c index 907d46a..a6ac30c 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c @@ -124,18 +124,21 @@ DtPlatformDxeEntryPoint ( Status = gRT->GetVariable(DT_ACPI_VARIABLE_NAME, &gDtPlatformFormSetGuid,
NULL, &BufferSize, &DtAcpiPref);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to DT\n",
- __FUNCTION__));
- DtAcpiPref.Pref = DT_ACPI_SELECT_DT;
+ DEBUG ((DEBUG_WARN, "%a: no DT/ACPI preference found, defaulting to %a\n",
+ __FUNCTION__, PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"));
+ DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
+ : DT_ACPI_SELECT_ACPI;
}
}
if (!EFI_ERROR (Status) &&
DtAcpiPref.Pref != DT_ACPI_SELECT_ACPI &&
DtAcpiPref.Pref != DT_ACPI_SELECT_DT) {
- DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to DT\n",
- __FUNCTION__, DT_ACPI_VARIABLE_NAME));
- DtAcpiPref.Pref = DT_ACPI_SELECT_DT;
+ DEBUG ((DEBUG_WARN, "%a: invalid value for %s, defaulting to %a\n",
+ __FUNCTION__, DT_ACPI_VARIABLE_NAME,
+ PcdGetBool (PcdDefaultDtPref) ? "DT" : "ACPI"));
+ DtAcpiPref.Pref = PcdGetBool (PcdDefaultDtPref) ? DT_ACPI_SELECT_DT
+ : DT_ACPI_SELECT_ACPI;
Status = EFI_INVALID_PARAMETER; // trigger setvar below
}
diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf index b68f154..450ea29 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf @@ -46,6 +46,9 @@ gEdkiiPlatformHasAcpiGuid
gFdtTableGuid
+[Pcd]
+ gEmbeddedTokenSpaceGuid.PcdDefaultDtPref
+
[Depex]
gEfiVariableArchProtocolGuid AND
gEfiVariableWriteArchProtocolGuid
|