summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-02-28 19:06:08 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-03-15 16:04:31 +0000
commitf8acbb73fae68638ae57afd776802728b99a5901 (patch)
treec0b5806efa71e1f8aa3c6cf26e2e7e72a0d9205f
parente28941083c2bafff05b303a541b8d34a8b353345 (diff)
downloadedk2-platforms-f8acbb73fae68638ae57afd776802728b99a5901.tar.xz
Silicon/SynQuacer/AcpiTables: take presence detect of PCI0 into account
On the SynQuacer Evalution Board, PCIe RC #0 is not clocked if no card is inserted into the PCIe slot, and so any attempt to access the device registers will lock up the system. So let's check the presence detect pin directly in the _STA implementation of PCI0. This needs to be done before the config space check, because that access itself will lock the system if no card is inserted. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>
-rw-r--r--Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl15
-rw-r--r--Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf1
2 files changed, 16 insertions, 0 deletions
diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl
index 24a3aa3a5b..51e9d0b22c 100644
--- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl
+++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl
@@ -14,6 +14,7 @@
**/
+#include <Platform/MemoryMap.h>
#include <Platform/Pcie.h>
#include "AcpiTables.h"
@@ -37,7 +38,21 @@ DefinitionBlock ("SsdtPci.aml", "SSDT", 1, "SNI", "SYNQUACR",
VPID, 16,
}
+ OperationRegion (GPIO, SystemMemory, SYNQUACER_GPIO_BASE, 8)
+ Field (GPIO, DWordAcc, NoLock, Preserve) {
+ , 39,
+ PRDT, 1,
+ , 24,
+ }
+
Method (_STA, 0x0, Serialized) {
+ If (!LEqual (FixedPcdGet8 (PcdPcie0PresenceDetectGpioPin), 0xff)) {
+ Store (PRDT, local0)
+ If (!LEqual (local0, 0x0)) {
+ Return (0x0)
+ }
+ }
+
//
// Check whether the VID/PID of device #1 on bus #0 equals 0xffff.
// If this is not the case, we are dealing with a ghost device,
diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf
index b1b6bbaa48..bca8354d11 100644
--- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf
+++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf
@@ -62,3 +62,4 @@
gSynQuacerTokenSpaceGuid.PcdNetsecEepromBase
gSynQuacerTokenSpaceGuid.PcdNetsecPhyAddress
+ gSynQuacerTokenSpaceGuid.PcdPcie0PresenceDetectGpioPin