summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/dma-mapping.h
Commit message (Collapse)AuthorAgeFilesLines
* dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>Masahiro Yamada2020-02-191-26/+0
| | | | | | | | | | | | | | | | | | The implementation of dma_map_single() and dma_unmap_single() is exactly the same for all the architectures that support them. Factor them out to <linux/dma-mapping.h>, and make all drivers to include <linux/dma-mapping.h> instead of <asm/dma-mapping.h>. If we need to differentiate them for some architectures, we can move the generic definitions to <asm-generic/dma-mapping.h>. Add some comments to the helpers. The concept is quite similar to the DMA-API of Linux kernel. Drivers are agnostic about what is going on behind the scene. Just call dma_map_single() before the DMA, and dma_unmap_single() after it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* dma-mapping: fix the prototype of dma_unmap_single()Masahiro Yamada2020-02-191-3/+1
| | | | | | dma_unmap_single() takes the dma address, not virtual address. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* dma-mapping: fix the prototype of dma_map_single()Masahiro Yamada2020-02-191-2/+3
| | | | | | | Make dma_map_single() return the dma address, and remove the pointless volatile. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* asm: dma-mapping.h: Fix dma mapping functionsVignesh Raghavendra2020-01-251-2/+21
| | | | | | | | | | | | | | | Subsystems such as USB expect dma_map_single() and dma_unmap_single() to do dcache flush/invalidate operations as required. For example, see see drivers/usb/gadget/udc/udc-core.c::usb_gadget_map_request(). Currently drivers do this locally, (see drivers/usb/dwc3/ep0.c, drivers/mtd/nand/raw/denali.c etc..) Update arch specific dma_map_single() and dma_unmap_single() APIs to do cache flush/invalidate operations, so that drivers need not implement them locally. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Rick Chen <rick@andestech.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* dma: import linux/dma-direction.h to consolidate enum dma_data_directionMasahiro Yamada2017-09-121-6/+2
| | | | | | | | Import include/linux/dma-direction.h from Linux 4.13-rc7 and delete duplicated definitions of enum dma_data_direction. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* x86: Add dma-mapping.h to architectural codeAndy Shevchenko2017-07-301-0/+41
Some cross-platform drivers rely on this header present. Make it so for x86. It's just a copy'n'paste of arch/arm/include/asm/dma-mapping.h. Suggested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>