summaryrefslogtreecommitdiff
path: root/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-30 11:44:36 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-03-15 16:04:30 +0000
commitb2aad8fc85a5c5bcd2a60208ac28d41ca2194620 (patch)
treea24d6b33d089192ef0eb12aa490b1025c8baef57 /Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
parent3b5091beadc90b447849eeb03859d7d80ad88cda (diff)
downloadedk2-platforms-b2aad8fc85a5c5bcd2a60208ac28d41ca2194620.tar.xz
Silicon/SynQuacer/PlatformDxe: add option to enable ACPI mode
Create a HII menu option to choose between device tree and ACPI platform descriptions. Note that the option is only active if PCIe compatibility mode is enabled. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c')
-rw-r--r--Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
index 8787aa6288..4ae1c5b0ff 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
@@ -277,15 +277,29 @@ PlatformDxeEntryPoint (
mHiiSettingsVal = PcdGet64 (PcdPlatformSettings);
mHiiSettings = (SYNQUACER_PLATFORM_VARSTORE_DATA *)&mHiiSettingsVal;
- Dtb = NULL;
- Status = DtPlatformLoadDtb (&Dtb, &DtbSize);
- if (!EFI_ERROR (Status)) {
- Status = gBS->InstallConfigurationTable (&gFdtTableGuid, Dtb);
- }
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR,
- "%a: failed to install FDT configuration table - %r\n", __FUNCTION__,
- Status));
+ if (mHiiSettings->AcpiPref == ACPIPREF_DT) {
+ Dtb = NULL;
+ Status = DtPlatformLoadDtb (&Dtb, &DtbSize);
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->InstallConfigurationTable (&gFdtTableGuid, Dtb);
+ }
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR,
+ "%a: failed to install FDT configuration table - %r\n", __FUNCTION__,
+ Status));
+ }
+ } else {
+ //
+ // ACPI was selected: install the gEdkiiPlatformHasAcpiGuid GUID as a
+ // NULL protocol to unlock dispatch of ACPI related drivers.
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (&ImageHandle,
+ &gEdkiiPlatformHasAcpiGuid, NULL, NULL);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR,
+ "%a: failed to install gEdkiiPlatformHasAcpiGuid as a protocol\n",
+ __FUNCTION__));
+ }
}
Handle = NULL;