From 4b9a3cc5675669bfd790a8812b600b5c2f615af1 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 15 Dec 2016 16:17:00 +0000 Subject: 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 Tested-by: Milosz Wasilewski Reviewed-by: Leif Lindholm --- .../AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c | 12 ++++++++++++ .../Styx/Drivers/StyxSataPlatformDxe/StyxSataPlatformDxe.inf | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) 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 - -- cgit v1.2.3