Skip to contentSkip to conversation

xtensa: reimplement DMA API using common helpers

PATCH New Max Filippov 1 participant 1 message Jul 6, 2015 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore

Max Filippov

author maintainer
#0 lore raw

PATCH 1/1 xtensa: reimplement DMA API using common helpers

- keep existing functionality: don't handle attributes, don't support high memory;
- implement scatterlist primitives (map/unmap/sync);
- enable DMA API debug.

---
 arch/xtensa/Kconfig                   |   2 +
 arch/xtensa/include/asm/Kbuild        |   1 -
 arch/xtensa/include/asm/device.h      |  19 ++++
 arch/xtensa/include/asm/dma-mapping.h | 186 +++++++------------------------
 arch/xtensa/kernel/pci-dma.c          | 203 +++++++++++++++++++++++++++++-----
 5 files changed, 233 insertions(+), 178 deletions(-)
 create mode 100644 arch/xtensa/include/asm/device.h
arch/xtensa/Kconfig +2 -0
index e5b872b..6ce10f9 100644
@@ -14,6 +14,8 @@ config XTENSA
 	select GENERIC_IRQ_SHOW
 	select GENERIC_PCI_IOMAP
 	select GENERIC_SCHED_CLOCK
+	select HAVE_DMA_API_DEBUG
+	select HAVE_DMA_ATTRS
 	select HAVE_FUNCTION_TRACER
 	select HAVE_IRQ_TIME_ACCOUNTING
 	select HAVE_OPROFILE
arch/xtensa/include/asm/Kbuild +0 -1
index 14d15bf..d870a59 100644
@@ -2,7 +2,6 @@ generic-y += bitsperlong.h
 generic-y += bug.h
 generic-y += clkdev.h
 generic-y += cputime.h
-generic-y += device.h
 generic-y += div64.h
 generic-y += emergency-restart.h
 generic-y += errno.h
arch/xtensa/include/asm/device.h new file +19 -0
new file mode 100644
index 0000000..fe1f5c8
@@ -0,0 +1,19 @@
+/*
+ * Arch specific extensions to struct device
+ *
+ * This file is released under the GPLv2
+ */
+#ifndef _ASM_XTENSA_DEVICE_H
+#define _ASM_XTENSA_DEVICE_H
+
+struct dma_map_ops;
+
+struct dev_archdata {
+	/* DMA operations on that device */
+	struct dma_map_ops *dma_ops;
+};
+
+struct pdev_archdata {
+};
+
+#endif /* _ASM_XTENSA_DEVICE_H */
arch/xtensa/include/asm/dma-mapping.h +39 -147

231 lines not on this page · raw message

arch/xtensa/kernel/pci-dma.c +173 -30

242 lines not on this page · raw message

Signature · 1 line
1.8.1.4