All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 3/4] mtd: denali: Drop custom dma mapping functions
Date: Thu, 16 Jan 2020 14:23:47 +0530	[thread overview]
Message-ID: <20200116085348.24031-4-vigneshr@ti.com> (raw)
In-Reply-To: <20200116085348.24031-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>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 drivers/mtd/nand/raw/denali.c | 35 +++--------------------------------
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 0a7ca8a8dfb4..8537c609fb62 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -5,7 +5,7 @@
  * Copyright (C) 2009-2010, Intel Corporation and its suppliers.
  */
 
-#include <cpu_func.h>
+#include <asm/dma-mapping.h>
 #include <dm.h>
 #include <nand.h>
 #include <linux/bitfield.h>
@@ -17,35 +17,6 @@
 
 #include "denali.h"
 
-static dma_addr_t dma_map_single(void *dev, void *ptr, size_t size,
-				 enum dma_data_direction dir)
-{
-	unsigned long addr = (unsigned long)ptr;
-
-	size = ALIGN(size, ARCH_DMA_MINALIGN);
-
-	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(void *dev, dma_addr_t addr, size_t size,
-			     enum dma_data_direction dir)
-{
-	size = ALIGN(size, ARCH_DMA_MINALIGN);
-
-	if (dir != DMA_TO_DEVICE)
-		invalidate_dcache_range(addr, addr + size);
-}
-
-static int dma_mapping_error(void *dev, dma_addr_t addr)
-{
-	return 0;
-}
-
 #define DENALI_NAND_NAME    "denali-nand"
 
 /* for Indexed Addressing */
@@ -565,7 +536,7 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,
 	enum dma_data_direction dir = write ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
 	int ret = 0;
 
-	dma_addr = dma_map_single(denali->dev, buf, size, dir);
+	dma_addr = dma_map_single(buf, size, dir);
 	if (dma_mapping_error(denali->dev, dma_addr)) {
 		dev_dbg(denali->dev, "Failed to DMA-map buffer. Trying PIO.\n");
 		return denali_pio_xfer(denali, buf, size, page, raw, write);
@@ -606,7 +577,7 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,
 
 	iowrite32(0, denali->reg + DMA_ENABLE);
 
-	dma_unmap_single(denali->dev, dma_addr, size, dir);
+	dma_unmap_single(buf, size, dir);
 
 	if (irq_status & INTR__ERASED_PAGE)
 		memset(buf, 0xff, size);
-- 
2.25.0

  parent reply	other threads:[~2020-01-16  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  8:53 [PATCH v2 0/4] dma-mapping: Add cache flush/invalidation to dma_{un}map_single Vignesh Raghavendra
2020-01-16  8:53 ` [PATCH v2 1/4] asm: dma-mapping.h: Fix dma mapping functions Vignesh Raghavendra
2020-01-25 17:09   ` Tom Rini
2020-01-16  8:53 ` [PATCH v2 2/4] mmc: tmio-common: Drop custom " Vignesh Raghavendra
2020-01-25 17:09   ` Tom Rini
2020-01-16  8:53 ` Vignesh Raghavendra [this message]
2020-01-25 17:09   ` [PATCH v2 3/4] mtd: denali: " Tom Rini
2020-01-16  8:53 ` [PATCH v2 4/4] net: macb: Drop local cache flush Vignesh Raghavendra
2020-01-25 17:09   ` Tom Rini
2020-01-24  5:22 ` [PATCH v2 0/4] dma-mapping: Add cache flush/invalidation to dma_{un}map_single 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=20200116085348.24031-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.