From patchwork Mon Jan 20 10:20:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 239795 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Mon, 20 Jan 2020 19:20:26 +0900 Subject: [RFC 1/4] mmc: bcm2835_sdhci: use phys2bus macro when dma address is accessed In-Reply-To: <20200120102029.14264-1-jh80.chung@samsung.com> References: <20200120102029.14264-1-jh80.chung@samsung.com> Message-ID: <20200120102029.14264-2-jh80.chung@samsung.com> 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 --- 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 #include #include +#include /* 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(); }