Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339949
b: refs/heads/master
c: 794b175
h: refs/heads/master
i:
  339947: aef31d8
v: v3
  • Loading branch information
Olof Johansson committed Dec 1, 2012
1 parent 365342d commit 904a24d
Show file tree
Hide file tree
Showing 22 changed files with 281 additions and 290 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fabb6332a2b747c7f6783f146a8fb3d2f88d91c
refs/heads/master: 794b175fc0c0c4844dbb7b137a73bbfd01f6c608
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,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 trunk/arch/arm/mach-omap2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,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 trunk/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 trunk/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 trunk/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <linux/platform_data/omap_ocp2scp.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/dmtimer.h>
#include <plat/iommu.h>

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

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions trunk/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 trunk/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 trunk/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 904a24d

Please sign in to comment.