public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/3] sunxi-mmc: use new mode on both controllers on A64
Date: Fri,  9 Nov 2018 20:41:46 -0800	[thread overview]
Message-ID: <20181110044146.1855-4-anarsoul@gmail.com> (raw)
In-Reply-To: <20181110044146.1855-1-anarsoul@gmail.com>

Using new mode improves stability of eMMC and SD cards. Without
it SPL fails to load u-boot from SD on Pinebook.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/mach-sunxi/Kconfig |  1 +
 drivers/mmc/sunxi_mmc.c     | 10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 66fff6c6d3..3c54f5106d 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -282,6 +282,7 @@ config MACH_SUN50I
 	select SUN6I_PRCM
 	select SUNXI_DE2
 	select SUNXI_GEN_SUN6I
+	select MMC_SUNXI_HAS_NEW_MODE
 	select SUPPORT_SPL
 	select SUNXI_DRAM_DW
 	select SUNXI_DRAM_DW_32BIT
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index e50b2c3343..2b6f3c2234 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -98,12 +98,16 @@ static int mmc_resource_init(int sdc_no)
 static int mmc_set_mod_clk(struct sunxi_mmc_priv *priv, unsigned int hz)
 {
 	unsigned int pll, pll_hz, div, n, oclk_dly, sclk_dly;
-	bool new_mode = false;
+	bool new_mode = true;
 	bool calibrate = false;
 	u32 val = 0;
 
-	if (IS_ENABLED(CONFIG_MMC_SUNXI_HAS_NEW_MODE) && (priv->mmc_no == 2))
-		new_mode = true;
+	if (!IS_ENABLED(CONFIG_MMC_SUNXI_HAS_NEW_MODE))
+		new_mode = false;
+
+	/* A83 support new mode only on eMMC */
+	if (IS_ENABLED(CONFIG_MACH_SUN8I_A83T) && priv->mmc_no != 2)
+		new_mode = false;
 
 #if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H6)
 	calibrate = true;
-- 
2.19.1

  parent reply	other threads:[~2018-11-10  4:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-10  4:41 [U-Boot] [PATCH v2 0/3] sunxi-mmc: enable new clock mode on A64 Vasily Khoruzhick
2018-11-10  4:41 ` [U-Boot] [PATCH v2 1/3] sunxi-mmc: introduce new MMC_SUNXI_HAS_MODE_SWITCH option Vasily Khoruzhick
2018-11-22  7:51   ` Jagan Teki
2018-11-10  4:41 ` [U-Boot] [PATCH v2 2/3] sunxi-mmc: don't double clock for new mode unconditionally Vasily Khoruzhick
2018-11-22  7:52   ` Jagan Teki
2018-11-10  4:41 ` Vasily Khoruzhick [this message]
2018-11-22  7:53   ` [U-Boot] [PATCH v2 3/3] sunxi-mmc: use new mode on both controllers on A64 Jagan Teki
2018-11-15 19:20 ` [U-Boot] [PATCH v2 0/3] sunxi-mmc: enable new clock mode " Vasily Khoruzhick
2018-11-21 20:30   ` Vasily Khoruzhick
2018-11-22  6:02     ` Jagan Teki

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=20181110044146.1855-4-anarsoul@gmail.com \
    --to=anarsoul@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox