summaryrefslogtreecommitdiff
path: root/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-03-29 08:11:54 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2019-03-29 08:11:54 +0100
commitebd5f66f7c32fe19123dfe0bb0c55b915f6ed358 (patch)
tree80dcf06704765aec7d6aa2f55ec75ef9fe217434 /Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c
parent2795f440ffb03b4992531e34ecba0e60783fef30 (diff)
Platform/DeveloperBox: make PCIe BME defer dip switch configurabledeveloper-box-from-hell
Tie DIP switch DSW3-5 to the dynamic PCD that defers enabling of the PCIe Bus Master Enable bit to the first PciIo->Map() call made by the driver. This helps identify drivers that don't bother to use Map/Unmap at all, which is a violation of the UEFI spec. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c')
-rw-r--r--Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c
index af8dfd12..3f6dbcec 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformPeiLib/SynQuacerPlatformPeiLib.c
@@ -164,6 +164,16 @@ PlatformPeim (
}
Value = 0;
+ Status = ReadGpioInput (Gpio, FixedPcdGet8 (PcdDeferBusMasterEnableGpioPin),
+ &Value);
+ if (!EFI_ERROR (Status) && Value != 0) {
+ DEBUG ((DEBUG_WARN, "%a: deferring PCI bus master enable to PciIo->Map() call\n",
+ __FUNCTION__));
+ Status = PcdSetBoolS (PcdDeferBusMasterEnableToPciIoMap, TRUE);
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ Value = 0;
Status = ReadGpioInput (Gpio, FixedPcdGet8 (PcdIgnoreFirstMemRegionGpioPin),
&Value);
if (!EFI_ERROR (Status) && Value != 0) {