From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAADFC433F5 for ; Wed, 11 May 2022 19:22:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D8CD84355; Wed, 11 May 2022 20:28:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="u0cU6kJt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 620CD8434C; Wed, 11 May 2022 20:27:53 +0200 (CEST) Received: from ams.source.kernel.org (unknown [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B3F9B841FF for ; Wed, 11 May 2022 20:27:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 613C5B825EE; Wed, 11 May 2022 18:27:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC8C8C340EE; Wed, 11 May 2022 18:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652293647; bh=5pVL9kwSINQ2aT2NSLYND01Sh1NzWb0ZAQyVYzXr//c=; h=From:To:Cc:Subject:Date:From; b=u0cU6kJtcIvHvEQKtMmPoVi9MEvlpSM4Po51MCLn0gzQN0+IYhKKBp65fOBNLgsiQ 4dXvFftmW+eJ3zseChBCCvk0KL6i1532FI9n0tzXZnhHZ2uWTKV0zkTKKfLQbQmmPF nHSaG8jK4GJNDc+Jh2lOYLN0Y8e40w8VymCgxN2w8higKUieDLCyOXIFPyXyKXzzGI gVHpQ2oAymPuD4BSzXKNE7As2183DpE14mhFVhIkndCcWIasy/K+uc5Cy+BX3RU1d9 Ee6+mwcBn2YVavcBMoDFuP4R/DhECNRvCe7YuOpvSxB8QiY9tXOBltx2OGK9arveIw zrIysHX3a87iQ== Received: by pali.im (Postfix) id 3AF5421A6; Wed, 11 May 2022 20:27:24 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Peng Fan , Jaehoon Chung , Priyanka Jain , Sinan Akman 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 Message-Id: <20220511182713.26790-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- 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