Skip to content

Commit

Permalink
Merge tag 'omap-for-v3.8/cleanup-headers-iommu-signed' of git://git.k…
Browse files Browse the repository at this point in the history
…ernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/headers

From Tony Lindgren:
Move most of remaining omap iommu code to drivers/iommu.
This is needed for the multiplatform kernels as the plat
and mach headers cannot be included.

These changes were agreed to be merged via the arm-soc
tree by Joerg and Ohad as these will cause some merge
conflicts with the other related clean-up branches.

So omap-for-v3.8/cleanup-headers-iommu should be added
as one of the depends branches for arm-soc.

* tag 'omap-for-v3.8/cleanup-headers-iommu-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Move iommu/iovmm headers to platform_data
  ARM: OMAP2+: Make some definitions local
  ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c
  ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h
  ARM: OMAP2+: Move iopgtable header to drivers/iommu/
  ARM: OMAP: Merge iommu2.h into iommu.h

Conflicts due to surrounding changes in:
	arch/arm/mach-omap2/omap_hwmod_44xx_data.c
	drivers/media/platform/omap3isp/ispvideo.c

Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
olofj committed Dec 1, 2012
2 parents fbac7d7 + 2ab7c84 commit 8556650
Show file tree
Hide file tree
Showing 21 changed files with 280 additions and 289 deletions.
2 changes: 0 additions & 2 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,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 @@ -128,7 +128,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 @@ -24,8 +24,8 @@
#include "l4_3xxx.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 @@ -27,8 +27,8 @@

#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/dmtimer.h>
#include <plat/iommu.h>

#include "omap_hwmod.h"
#include "omap_hwmod_common_data.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 8556650

Please sign in to comment.