Skip to content

Commit

Permalink
Merge branch 'omap-for-v3.8/cleanup-headers-iommu' of git://git.kerne…
Browse files Browse the repository at this point in the history
…l.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/omap
  • Loading branch information
Joerg Roedel committed Dec 3, 2012
2 parents 9489e9d + 2ab7c84 commit 18e170d
Show file tree
Hide file tree
Showing 21 changed files with 279 additions and 291 deletions.
2 changes: 0 additions & 2 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o
obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
mailbox_mach-objs := mailbox.o

obj-$(CONFIG_OMAP_IOMMU) += iommu2.o

iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o
obj-y += $(iommu-m) $(iommu-y)

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static struct platform_device omap2cam_device = {

#if defined(CONFIG_IOMMU_API)

#include <plat/iommu.h>
#include <linux/platform_data/iommu-omap.h>

static struct resource omap3isp_resources[] = {
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>

#include <plat/iommu.h>
#include <linux/platform_data/iommu-omap.h>

#include "soc.h"
#include "common.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <plat/mmc.h>
#include <linux/platform_data/asoc-ti-mcbsp.h>
#include <linux/platform_data/spi-omap2-mcspi.h>
#include <linux/platform_data/iommu-omap.h>
#include <plat/dmtimer.h>
#include <plat/iommu.h>

#include "am35xx.h"

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include <plat/dma.h>
#include <linux/platform_data/spi-omap2-mcspi.h>
#include <linux/platform_data/asoc-ti-mcbsp.h>
#include <linux/platform_data/iommu-omap.h>
#include <plat/mmc.h>
#include <plat/dmtimer.h>
#include <plat/common.h>
#include <plat/iommu.h>

#include "omap_hwmod_common_data.h"
#include "cm1_44xx.h"
Expand Down
96 changes: 0 additions & 96 deletions arch/arm/plat-omap/include/plat/iommu2.h

This file was deleted.

89 changes: 0 additions & 89 deletions arch/arm/plat-omap/include/plat/iovmm.h

This file was deleted.

1 change: 1 addition & 0 deletions drivers/iommu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ obj-$(CONFIG_DMAR_TABLE) += dmar.o
obj-$(CONFIG_INTEL_IOMMU) += iova.o intel-iommu.o
obj-$(CONFIG_IRQ_REMAP) += intel_irq_remapping.o irq_remapping.o
obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o
obj-$(CONFIG_OMAP_IOMMU) += omap-iommu2.o
obj-$(CONFIG_OMAP_IOVMM) += omap-iovmm.o
obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o
obj-$(CONFIG_TEGRA_IOMMU_GART) += tegra-gart.o
Expand Down
8 changes: 4 additions & 4 deletions drivers/iommu/omap-iommu-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#include <linux/uaccess.h>
#include <linux/platform_device.h>
#include <linux/debugfs.h>
#include <linux/omap-iommu.h>
#include <linux/platform_data/iommu-omap.h>

#include <plat/iommu.h>
#include <plat/iovmm.h>

#include <plat/iopgtable.h>
#include "omap-iopgtable.h"
#include "omap-iommu.h"

#define MAXCOLUMN 100 /* for short messages */

Expand Down
39 changes: 37 additions & 2 deletions drivers/iommu/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/iommu.h>
#include <linux/omap-iommu.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/io.h>

#include <asm/cacheflush.h>

#include <plat/iommu.h>
#include <linux/platform_data/iommu-omap.h>

#include <plat/iopgtable.h>
#include "omap-iopgtable.h"
#include "omap-iommu.h"

#define for_each_iotlb_cr(obj, n, __i, cr) \
for (__i = 0; \
Expand All @@ -51,6 +54,21 @@ struct omap_iommu_domain {
spinlock_t lock;
};

#define MMU_LOCK_BASE_SHIFT 10
#define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT)
#define MMU_LOCK_BASE(x) \
((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT)

#define MMU_LOCK_VICT_SHIFT 4
#define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT)
#define MMU_LOCK_VICT(x) \
((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT)

struct iotlb_lock {
short base;
short vict;
};

/* accommodate the difference between omap1 and omap2/3 */
static const struct iommu_functions *arch_iommu;

Expand Down Expand Up @@ -1015,6 +1033,23 @@ static void iopte_cachep_ctor(void *iopte)
clean_dcache_area(iopte, IOPTE_TABLE_SIZE);
}

static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa,
u32 flags)
{
memset(e, 0, sizeof(*e));

e->da = da;
e->pa = pa;
e->valid = 1;
/* FIXME: add OMAP1 support */
e->pgsz = flags & MMU_CAM_PGSZ_MASK;
e->endian = flags & MMU_RAM_ENDIAN_MASK;
e->elsz = flags & MMU_RAM_ELSZ_MASK;
e->mixed = flags & MMU_RAM_MIXED_MASK;

return iopgsz_to_bytes(e->pgsz);
}

static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
phys_addr_t pa, size_t bytes, int prot)
{
Expand Down
Loading

0 comments on commit 18e170d

Please sign in to comment.