summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/dma-mapping.h
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] make page_to_dma() highmem awareNicolas Pitre2009-03-161-0/+10
| | | | | | | | | | | | | | | | | | If a machine class has a custom __virt_to_bus() implementation then it must provide a __arch_page_to_dma() implementation as well which is _not_ based on page_address() to support highmem. This patch fixes existing __arch_page_to_dma() and provide a default implementation otherwise. The default implementation for highmem is based on __pfn_to_bus() which is defined only when no custom __virt_to_bus() is provided by the machine class. That leaves only ebsa110 and footbridge which cannot support highmem until they provide their own __arch_page_to_dma() implementation. But highmem support on those legacy platforms with limited memory is certainly not a priority. Signed-off-by: Nicolas Pitre <nico@marvell.com>
* [ARM] introduce dma_cache_maint_page()Nicolas Pitre2009-03-161-1/+3
| | | | | | | | | | | | This is a helper to be used by the DMA mapping API to handle cache maintenance for memory identified by a page structure instead of a virtual address. Those pages may or may not be highmem pages, and when they're highmem pages, they may or may not be virtually mapped. When they're not mapped then there is no L1 cache to worry about. But even in that case the L2 cache must be processed since unmapped highmem pages can still be L2 cached. Signed-off-by: Nicolas Pitre <nico@marvell.com>
* [ARM] dma: correct dma_supported() implementationRussell King2008-12-131-1/+3
| | | | | | | | | | dma_supported() is supposed to indicate whether the system can support the DMA mask it was passed, which depends on the maximal address which can be returned for DMA allocations. If the mask is smaller than that, we are unable to guarantee that the driver can reliably obtain suitable memory. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma-mapping: fix compiler warningRussell King2008-11-131-2/+11
| | | | | | | arch/arm/mm/dma-mapping.c: In function `dma_sync_sg_for_cpu': arch/arm/mm/dma-mapping.c:588: warning: statement with no effect Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: fix some comments in dma-mapping.hRussell King2008-09-301-8/+7Star
| | | | | | ... to prevent people being mislead. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: don't touch cache on dma_*_for_cpu()Russell King2008-09-301-5/+1Star
| | | | | | | | | | As per the dma_unmap_* calls, we don't touch the cache when a DMA buffer transitions from device to CPU ownership. Presently, no problems have been identified with speculative cache prefetching which in itself is a new feature in later architectures. We may have to revisit the DMA API later for these architectures anyway. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: add validation of DMA paramsRussell King2008-09-291-0/+8
| | | | | | | | Validate the direction argument like x86 does. In addition, validate the dma_unmap_* parameters against those passed to dma_map_* when using the DMA bounce code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: coding style cleanupsRussell King2008-09-291-56/+48Star
| | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: fix dmabounce dma_sync_xxx() implementationsRussell King2008-09-291-15/+11Star
| | | | | | | | | | | | | | | | | The dmabounce dma_sync_xxx() implementation have been broken for quite some time; they all copy data between the DMA buffer and the CPU visible buffer no irrespective of the change of ownership. (IOW, a DMA_FROM_DEVICE mapping copies data from the DMA buffer to the CPU buffer during a call to dma_sync_single_for_device().) Fix it by getting rid of sync_single(), moving the contents into the recently created dmabounce_sync_for_xxx() functions and adjusting appropriately. This also makes it possible to properly support the DMA range sync functions. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: use new dmabounce_sync_for_xxx() for dma_sync_single_xxx()Russell King2008-09-291-74/+76
| | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: Reduce to one dma_sync_sg_* implementationRussell King2008-09-291-0/+11
| | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma: provide a better dma_map_page() implementationRussell King2008-09-261-1/+10
| | | | | | | | We can translate a struct page directly to a DMA address using page_to_dma(). No need to use page_address() followed by virt_to_dma(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] Update dma_map_sg()/dma_unmap_sg() APIRussell King2008-09-251-110/+5Star
| | | | | | Update the ARM DMA scatter gather APIs for the scatterlist changes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma-mapping: provide sync_range APIsRussell King2008-08-101-11/+28
| | | | | | | Convert the existing dma_sync_single_for_* APIs to the new range based APIs, and make the dma_sync_single_for_* API a superset of it. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] dma-mapping: improve type-safeness of DMA translationsRussell King2008-08-101-7/+44
| | | | | | | | | | | | | | OMAP at least gets the return type(s) for the DMA translation functions wrong, which can lead to subtle errors. Avoid this by moving the DMA translation functions to asm/dma-mapping.h, and converting them to inline functions. Fix the OMAP DMA translation macros to use the correct argument and result types. Also, remove the unnecessary casts in dmabounce.c. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds2008-08-031-0/+2
| | | | | | | | | | | | | | | | * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 5182/1: pxa: Fix pcm990 compilation [ARM] Fix explicit asm(-arm)?/arch-foo references [ARM] move include/asm-arm to arch/arm/include/asm [ARM] Remove explicit dependency for misc.o from compressed/Makefile [ARM] initrd: claim initrd memory exclusively [ARM] pxa: add support for L2 outer cache on XScale3 (attempt 2) [ARM] 5180/1: at91: Fix at91_nand -> atmel_nand rename fallout [ARM] add Sascha Hauer as Freescale i.MX Maintainer [ARM] i.MX: add missing clock functions exports [ARM] i.MX: remove set_imx_fb_info() export [ARM] mx1ads: make mmc platform data available for modules [ARM] mx2: add missing Kconfig dependency
* [ARM] move include/asm-arm to arch/arm/include/asmRussell King2008-08-021-0/+456
Move platform independent header files to arch/arm/include/asm, leaving those in asm/arch* and asm/plat* alone. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>