]> git.sur5r.net Git - u-boot/commitdiff
mmc: sunxi: Only update timing mode bit when enabling new timing mode
authorChen-Yu Tsai <wens@csie.org>
Thu, 31 Aug 2017 13:57:48 +0000 (21:57 +0800)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 1 Sep 2017 14:19:47 +0000 (19:49 +0530)
When enabling the new mmc timing mode, we inadvertently clear all the
remaining bits in the new timing mode register. The bits cleared
include a default phase delay on the output clock. The BSP kernel
states that the default values are supposed to be used. Clearing them
results in decreased performance or transfer errors on some boards.

Fixes: de9b1771c3b6 ("mmc: sunxi: Support new mode")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
drivers/mmc/sunxi_mmc.c

index a76e763bfd4fa6eb91f61cca3c22c9924812d5a2..4edb4be46c819295e99917e75c143cae489c7258 100644 (file)
@@ -167,7 +167,7 @@ static int mmc_set_mod_clk(struct sunxi_mmc_priv *priv, unsigned int hz)
        if (new_mode) {
 #ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
                val = CCM_MMC_CTRL_MODE_SEL_NEW;
-               writel(SUNXI_MMC_NTSR_MODE_SEL_NEW, &priv->reg->ntsr);
+               setbits_le32(&priv->reg->ntsr, SUNXI_MMC_NTSR_MODE_SEL_NEW);
 #endif
        } else {
                val = CCM_MMC_CTRL_OCLK_DLY(oclk_dly) |