diff mbox

[Linaro-uefi,v3,5/8] Platforms/AMD/Styx/AcpiTables: enable second SATA controller

Message ID 1481029532-17057-6-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit 5bf0173f0ab8cd43ef31be2ab925a58dca7f061f
Headers show

Commit Message

Ard Biesheuvel Dec. 6, 2016, 1:05 p.m. UTC
Enable the second AHCI ACPI 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>
---
 Platforms/AMD/Styx/AcpiTables/AcpiTables.inf | 1 +
 Platforms/AMD/Styx/AcpiTables/Dsdt.c         | 9 ++-------
 2 files changed, 3 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/Platforms/AMD/Styx/AcpiTables/AcpiTables.inf b/Platforms/AMD/Styx/AcpiTables/AcpiTables.inf
index 72272aa0b85a..12e0444009ef 100644
--- a/Platforms/AMD/Styx/AcpiTables/AcpiTables.inf
+++ b/Platforms/AMD/Styx/AcpiTables/AcpiTables.inf
@@ -83,6 +83,7 @@ 
   gAmdStyxTokenSpaceGuid.PcdPsciOsSupport
   gAmdStyxTokenSpaceGuid.PcdTrustedFWSupport
   gAmdStyxTokenSpaceGuid.PcdParkingProtocolVersion
+  gAmdStyxTokenSpaceGuid.PcdSata1PortCount
 
 [Depex]
   gAmdMpCoreInfoProtocolGuid
diff --git a/Platforms/AMD/Styx/AcpiTables/Dsdt.c b/Platforms/AMD/Styx/AcpiTables/Dsdt.c
index 922d7214adf4..360a446f7631 100644
--- a/Platforms/AMD/Styx/AcpiTables/Dsdt.c
+++ b/Platforms/AMD/Styx/AcpiTables/Dsdt.c
@@ -174,15 +174,10 @@  DsdtHeader (
     else if (AsciiStrCmp(Table->Pathname, "_SB_.ETH1._DSD") == 0) {
       OverrideMacAddr ((UINT8 *)&AmlCode[Table->Offset], PcdGet64 (PcdEthMacB));
     }
-#if DO_SATA1
     else if (AsciiStrCmp(Table->Pathname, "_SB_.AHC1._STA") == 0) {
-      OverrideStatus ((UINT8 *)&AmlCode[Table->Offset], EnableOnB1);
-    }
-#else
-    else if (AsciiStrCmp(Table->Pathname, "_SB_.AHC1._STA") == 0) {
-      OverrideStatus ((UINT8 *)&AmlCode[Table->Offset], FALSE);
+      OverrideStatus ((UINT8 *)&AmlCode[Table->Offset],
+        EnableOnB1 && FixedPcdGet8(PcdSata1PortCount) > 0);
     }
-#endif
     else if (AsciiStrCmp(Table->Pathname, "_SB_.GIO2._STA") == 0) {
       OverrideStatus ((UINT8 *)&AmlCode[Table->Offset], EnableOnB1);
     }