public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Wojtas" <mw@semihalf.com>
To: devel@edk2.groups.io
Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org,
	mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com,
	kostap@marvell.com
Subject: [edk2-platforms: PATCH v2] Marvell/Drivers: XenonDxe: Explicitly disable HS400
Date: Wed,  7 Aug 2019 21:46:12 +0200	[thread overview]
Message-ID: <1565207172-8921-1-git-send-email-mw@semihalf.com> (raw)

On another SoC revision, the capability register marks HS400 support
as enabled. However in case the interface itself is powered with 3.3V
this flag must be unset by the SdMmcOverride protocol callback -
otherwise the generic EmmcSwitchToHS400 () would be executed
with a failure.

Ensure that in case of SlowMode or 3.3V operation, the HS400 capability
will be disabled in the SdMmc driver, along with other highest-speed
modes.

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

diff --git a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h
index afc2b2f..2ad23e2 100644
--- a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h
+++ b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h
@@ -55,6 +55,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SDHC_CAP_SDR50                BIT32
 #define SDHC_CAP_SDR104               BIT33
 #define SDHC_CAP_DDR50                BIT34
+#define SDHC_CAP_HS400                BIT63
 #define SDHC_MAX_CURRENT_CAP          0x0048
 #define SDHC_FORCE_EVT_AUTO_CMD       0x0050
 #define SDHC_FORCE_EVT_ERR_INT        0x0052
diff --git a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.c b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.c
index 3b54459..afd650b 100644
--- a/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.c
+++ b/Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.c
@@ -330,7 +330,8 @@ XenonSdMmcCapability (
     Capability &= ~(UINT64)(SDHC_CAP_VOLTAGE_33 | SDHC_CAP_VOLTAGE_30);
   } else {
     Capability &= ~(UINT64)(SDHC_CAP_SDR104 | SDHC_CAP_DDR50 |
-                            SDHC_CAP_SDR50 | SDHC_CAP_VOLTAGE_18);
+                            SDHC_CAP_SDR50 | SDHC_CAP_HS400 |
+                            SDHC_CAP_VOLTAGE_18);
   }
 
   if (!SdMmcDesc.Xenon8BitBusEnabled) {
@@ -338,7 +339,7 @@ XenonSdMmcCapability (
   }
 
   if (SdMmcDesc.XenonSlowModeEnabled) {
-    Capability &= ~(UINT64)(SDHC_CAP_SDR104 | SDHC_CAP_DDR50);
+    Capability &= ~(UINT64)(SDHC_CAP_SDR104 | SDHC_CAP_DDR50 | SDHC_CAP_HS400);
   }
 
   Capability &= ~(UINT64)(SDHC_CAP_SLOT_TYPE_MASK);
-- 
2.7.4


             reply	other threads:[~2019-08-07 19:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 19:46 Marcin Wojtas [this message]
2019-08-08 10:55 ` [edk2-platforms: PATCH v2] Marvell/Drivers: XenonDxe: Explicitly disable HS400 Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1565207172-8921-1-git-send-email-mw@semihalf.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox