From 2f7702af64d6ae7ae8b7f6d5dca1bf8bdaf0ac1f Mon Sep 17 00:00:00 2001 From: Ido Yariv Date: Fri, 2 Nov 2012 12:24:00 -0700 Subject: ARM: OMAP2+: Move iopgtable header to drivers/iommu/ The iopgtable header file is only used by the iommu & iovmm drivers, so move it to drivers/iommu/, as part of the single zImage effort. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Omar Ramirez Luna Signed-off-by: Ido Yariv Acked-by: Ohad Ben-Cohen Acked-by: Joerg Roedel [tony@atomide.com: updated to be earlier in the series] Signed-off-by: Tony Lindgren --- drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iommu/omap-iommu.c') diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index d0b1234..f2bbfb0 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -26,7 +26,7 @@ #include -#include +#include "omap-iopgtable.h" #define for_each_iotlb_cr(obj, n, __i, cr) \ for (__i = 0; \ -- cgit v1.1 From c8d35c84f5494d8d294205b598f927a11fd41f34 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 2 Nov 2012 12:24:03 -0700 Subject: ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h Looks like the iommu framework does not have generic functions exported for all the needs yet. The hardware specific functions are defined in files like intel-iommu.h and amd-iommu.h. Follow the same standard for omap-iommu.h. This is needed because we are removing plat and mach includes for ARM common zImage support. Further work should continue in the iommu framework context as only pure platform data will be communicated from arch/arm/*omap*/* code to the iommu framework. Cc: Ido Yariv Cc: Laurent Pinchart Cc: Omar Ramirez Luna Cc: linux-media@vger.kernel.org Acked-by: Mauro Carvalho Chehab Acked-by: Ohad Ben-Cohen Acked-by: Joerg Roedel Signed-off-by: Tony Lindgren --- drivers/iommu/omap-iommu.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/iommu/omap-iommu.c') diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index f2bbfb0..eadcfde 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include -- cgit v1.1 From ed1c7de29f9f3d56b3ca5ef69682cc1a3d369e9d Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 2 Nov 2012 12:24:06 -0700 Subject: ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c This file should not be in arch/arm. Move it to drivers/iommu to allow making most of the header local to drivers/iommu. This is needed as we are removing plat and mach includes from drivers for ARM common zImage support. Cc: Ido Yariv Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Omar Ramirez Luna Cc: linux-media@vger.kernel.org Acked-by: Ohad Ben-Cohen Acked-by: Joerg Roedel Signed-off-by: Tony Lindgren --- drivers/iommu/omap-iommu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'drivers/iommu/omap-iommu.c') diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index eadcfde..4db86e1 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -22,12 +22,14 @@ #include #include #include +#include #include #include #include "omap-iopgtable.h" +#include "omap-iommu.h" #define for_each_iotlb_cr(obj, n, __i, cr) \ for (__i = 0; \ @@ -1016,6 +1018,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) { -- cgit v1.1 From 7bd9e25fa4e1eab0adb2632a0752e0835850dfb7 Mon Sep 17 00:00:00 2001 From: Ido Yariv Date: Fri, 2 Nov 2012 12:24:09 -0700 Subject: ARM: OMAP2+: Make some definitions local Move some of the definitions in omap-iommu.h that can be made local to either drivers/iommu. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Omar Ramirez Luna Signed-off-by: Ido Yariv Acked-by: Ohad Ben-Cohen Acked-by: Joerg Roedel [tony@atomide.com: updated for header changes in the series] Signed-off-by: Tony Lindgren --- drivers/iommu/omap-iommu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/iommu/omap-iommu.c') diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 4db86e1..df84087 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -54,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; -- cgit v1.1 From 2ab7c84815cffd5fe4946a472fc67fefa8ac3c29 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 2 Nov 2012 12:24:14 -0700 Subject: ARM: OMAP2+: Move iommu/iovmm headers to platform_data Move iommu/iovmm headers from plat/ to platform_data/ as part of the single zImage work. Partially based on an earlier version by Ido Yariv . Cc: Ido Yariv Cc: Laurent Pinchart Cc: Omar Ramirez Luna Acked-by: Mauro Carvalho Chehab Acked-by: Ohad Ben-Cohen Acked-by: Joerg Roedel Signed-off-by: Tony Lindgren --- drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iommu/omap-iommu.c') diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index df84087..badc17c 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -26,7 +26,7 @@ #include -#include +#include #include "omap-iopgtable.h" #include "omap-iommu.h" -- cgit v1.1