From fc7943d29e9f6f5f6d4b111120b66ec86501673e Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Tue, 22 Jan 2013 16:53:57 +0530 Subject: ARC: [Review] Multi-platform image #6: cpu-to-dma-addr optional All the current platforms can work with 0x8000_0000 based dma_addr_t since the Bus Bridges typically ignore the top bit (the only excpetion was Angel4 PCI-AHB bridge which we no longer care for). That way we don't need plat-specific cpu-addr to bus-addr conversion. Hooks still provided - just in case a platform has an obscure device which say needs 0 based bus address. That way no longer needs to unconditinally include Also verfied that on Angel4 board, other peripherals (IDE-disk / EMAC) work fine with 0x8000_0000 based dma addresses. Signed-off-by: Vineet Gupta Cc: Arnd Bergmann Acked-by: Arnd Bergmann --- arch/arc/plat-arcfpga/include/plat/dma_addr.h | 45 --------------------------- 1 file changed, 45 deletions(-) delete mode 100644 arch/arc/plat-arcfpga/include/plat/dma_addr.h (limited to 'arch/arc/plat-arcfpga') diff --git a/arch/arc/plat-arcfpga/include/plat/dma_addr.h b/arch/arc/plat-arcfpga/include/plat/dma_addr.h deleted file mode 100644 index 0e963431b72..00000000000 --- a/arch/arc/plat-arcfpga/include/plat/dma_addr.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * vineetg: Feb 2009 - * -For AA4 board, kernel to DMA address APIs - */ - -/* - * kernel addresses are 0x800_000 based, while Bus addr are 0 based - */ - -#ifndef __PLAT_DMA_ADDR_H -#define __PLAT_DMA_ADDR_H - -#include - -static inline unsigned long plat_dma_addr_to_kernel(struct device *dev, - dma_addr_t dma_addr) -{ - return dma_addr + PAGE_OFFSET; -} - -static inline dma_addr_t plat_kernel_addr_to_dma(struct device *dev, void *ptr) -{ - unsigned long addr = (unsigned long)ptr; - /* - * To Catch buggy drivers which can call DMA map API with kernel vaddr - * i.e. for buffers alloc via vmalloc or ioremap which are not - * gaurnateed to be PHY contiguous and hence unfit for DMA anyways. - * On ARC kernel virtual address is 0x7000_0000 to 0x7FFF_FFFF, so - * ideally we want to check this range here, but our implementation is - * better as it checks for even worse user virtual address as well. - */ - if (likely(addr >= PAGE_OFFSET)) - return addr - PAGE_OFFSET; - - BUG(); - return addr; -} - -#endif -- cgit v1.2.3