]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: rockchip_dw_mmc: Allow 4-bit mode when 8-bit mode is supported
authorJonas Karlman <jonas@kwiboo.se>
Wed, 24 Jul 2024 06:55:36 +0000 (06:55 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 9 Aug 2024 10:35:23 +0000 (18:35 +0800)
Hosts capable of 8-bit can also do 4 bits, fix use of 4-bit mode when
8-bit mode is supported.

This fixes use of 1-bit mode with SD NAND on ROCK Pi S using the DT in
v6.11-rc1 that chage to use 8-bit bus to also support eMMC. With this
4-bit mode is used with SD NAND and 8-bit mode with eMMC, same as in
Linux kernel.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/rockchip_dw_mmc.c

index 1a10b7057a47ce65adeab0aa7f98539c6bc9273c..549fb80f1988302121c2b204b8e25469c9eadeaf 100644 (file)
@@ -159,6 +159,10 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
        host->mmc->dev = dev;
        upriv->mmc = host->mmc;
 
+       /* Hosts capable of 8-bit can also do 4 bits */
+       if (host->buswidth == 8)
+               plat->cfg.host_caps |= MMC_MODE_4BIT;
+
        return dwmci_probe(dev);
 }