]> git.sur5r.net Git - u-boot/commitdiff
mmc: matsushita-common: Special case only select registers in 16bit
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Mon, 9 Apr 2018 18:47:31 +0000 (20:47 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Wed, 11 Apr 2018 21:11:59 +0000 (23:11 +0200)
There are only a few registerse used in the 16bit mode which are
32bit internally. Special-case only those in the IO accessors and
always write both halves. Any other register access is protected
from accidentally overwriting neighboring register.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/matsushita-common.c

index 3f538c354e6108bf3324235514552f00dcd19445..739586557ac319eeae9c458c273a1ac0b96772e3 100644 (file)
@@ -68,7 +68,9 @@ void matsu_sd_writel(struct matsu_sd_priv *priv,
                writel(val, priv->regbase + (reg << 1));
        if (priv->caps & MATSU_SD_CAP_16BIT) {
                writew(val & 0xffff, priv->regbase + (reg >> 1));
-               if (val >> 16)
+               if (reg == MATSU_SD_INFO1 || reg == MATSU_SD_INFO1_MASK ||
+                   reg == MATSU_SD_INFO2 || reg == MATSU_SD_INFO2_MASK ||
+                   reg == MATSU_SD_ARG)
                        writew(val >> 16, priv->regbase + (reg >> 1) + 2);
        } else
                writel(val, priv->regbase + reg);