static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction, struct dma_attrs *attrs) { if (cpu_is_noncoherent_r10000(dev)) __dma_sync(dma_addr_to_virt(dev, dma_addr), size, direction); plat_unmap_dma_mem(dev, dma_addr, size, direction); }
void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction) { if (cpu_is_noncoherent_r10000(dev)) __dma_sync(dma_addr_to_virt(dev, dma_addr), size, direction); plat_unmap_dma_mem(dev, dma_addr, size, direction); }
static void mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) { if (cpu_is_noncoherent_r10000(dev)) { unsigned long addr; addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr, size, direction); } }
void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction) { BUG_ON(direction == DMA_NONE); if (cpu_is_noncoherent_r10000(dev)) { unsigned long addr; addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr + offset, size, direction); } }
static void mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { int i; /* Make sure that gcc doesn't leave the empty loop body. */ for (i = 0; i < nelems; i++, sg++) { if (cpu_is_noncoherent_r10000(dev)) __dma_sync((unsigned long)page_address(sg_page(sg)), sg->length, direction); } }
void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { int i; BUG_ON(direction == DMA_NONE); /* Make sure that gcc doesn't leave the empty loop body. */ for (i = 0; i < nelems; i++, sg++) { if (cpu_is_noncoherent_r10000(dev)) __dma_sync((unsigned long)page_address(sg->page), sg->length, direction); plat_unmap_dma_mem(sg->dma_address); } }
void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) { BUG_ON(direction == DMA_NONE); if (cpu_is_noncoherent_r10000(dev)) { unsigned long addr; addr = dma_addr_to_virt(dev, dma_handle); __dma_sync(addr, size, direction); } #ifdef CONFIG_BRCMSTB brcm_sync_for_cpu(dma_addr_to_virt(dev, dma_handle), size, direction); #endif }
void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { int i; BUG_ON(direction == DMA_NONE); /* Make sure that gcc doesn't leave the empty loop body. */ for (i = 0; i < nelems; i++, sg++) { if (cpu_is_noncoherent_r10000(dev)) __dma_sync((unsigned long)page_address(sg_page(sg)), sg->length, direction); #ifdef CONFIG_BRCMSTB brcm_sync_for_cpu((unsigned long)page_address(sg_page(sg)), sg->length, direction); #endif } }