summaryrefslogtreecommitdiff
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
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>
-rw-r--r--Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c32
-rw-r--r--Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf1
-rw-r--r--Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni8
-rw-r--r--Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr10
-rw-r--r--Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h8
5 files changed, 46 insertions, 13 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;
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
index fca66799eb..bef7feccd8 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
@@ -58,6 +58,7 @@
[Guids]
g96BoardsI2c0MasterGuid
+ gEdkiiPlatformHasAcpiGuid
gEfiHiiPlatformSetupFormsetGuid
gFdtTableGuid
gNetsecNonDiscoverableDeviceGuid
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
index 2eca8bbba8..836decc870 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+* Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.
*
* This program and the accompanying materials are licensed and made available
* under the terms and conditions of the BSD License which accompanies this
@@ -33,3 +33,9 @@
#string STR_EMMC_DISABLED #language en-US "Disabled"
#string STR_EMMC_ENABLED #language en-US "Enabled"
+
+#string STR_DT_ACPI_SELECT_PROMPT #language en-US "O/S Hardware Description"
+#string STR_DT_ACPI_SELECT_HELP #language en-US "Select the hardware description that will be exposed to the O/S."
+
+#string STR_DT_ACPI_SELECT_DT #language en-US "Device Tree"
+#string STR_DT_ACPI_SELECT_ACPI #language en-US "ACPI"
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
index ea35e902b2..8a395eac68 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+* Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.
*
* This program and the accompanying materials are licensed and made available
* under the terms and conditions of the BSD License which accompanies this
@@ -70,6 +70,14 @@ formset
option text = STRING_TOKEN(STR_EMMC_ENABLED), value = EMMC_ENABLED, flags = 0;
endoneof;
+ oneof varid = SynQuacerPlatformSettings.AcpiPref,
+ prompt = STRING_TOKEN(STR_DT_ACPI_SELECT_PROMPT),
+ help = STRING_TOKEN(STR_DT_ACPI_SELECT_HELP),
+ flags = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
+ option text = STRING_TOKEN(STR_DT_ACPI_SELECT_DT), value = ACPIPREF_DT, flags = DEFAULT;
+ option text = STRING_TOKEN(STR_DT_ACPI_SELECT_ACPI), value = ACPIPREF_ACPI, flags = 0;
+ endoneof;
+
subtitle text = STRING_TOKEN(STR_NULL_STRING);
endform;
diff --git a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
index fbbcbd7d3e..bb0e476fc3 100644
--- a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
+++ b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2017, Linaro, Ltd. All rights reserved.<BR>
+ Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -22,12 +22,16 @@
#define PCIE_MAX_SPEED_UNLIMITED 0x0
#define PCIE_MAX_SPEED_GEN1 0x1
+#define ACPIPREF_DT 0x0
+#define ACPIPREF_ACPI 0x1
+
typedef struct {
UINT8 EnableEmmc;
UINT8 PcieSlot0MaxSpeed;
UINT8 PcieSlot1MaxSpeed;
UINT8 PcieSlot2MaxSpeed;
- UINT8 Reserved[4];
+ UINT8 AcpiPref;
+ UINT8 Reserved[3];
} SYNQUACER_PLATFORM_VARSTORE_DATA;
#endif