diff mbox series

[edk2,edk2-platforms,09/11] Silicon/AMD/Styx/StyxDtbLoaderLib: replace DO_KCS macro reference with PCD

Message ID 20181211183514.20948-10-ard.biesheuvel@linaro.org
State New
Headers show
Series final set of Styx cleanups | expand

Commit Message

Ard Biesheuvel Dec. 11, 2018, 6:35 p.m. UTC
Get rid of the CPP conditionals, and use the new boolean PCD for KCS
support instead.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf |  1 +
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c   | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

-- 
2.19.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
index af57ab24f084..23c5e563bbb6 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
@@ -54,6 +54,7 @@ 
   gArmPlatformTokenSpaceGuid.PcdCoreCount
   gArmTokenSpaceGuid.PcdArmLinuxFdtMaxOffset
   gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment
+  gAmdStyxTokenSpaceGuid.PcdEnableKcs
   gAmdStyxTokenSpaceGuid.PcdSata1PortCount
 
 [Guids]
diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
index db7d9b077c32..248eda7c8a95 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
@@ -247,11 +247,12 @@  SetSocIdStatus (
   SetDeviceStatus (Fdt, "gpio@e0020000", IsRevB1);
   SetDeviceStatus (Fdt, "gpio@e0030000", IsRevB1);
   SetDeviceStatus (Fdt, "gwdt@e0bb0000", IsRevB1);
-#if DO_KCS
-  SetDeviceStatus (Fdt, "kcs@e0010000", IsRevB1);
-#else
-  SetDeviceStatus (Fdt, "kcs@e0010000", FALSE);
-#endif
+
+  if (FixedPcdGetBool (PcdEnableKcs)) {
+    SetDeviceStatus (Fdt, "kcs@e0010000", IsRevB1);
+  } else {
+    SetDeviceStatus (Fdt, "kcs@e0010000", FALSE);
+  }
 
   if (!PcdGetBool (PcdEnableSmmus)) {
     DisableSmmu (Fdt, "iommu-map", "/smb/smmu@e0a00000", "/smb/pcie@f0000000");