public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms: PATCH] Marvell/Drivers: XenonDxe: Use new enums for SD card initialization
@ 2019-09-27 15:08 Marcin Wojtas
  2019-09-28 22:54 ` Leif Lindholm
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Wojtas @ 2019-09-27 15:08 UTC (permalink / raw)
  To: devel; +Cc: leif.lindholm, ard.biesheuvel, mw, jsd, jaz, kostap

MdeModulePkg/SdMmcHcDxe update to use rev 3 of SdMmcOverrideProtocol
reworked SD card initialization and added new enums describing lower
speeds. Include this in XenonDxe, which fixes Armada70x0Db SD interface.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
index 7bfe240..6059cf8 100755
--- a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
+++ b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
@@ -360,6 +360,8 @@ XenonPhySlowMode (
   if (((Timing == SdMmcUhsSdr50) ||
        (Timing == SdMmcUhsSdr25) ||
        (Timing == SdMmcUhsSdr12) ||
+       (Timing == SdMmcSdDs)  ||
+       (Timing == SdMmcSdHs)  ||
        (Timing == SdMmcMmcHsDdr) ||
        (Timing == SdMmcMmcHsSdr) ||
        (Timing == SdMmcMmcLegacy)) && SlowMode) {
@@ -396,7 +398,7 @@ XenonSetPhy (
   Var &= ~(EMMC5_1_FC_CMD_PD | EMMC5_1_FC_DQ_PD);
   XenonHcRwMmio (PciIo, SD_BAR_INDEX, EMMC_PHY_PAD_CONTROL1, FALSE, SDHC_REG_SIZE_4B, &Var);
 
-  if (Timing == SdMmcUhsSdr12) {
+  if (Timing == SdMmcUhsSdr12 || Timing == SdMmcSdDs) {
     if (SlowMode) {
       XenonHcRwMmio (PciIo, SD_BAR_INDEX, EMMC_PHY_TIMING_ADJUST, TRUE, SDHC_REG_SIZE_4B, &Var);
       Var |= QSN_PHASE_SLOW_MODE_BIT;
@@ -749,7 +751,7 @@ XenonInit (
 
   // Set lowest clock and the PHY for the initialization phase
   XenonSetClk (PciIo, XENON_MMC_BASE_CLK);
-  Status = XenonSetPhy (PciIo, SlowMode, TuningStepDivisor, SdMmcUhsSdr12);
+  Status = XenonSetPhy (PciIo, SlowMode, TuningStepDivisor, SdMmcSdDs);
   if (EFI_ERROR (Status)) {
     return Status;
   }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-platforms: PATCH] Marvell/Drivers: XenonDxe: Use new enums for SD card initialization
  2019-09-27 15:08 [edk2-platforms: PATCH] Marvell/Drivers: XenonDxe: Use new enums for SD card initialization Marcin Wojtas
@ 2019-09-28 22:54 ` Leif Lindholm
  0 siblings, 0 replies; 2+ messages in thread
From: Leif Lindholm @ 2019-09-28 22:54 UTC (permalink / raw)
  To: Marcin Wojtas; +Cc: devel, ard.biesheuvel, jsd, jaz, kostap


On Fri, Sep 27, 2019 at 05:08:14PM +0200, Marcin Wojtas wrote:
> MdeModulePkg/SdMmcHcDxe update to use rev 3 of SdMmcOverrideProtocol
> reworked SD card initialization and added new enums describing lower
> speeds. Include this in XenonDxe, which fixes Armada70x0Db SD interface.
> 
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Pushed as c2f593bde282.

Thanks!

> ---
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
> index 7bfe240..6059cf8 100755
> --- a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
> +++ b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c
> @@ -360,6 +360,8 @@ XenonPhySlowMode (
>    if (((Timing == SdMmcUhsSdr50) ||
>         (Timing == SdMmcUhsSdr25) ||
>         (Timing == SdMmcUhsSdr12) ||
> +       (Timing == SdMmcSdDs)  ||
> +       (Timing == SdMmcSdHs)  ||
>         (Timing == SdMmcMmcHsDdr) ||
>         (Timing == SdMmcMmcHsSdr) ||
>         (Timing == SdMmcMmcLegacy)) && SlowMode) {
> @@ -396,7 +398,7 @@ XenonSetPhy (
>    Var &= ~(EMMC5_1_FC_CMD_PD | EMMC5_1_FC_DQ_PD);
>    XenonHcRwMmio (PciIo, SD_BAR_INDEX, EMMC_PHY_PAD_CONTROL1, FALSE, SDHC_REG_SIZE_4B, &Var);
>  
> -  if (Timing == SdMmcUhsSdr12) {
> +  if (Timing == SdMmcUhsSdr12 || Timing == SdMmcSdDs) {
>      if (SlowMode) {
>        XenonHcRwMmio (PciIo, SD_BAR_INDEX, EMMC_PHY_TIMING_ADJUST, TRUE, SDHC_REG_SIZE_4B, &Var);
>        Var |= QSN_PHASE_SLOW_MODE_BIT;
> @@ -749,7 +751,7 @@ XenonInit (
>  
>    // Set lowest clock and the PHY for the initialization phase
>    XenonSetClk (PciIo, XENON_MMC_BASE_CLK);
> -  Status = XenonSetPhy (PciIo, SlowMode, TuningStepDivisor, SdMmcUhsSdr12);
> +  Status = XenonSetPhy (PciIo, SlowMode, TuningStepDivisor, SdMmcSdDs);
>    if (EFI_ERROR (Status)) {
>      return Status;
>    }
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-28 22:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-27 15:08 [edk2-platforms: PATCH] Marvell/Drivers: XenonDxe: Use new enums for SD card initialization Marcin Wojtas
2019-09-28 22:54 ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox