diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-12-15 16:17:00 +0000 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-12-16 12:45:29 +0000 |
commit | 4b9a3cc5675669bfd790a8812b600b5c2f615af1 (patch) | |
tree | e96e3d5375897bbb3bbb100645dee2fdba5e61b6 | |
parent | f289416c64b3225b7733eedb305d98c8be068d90 (diff) |
Platforms/AMD/Styx: disable second SATA controller on pre-B1 silicon
The recent port to the generic SATA driver inadvertently resulted in
both SATA controllers being initialized by the UEFI driver, even though
only the first one is exposed to the OS via ACPI or DT.
So omit the initialization as well on pre-B1 silicon.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
-rw-r--r-- | Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c | 12 | ||||
-rw-r--r-- | Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c b/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c index 5c651ed..1958d91 100644 --- a/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c +++ b/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c @@ -139,6 +139,11 @@ InitializeSataController ( AhciBaseAddr, SIZE_4KB);
}
+#define STYX_SOC_VERSION_MASK 0xFFF
+#define STYX_SOC_VERSION_A0 0x000
+#define STYX_SOC_VERSION_B0 0x010
+#define STYX_SOC_VERSION_B1 0x011
+
EFI_STATUS
EFIAPI
StyxSataPlatformDxeEntryPoint (
@@ -168,6 +173,13 @@ StyxSataPlatformDxeEntryPoint ( SetPrdSingleSata0 (PortNum);
}
+ //
+ // Ignore the second SATA controller on pre-B1 silicon
+ //
+ if ((PcdGet32 (PcdSocCpuId) & STYX_SOC_VERSION_MASK) < STYX_SOC_VERSION_B1) {
+ return EFI_SUCCESS;
+ }
+
if (FixedPcdGet8(PcdSata1PortCount) > 0) {
for (PortNum = 0; PortNum < FixedPcdGet8(PcdSata1PortCount); PortNum++) {
SetCwMinSata1 (PortNum);
diff --git a/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf b/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf index b478fa5..5fbfcf5 100644 --- a/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf +++ b/Platforms/AMD/Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf @@ -56,6 +56,8 @@ gAmdStyxTokenSpaceGuid.PcdSataPortCpd
gAmdStyxTokenSpaceGuid.PcdSataPortMpsp
+[Pcd]
+ gAmdStyxTokenSpaceGuid.PcdSocCpuId
+
[Depex]
TRUE
-
|