Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b8eeab0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Helge Deller
Browse files

parisc: move internal implementation details out of <asm/dma-mapping.h>



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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 3e803d3e
Loading
Loading
Loading
Loading
+0 −44
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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 :^)
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
#include <asm/hardware.h>

#include "gsc.h"
#include "iommu.h"

#undef DINO_DEBUG

+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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;
Loading