From: Vignesh Raghavendra <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] mmc: tmio-common: Drop custom dma mapping functions
Date: Fri, 15 Nov 2019 17:25:03 +0530 [thread overview]
Message-ID: <20191115115505.893-3-vigneshr@ti.com> (raw)
In-Reply-To: <20191115115505.893-1-vigneshr@ti.com>
Drop local dma_map_single() and dma_unmap_single() and use arch specific
common implementation
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
drivers/mmc/tmio-common.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index 812205a21f6a..37c2b8555150 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -4,6 +4,7 @@
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*/
+#include <asm/dma-mapping.h>
#include <common.h>
#include <clk.h>
#include <fdtdec.h>
@@ -75,26 +76,6 @@ void tmio_sd_writel(struct tmio_sd_priv *priv,
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)
{
struct tmio_sd_priv *priv = dev_get_priv(dev);
@@ -361,7 +342,7 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
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);
@@ -370,7 +351,7 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
if (poll_flag == TMIO_SD_DMA_INFO1_END_RD)
udelay(1);
- __dma_unmap_single(dma_addr, len, dir);
+ dma_unmap_single(buf, len, dir);
return ret;
}
--
2.24.0
next prev parent reply other threads:[~2019-11-15 11:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 11:55 [U-Boot] [PATCH 0/4] dma-mapping: Add cache flush/invalidation to dma_{un}map_single Vignesh Raghavendra
2019-11-15 11:55 ` [U-Boot] [PATCH 1/4] asm: dma-mapping.h: Fix dma mapping functions Vignesh Raghavendra
2019-11-15 12:19 ` Masahiro Yamada
[not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA469DB69@ATCPCS16.andestech.com>
2019-11-19 0:51 ` Rick Chen
2020-01-15 20:47 ` Tom Rini
2020-01-16 8:56 ` Vignesh Raghavendra
2019-11-15 11:55 ` Vignesh Raghavendra [this message]
2019-11-15 12:18 ` [U-Boot] [PATCH 2/4] mmc: tmio-common: Drop custom " Masahiro Yamada
2019-11-15 11:55 ` [U-Boot] [PATCH 3/4] mtd: denali: " Vignesh Raghavendra
2019-11-15 12:18 ` Masahiro Yamada
2019-11-15 11:55 ` [U-Boot] [PATCH 4/4] net: macb: Drop local cache flush Vignesh Raghavendra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191115115505.893-3-vigneshr@ti.com \
--to=vigneshr@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox