[RFC 1/4] mmc: bcm2835_sdhci: use phys2bus macro when dma address is accessed

Jaehoon Chung jh80.chung at samsung.com
Mon Jan 20 11:20:26 CET 2020


Use phys2bus macro when dma address is accessed.
After applied it, SDMA mode can be used.

When thor download is used,
- Before : 1.8MB/s
- After : 7.23MB/s

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
---
 drivers/mmc/bcm2835_sdhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index 39c93db275..222ba22d66 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -46,6 +46,7 @@
 #include <asm/arch/mbox.h>
 #include <mach/sdhci.h>
 #include <mach/timer.h>
+#include <phys2bus.h>
 
 /* 400KHz is max freq for card ID etc. Use that as min */
 #define MIN_FREQ 400000
@@ -86,7 +87,11 @@ static inline void bcm2835_sdhci_raw_writel(struct sdhci_host *host, u32 val,
 			;
 	}
 
-	writel(val, host->ioaddr + reg);
+	if (reg == SDHCI_DMA_ADDRESS)
+		writel(phys_to_bus((unsigned long)val), host->ioaddr + reg);
+	else
+		writel(val, host->ioaddr + reg);
+
 	bcm_host->last_write = timer_get_us();
 }
 
-- 
2.25.0



More information about the U-Boot mailing list