]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
parisc: move internal implementation details out of <asm/dma-mapping.h>
authorChristoph Hellwig <hch@lst.de>
Tue, 29 Jan 2019 18:13:04 +0000 (19:13 +0100)
committerHelge Deller <deller@gmx.de>
Thu, 21 Feb 2019 19:37:11 +0000 (20:37 +0100)
Move everything that is not required for the public facing DMA API out
of <asm/dma-mapping.h> and into a new drivers/parisc/iommu.h header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/dma-mapping.h
drivers/parisc/ccio-dma.c
drivers/parisc/dino.c
drivers/parisc/eisa.c
drivers/parisc/hppb.c
drivers/parisc/iommu.h [new file with mode: 0644]
drivers/parisc/lba_pci.c
drivers/parisc/sba_iommu.c

index f1bf5e297f1c1aa910b560b9802f614f9d06b875..d5bd94247371e062748d3bf6ff5009e12f5b7306 100644 (file)
@@ -26,48 +26,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
        return hppa_dma_ops;
 }
 
-static inline void *
-parisc_walk_tree(struct device *dev)
-{
-       struct device *otherdev;
-       if(likely(dev->platform_data != NULL))
-               return dev->platform_data;
-       /* OK, just traverse the bus to find it */
-       for(otherdev = dev->parent; otherdev;
-           otherdev = otherdev->parent) {
-               if(otherdev->platform_data) {
-                       dev->platform_data = otherdev->platform_data;
-                       break;
-               }
-       }
-       return dev->platform_data;
-}
-
-#define GET_IOC(dev) ({                                        \
-       void *__pdata = parisc_walk_tree(dev);          \
-       __pdata ? HBA_DATA(__pdata)->iommu : NULL;      \
-})
-
-#ifdef CONFIG_IOMMU_CCIO
-struct parisc_device;
-struct ioc;
-void * ccio_get_iommu(const struct parisc_device *dev);
-int ccio_request_resource(const struct parisc_device *dev,
-               struct resource *res);
-int ccio_allocate_resource(const struct parisc_device *dev,
-               struct resource *res, unsigned long size,
-               unsigned long min, unsigned long max, unsigned long align);
-#else /* !CONFIG_IOMMU_CCIO */
-#define ccio_get_iommu(dev) NULL
-#define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res)
-#define ccio_allocate_resource(dev, res, size, min, max, align) \
-               allocate_resource(&iomem_resource, res, size, min, max, \
-                               align, NULL, NULL)
-#endif /* !CONFIG_IOMMU_CCIO */
-
-#ifdef CONFIG_IOMMU_SBA
-struct parisc_device;
-void * sba_get_iommu(struct parisc_device *dev);
-#endif
-
 #endif
index 8d2fc84119c6f854a2fbf6834f8eb2db16c334d0..b17e81cf77d5afb467b37f4aab2c2178d7711c4b 100644 (file)
@@ -55,6 +55,8 @@
 #include <asm/hardware.h>       /* for register_module() */
 #include <asm/parisc-device.h>
 
+#include "iommu.h"
+
 /* 
 ** Choose "ccio" since that's what HP-UX calls it.
 ** Make it easier for folks to migrate from one to the other :^)
index dfeea458a789ebf5d49c21e89c1ca79ef63767e9..6f348c75687c48ab14557dde62f5efeec3912cf4 100644 (file)
@@ -59,6 +59,7 @@
 #include <asm/hardware.h>
 
 #include "gsc.h"
+#include "iommu.h"
 
 #undef DINO_DEBUG
 
index 9ff434f354bdbb7b8ec15c7168c9eaeb40085769..5657a1d3eb2b2321fafa2c4781919ddd31d83e0f 100644 (file)
@@ -45,6 +45,8 @@
 #include <asm/eisa_bus.h>
 #include <asm/eisa_eeprom.h>
 
+#include "iommu.h"
+
 #if 0
 #define EISA_DBG(msg, arg...) printk(KERN_DEBUG "eisa: " msg, ## arg)
 #else
index ebc7b617e5d0033c184387afb932cb9e94a658c7..3b3481c0d81d49dda302b0ca3bcf68d9bf7dee1a 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/hardware.h>
 #include <asm/parisc-device.h>
 
+#include "iommu.h"
+
 struct hppb_card {
        unsigned long hpa;
        struct resource mmio_region;
diff --git a/drivers/parisc/iommu.h b/drivers/parisc/iommu.h
new file mode 100644 (file)
index 0000000..5a38b63
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef _IOMMU_H
+#define _IOMMU_H 1
+
+#include <linux/pci.h>
+
+struct parisc_device;
+struct ioc;
+
+static inline void *parisc_walk_tree(struct device *dev)
+{
+       struct device *otherdev;
+
+       if (likely(dev->platform_data))
+               return dev->platform_data;
+
+       /* OK, just traverse the bus to find it */
+       for (otherdev = dev->parent;
+            otherdev;
+            otherdev = otherdev->parent) {
+               if (otherdev->platform_data) {
+                       dev->platform_data = otherdev->platform_data;
+                       break;
+               }
+       }
+
+       return dev->platform_data;
+}
+
+#define GET_IOC(dev) ({                                        \
+       void *__pdata = parisc_walk_tree(dev);          \
+       __pdata ? HBA_DATA(__pdata)->iommu : NULL;      \
+})
+
+#ifdef CONFIG_IOMMU_CCIO
+void *ccio_get_iommu(const struct parisc_device *dev);
+int ccio_request_resource(const struct parisc_device *dev,
+               struct resource *res);
+int ccio_allocate_resource(const struct parisc_device *dev,
+               struct resource *res, unsigned long size,
+               unsigned long min, unsigned long max, unsigned long align);
+#else /* !CONFIG_IOMMU_CCIO */
+#define ccio_get_iommu(dev) NULL
+#define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res)
+#define ccio_allocate_resource(dev, res, size, min, max, align) \
+               allocate_resource(&iomem_resource, res, size, min, max, \
+                               align, NULL, NULL)
+#endif /* !CONFIG_IOMMU_CCIO */
+
+void *sba_get_iommu(struct parisc_device *dev);
+
+#endif /* _IOMMU_H */
index d376201bc6a0a7f8703a656aeeb3ddbab45aa867..dcea155888336ab74c2be9fc161ba7e4dcc5698a 100644 (file)
@@ -49,6 +49,8 @@
 #include <asm/parisc-device.h>
 #include <asm/io.h>            /* read/write stuff */
 
+#include "iommu.h"
+
 #undef DEBUG_LBA       /* general stuff */
 #undef DEBUG_LBA_PORT  /* debug I/O Port access */
 #undef DEBUG_LBA_CFG   /* debug Config Space Access (ie PCI Bus walk) */
index 42172eb322359343fd9e85a39a753d88d356b4cf..afaf8e6aefe699940ce1bd55dc1fb334020a109f 100644 (file)
@@ -49,6 +49,8 @@
 #include <asm/pdcpat.h>                /* for is_pdc_pat() */
 #include <asm/parisc-device.h>
 
+#include "iommu.h"
+
 #define MODULE_NAME "SBA"
 
 /*