diff mbox

[Linaro-uefi,v2,7/8] Platforms/AMD/Styx/FdtDxe: enable second SATA controller

Message ID 1481017548-16050-8-git-send-email-ard.biesheuvel@linaro.org
State Superseded
Headers show

Commit Message

Ard Biesheuvel Dec. 6, 2016, 9:45 a.m. UTC
Enable the second AHCI DT node when any ports are enabled on the
second SATA controller.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c | 7 ++-----
 Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf    | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c b/Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c
index 13fc9c152bdc..aa595045ca3c 100644
--- a/Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c
+++ b/Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c
@@ -247,11 +247,8 @@  SetSocIdStatus (
   SocId = PcdGet32 (PcdSocCpuId);
   IsRevB1 = (SocId & 0xFF0) && (SocId & 0x00F);
 
-#if DO_SATA1
-  SetDeviceStatus (fdt, "sata@e0d00000", IsRevB1);
-#else
-  SetDeviceStatus (fdt, "sata@e0d00000", FALSE);
-#endif
+  SetDeviceStatus (fdt, "sata@e0d00000",
+    IsRevB1 && FixedPcdGet8(PcdSata1PortCount) > 0);
   SetDeviceStatus (fdt, "gpio@e0020000", IsRevB1);
   SetDeviceStatus (fdt, "gpio@e0030000", IsRevB1);
   SetDeviceStatus (fdt, "gwdt@e0bb0000", IsRevB1);
diff --git a/Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf b/Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf
index 43f084d820fa..5479c7b0abfb 100644
--- a/Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf
+++ b/Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf
@@ -70,6 +70,7 @@ 
   gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment
   gAmdStyxTokenSpaceGuid.PcdPsciOsSupport
   gAmdStyxTokenSpaceGuid.PcdTrustedFWSupport
+  gAmdStyxTokenSpaceGuid.PcdSata1PortCount
 
 [Depex]
   TRUE