mmc: sdhci: use phys2bus macro when dma address is accessed 63/268163/2
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 27 Mar 2020 04:08:00 +0000 (13:08 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 16 Dec 2021 16:18:05 +0000 (17:18 +0100)
Use phys2bus macro when dma address is accessed.
Some targets need to use pyhs2bus macro. (e.g, RPI4)
After applied it, SDMA mode can be used.

Change-Id: Icf08233f3c36ecd04465e4cd00aa5a010775fd2d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
drivers/mmc/sdhci.c

index 2c2169717205ba5bd2b680518c8756623f9f3b1a..6a5aeb1746641ae2558c6f7ebca51e14d76d90df 100644 (file)
@@ -16,6 +16,7 @@
 #include <sdhci.h>
 #include <dm.h>
 #include <linux/dma-mapping.h>
+#include <phys2bus.h>
 
 static void sdhci_reset(struct sdhci_host *host, u8 mask)
 {
@@ -150,7 +151,8 @@ static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
                                          mmc_get_dma_dir(data));
 
        if (host->flags & USE_SDMA) {
-               sdhci_writel(host, host->start_addr, SDHCI_DMA_ADDRESS);
+               sdhci_writel(host, phys_to_bus((ulong)host->start_addr),
+                               SDHCI_DMA_ADDRESS);
        } else if (host->flags & (USE_ADMA | USE_ADMA64)) {
                sdhci_prepare_adma_table(host, data);