All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/4] mmc: all hosts support 1-bit bus width and legacy timings
Date: Mon, 27 Nov 2017 10:59:06 +0100	[thread overview]
Message-ID: <1511776746-2957-5-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1511776746-2957-1-git-send-email-jjhiblot@ti.com>

Make sure that those basic capabilities are advertised by the host.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---

no change since v1

 drivers/mmc/mmc.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 67f21ff..ec1dc49 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1587,10 +1587,10 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
 	uint caps;
 
 	mmc_dump_capabilities("sd card", card_caps);
-	mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
+	mmc_dump_capabilities("host", mmc->host_caps);
 
 	/* Restrict card's capabilities by what the host can do */
-	caps = card_caps & (mmc->host_caps | MMC_MODE_1BIT);
+	caps = card_caps & mmc->host_caps;
 
 	if (!uhs_en)
 		caps &= ~UHS_CAPS;
@@ -1771,10 +1771,10 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
 	const struct ext_csd_bus_width *ecbw;
 
 	mmc_dump_capabilities("mmc", card_caps);
-	mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
+	mmc_dump_capabilities("host", mmc->host_caps);
 
 	/* Restrict card's capabilities by what the host can do */
-	card_caps &= (mmc->host_caps | MMC_MODE_1BIT);
+	card_caps &= mmc->host_caps;
 
 	/* Only version 4 of MMC supports wider bus widths */
 	if (mmc->version < MMC_VERSION_4)
@@ -2389,7 +2389,12 @@ int mmc_start_init(struct mmc *mmc)
 	bool uhs_en = supports_uhs(mmc->cfg->host_caps);
 	int err;
 
-	mmc->host_caps = mmc->cfg->host_caps;
+	/*
+	 * all hosts are capable of 1 bit bus-width and able to use the legacy
+	 * timings.
+	 */
+	mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
+			 MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
 
 	/* we pretend there's no card when init is NULL */
 	no_card = mmc_getcd(mmc) == 0;
-- 
1.9.1

  parent reply	other threads:[~2017-11-27  9:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  9:59 [U-Boot] [PATCH v2 0/4] mmc: fixes for HS200/UHS core support Jean-Jacques Hiblot
2017-11-27  9:59 ` [U-Boot] [PATCH v2 1/4] dm: mmc: update mmc_of_parse() Jean-Jacques Hiblot
2017-11-27 17:13   ` Simon Glass
2017-11-28  9:17     ` Jean-Jacques Hiblot
2017-11-27  9:59 ` [U-Boot] [PATCH v2 2/4] mmc: dump card and host capabilities if debug is enabled Jean-Jacques Hiblot
2017-11-27 10:10   ` Jaehoon Chung
2017-11-28  9:27     ` Jean-Jacques Hiblot
2017-11-27  9:59 ` [U-Boot] [PATCH v2 3/4] mmc: Fixed a problem with old sd or mmc that do not support High speed Jean-Jacques Hiblot
2017-11-27 17:13   ` Simon Glass
2017-11-27  9:59 ` Jean-Jacques Hiblot [this message]
2017-11-27 17:13   ` [U-Boot] [PATCH v2 4/4] mmc: all hosts support 1-bit bus width and legacy timings Simon Glass

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-all 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=1511776746-2957-5-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.