diff mbox

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

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

Commit Message

Ard Biesheuvel Nov. 1, 2016, 5:25 p.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>
---
 Platforms/AMD/Styx/Drivers/FdtDxe/BdsLinuxFdt.c | 7 ++-----
 Platforms/AMD/Styx/Drivers/FdtDxe/FdtDxe.inf    | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Leif Lindholm Nov. 2, 2016, 4:56 p.m. UTC | #1
On Tue, Nov 01, 2016 at 05:25:14PM +0000, Ard Biesheuvel wrote:
> 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 --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
> -- 
> 2.7.4
>
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