mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
mmc: tmio-common: Drop custom dma mapping functions
Drop local dma_map_single() and dma_unmap_single() and use arch specific common implementation Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
c0a5a81f74
commit
eaa8b04da3
1 changed files with 3 additions and 22 deletions
|
@ -4,6 +4,7 @@
|
||||||
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <asm/dma-mapping.h>
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <clk.h>
|
#include <clk.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
|
@ -76,26 +77,6 @@ void tmio_sd_writel(struct tmio_sd_priv *priv,
|
||||||
writel(val, priv->regbase + reg);
|
writel(val, priv->regbase + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dma_addr_t __dma_map_single(void *ptr, size_t size,
|
|
||||||
enum dma_data_direction dir)
|
|
||||||
{
|
|
||||||
unsigned long addr = (unsigned long)ptr;
|
|
||||||
|
|
||||||
if (dir == DMA_FROM_DEVICE)
|
|
||||||
invalidate_dcache_range(addr, addr + size);
|
|
||||||
else
|
|
||||||
flush_dcache_range(addr, addr + size);
|
|
||||||
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __dma_unmap_single(dma_addr_t addr, size_t size,
|
|
||||||
enum dma_data_direction dir)
|
|
||||||
{
|
|
||||||
if (dir != DMA_TO_DEVICE)
|
|
||||||
invalidate_dcache_range(addr, addr + size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int tmio_sd_check_error(struct udevice *dev, struct mmc_cmd *cmd)
|
static int tmio_sd_check_error(struct udevice *dev, struct mmc_cmd *cmd)
|
||||||
{
|
{
|
||||||
struct tmio_sd_priv *priv = dev_get_priv(dev);
|
struct tmio_sd_priv *priv = dev_get_priv(dev);
|
||||||
|
@ -362,7 +343,7 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
|
||||||
|
|
||||||
tmio_sd_writel(priv, tmp, TMIO_SD_DMA_MODE);
|
tmio_sd_writel(priv, tmp, TMIO_SD_DMA_MODE);
|
||||||
|
|
||||||
dma_addr = __dma_map_single(buf, len, dir);
|
dma_addr = dma_map_single(buf, len, dir);
|
||||||
|
|
||||||
tmio_sd_dma_start(priv, dma_addr);
|
tmio_sd_dma_start(priv, dma_addr);
|
||||||
|
|
||||||
|
@ -371,7 +352,7 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
|
||||||
if (poll_flag == TMIO_SD_DMA_INFO1_END_RD)
|
if (poll_flag == TMIO_SD_DMA_INFO1_END_RD)
|
||||||
udelay(1);
|
udelay(1);
|
||||||
|
|
||||||
__dma_unmap_single(dma_addr, len, dir);
|
dma_unmap_single(buf, len, dir);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue