summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm
diff options
context:
space:
mode:
authorLinus Torvalds2018-08-21 22:18:22 +0200
committerLinus Torvalds2018-08-21 22:18:22 +0200
commit5e26830990a9e8816b6854f77c550f1c847d89d8 (patch)
treeada88a4d2c241323dbaead5c776cb769805c9b2a /arch/microblaze/mm
parentMerge tag 'please-pull-noboot' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parentmicroblaze/PCI: Remove stale pcibios_align_resource() comment (diff)
downloadkernel-qcow2-linux-5e26830990a9e8816b6854f77c550f1c847d89d8.tar.gz
kernel-qcow2-linux-5e26830990a9e8816b6854f77c550f1c847d89d8.tar.xz
kernel-qcow2-linux-5e26830990a9e8816b6854f77c550f1c847d89d8.zip
Merge tag 'microblaze-v4.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze
Pull arch/microblaze updates from Michal Simek: - use generic noncoherent direct mapping - use LDFLAGS instead of LD - pci error path fix - remove incorrect comments * tag 'microblaze-v4.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze: microblaze/PCI: Remove stale pcibios_align_resource() comment microblaze: delete wrong comment about machine_early_init microblaze: add endianness options to LDFLAGS instead of LD microblaze: remove consistent_sync and consistent_sync_page microblaze: use generic dma_noncoherent_ops microblaze: warn if of_iomap() failed
Diffstat (limited to 'arch/microblaze/mm')
-rw-r--r--arch/microblaze/mm/consistent.c54
1 files changed, 5 insertions, 49 deletions
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c
index b06c3a7faf20..c9a278ac795a 100644
--- a/arch/microblaze/mm/consistent.c
+++ b/arch/microblaze/mm/consistent.c
@@ -33,6 +33,7 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/gfp.h>
+#include <linux/dma-noncoherent.h>
#include <asm/pgalloc.h>
#include <linux/io.h>
@@ -59,7 +60,8 @@
* uncached region. This will no doubt cause big problems if memory allocated
* here is not also freed properly. -- JW
*/
-void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
+void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
+ gfp_t gfp, unsigned long attrs)
{
unsigned long order, vaddr;
void *ret;
@@ -154,7 +156,6 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
return ret;
}
-EXPORT_SYMBOL(consistent_alloc);
#ifdef CONFIG_MMU
static pte_t *consistent_virt_to_pte(void *vaddr)
@@ -178,7 +179,8 @@ unsigned long consistent_virt_to_pfn(void *vaddr)
/*
* free page(s) as defined by the above mapping.
*/
-void consistent_free(size_t size, void *vaddr)
+void arch_dma_free(struct device *dev, size_t size, void *vaddr,
+ dma_addr_t dma_addr, unsigned long attrs)
{
struct page *page;
@@ -218,49 +220,3 @@ void consistent_free(size_t size, void *vaddr)
flush_tlb_all();
#endif
}
-EXPORT_SYMBOL(consistent_free);
-
-/*
- * make an area consistent.
- */
-void consistent_sync(void *vaddr, size_t size, int direction)
-{
- unsigned long start;
- unsigned long end;
-
- start = (unsigned long)vaddr;
-
- /* Convert start address back down to unshadowed memory region */
-#ifdef CONFIG_XILINX_UNCACHED_SHADOW
- start &= ~UNCACHED_SHADOW_MASK;
-#endif
- end = start + size;
-
- switch (direction) {
- case PCI_DMA_NONE:
- BUG();
- case PCI_DMA_FROMDEVICE: /* invalidate only */
- invalidate_dcache_range(start, end);
- break;
- case PCI_DMA_TODEVICE: /* writeback only */
- flush_dcache_range(start, end);
- break;
- case PCI_DMA_BIDIRECTIONAL: /* writeback and invalidate */
- flush_dcache_range(start, end);
- break;
- }
-}
-EXPORT_SYMBOL(consistent_sync);
-
-/*
- * consistent_sync_page makes memory consistent. identical
- * to consistent_sync, but takes a struct page instead of a
- * virtual address
- */
-void consistent_sync_page(struct page *page, unsigned long offset,
- size_t size, int direction)
-{
- unsigned long start = (unsigned long)page_address(page) + offset;
- consistent_sync((void *)start, size, direction);
-}
-EXPORT_SYMBOL(consistent_sync_page);