All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Sinan Akman <sinan@writeme.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH 1/2] mmc: fsl_esdhc: Set fallback mode to 1-bit
Date: Wed, 11 May 2022 20:27:12 +0200	[thread overview]
Message-ID: <20220511182713.26790-1-pali@kernel.org> (raw)

8-bit mode is not supported by SD cards and on P2020 are four SDHC pins
shared with SPI (so if P2020 board have also SPI then only 4-bit SDHC mode
is provided). So 8-bit SDHC mode is really bad default.

When max bus width is not provided then set mode to 1-bit. This mode is
supported by all cards, so it is the best option for fallback mode.

Also P2020 bootrom sets mode to 1-bit when booting from SD/MMC card.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/mmc/fsl_esdhc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 3b3587bd8d72..834f8933b0c6 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -963,9 +963,8 @@ int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg)
 	} else if (cfg->max_bus_width == 1) {
 		mmc_cfg->host_caps |= MMC_MODE_1BIT;
 	} else {
-		mmc_cfg->host_caps |= MMC_MODE_1BIT | MMC_MODE_4BIT |
-				      MMC_MODE_8BIT;
-		printf("No max bus width provided. Assume 8-bit supported.\n");
+		mmc_cfg->host_caps |= MMC_MODE_1BIT;
+		printf("No max bus width provided. Fallback to 1-bit mode.\n");
 	}
 
 	if (IS_ENABLED(CONFIG_ESDHC_DETECT_8_BIT_QUIRK))
-- 
2.20.1


             reply	other threads:[~2022-05-11 19:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220511182733epcas1p1e986f0fecb5b3f736b5a0c7a15c5608a@epcas1p1.samsung.com>
2022-05-11 18:27 ` Pali Rohár [this message]
2022-05-11 18:27   ` [PATCH 2/2] mmc: fsl_esdhc: Add new config option for default fallback mode Pali Rohár
2022-05-16 23:40     ` Jaehoon Chung
2022-05-17  7:27       ` Pali Rohár
2022-05-17  9:20         ` Jaehoon Chung
2022-05-16 23:39   ` [PATCH 1/2] mmc: fsl_esdhc: Set fallback mode to 1-bit Jaehoon Chung

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=20220511182713.26790-1-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sinan@writeme.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.