All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Initial support for omap iommu driver
@ 2009-05-05 12:46 Hiroshi DOYU
  2009-05-05 12:46 ` [PATCH 1/6] omap iommu: tlb and pagetable primitives Hiroshi DOYU
                   ` (5 more replies)
  0 siblings, 6 replies; 53+ messages in thread
From: Hiroshi DOYU @ 2009-05-05 12:46 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-omap, h-kanigeri2, omar.ramirez, sakari.ailus, tony

Some of TI OMAP series have the peripheral devices with their own
Memory Management Unit(IOMMU), which is composed of its own TLB and
optional H/W pagetable (TWL). These MMUs doesn't depend on MPU(ARM)
MMU at all, but their algorithms are quite similar and they share the
same physical address space. This patch provides with common in-kernel
iommu APIs such OMAP peripheral devices(Camera ISP, IVA1, IVA2, DSP
and the equivalent ones in the latest OMAP successors) to handle
peripheral device IOMMUs in the same manner.

"tlb and pagetable primitives" has been updated with Russell's
comments on:

      http://marc.info/?l=linux-omap&m=122087083712670&w=2

Generalizing this omap iommu code independently from each device
drivers, "Camera(ISP)", "TI bridge(IVA/DSP)", "dspgateway(DSP)" and
the future OMAP equivalent device would be more robust and reduce the
maintenance cost since keeping this critical code at one place can
avoid some risks, like wrong MMU settings, which may cause critical
damages on the system.

---
The following changes since commit 091438dd5668396328a3419abcbc6591159eb8d1:
  Linus Torvalds (1):
        Linux 2.6.30-rc4

are available in the git repository at:

  http://git.gitorious.org/lk/mainline.git iommu

Hiroshi DOYU (6):
      omap iommu: tlb and pagetable primitives
      omap iommu: omap2 architecture specific functions
      omap iommu: omap3 iommu device registration
      omap iommu: simple virtual address space management
      omap iommu: entries for Kconfig and Makefile
      omap2 iommu: entries for Kconfig and Makefile

 arch/arm/include/asm/io.h                |    6 +
 arch/arm/mach-omap2/Makefile             |    5 +
 arch/arm/mach-omap2/iommu2.c             |  323 ++++++++++
 arch/arm/mach-omap2/omap3-iommu.c        |  105 ++++
 arch/arm/mm/ioremap.c                    |   11 +
 arch/arm/plat-omap/Kconfig               |    8 +
 arch/arm/plat-omap/Makefile              |    1 +
 arch/arm/plat-omap/include/mach/iommu.h  |  168 +++++
 arch/arm/plat-omap/include/mach/iommu2.h |   96 +++
 arch/arm/plat-omap/include/mach/iovmm.h  |   94 +++
 arch/arm/plat-omap/iommu.c               |  996 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/iopgtable.h           |   72 +++
 arch/arm/plat-omap/iovmm.c               |  890 ++++++++++++++++++++++++++
 13 files changed, 2775 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/iommu2.c
 create mode 100644 arch/arm/mach-omap2/omap3-iommu.c
 create mode 100644 arch/arm/plat-omap/include/mach/iommu.h
 create mode 100644 arch/arm/plat-omap/include/mach/iommu2.h
 create mode 100644 arch/arm/plat-omap/include/mach/iovmm.h
 create mode 100644 arch/arm/plat-omap/iommu.c
 create mode 100644 arch/arm/plat-omap/iopgtable.h
 create mode 100644 arch/arm/plat-omap/iovmm.c

^ permalink raw reply	[flat|nested] 53+ messages in thread
* [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration
@ 2009-05-16 10:05 Felipe Contreras
  2009-05-16 10:05 ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Contreras
  0 siblings, 1 reply; 53+ messages in thread
From: Felipe Contreras @ 2009-05-16 10:05 UTC (permalink / raw)
  To: linux-omap
  Cc: Hiroshi DOYU, Hari Kanigeri, linux-arm-kernel, Felipe Contreras

This patch series cleanups up a bit the opap3-iommu device registration and
then allows registration from other parts of the code.

Currently the iva2 code (tidspbridge) is not using iommu, therefore it can't be
used as-is with the current omap iommu. By allowing devies to be registered
externaly (either isp, or iva2) this problem goes away.

Felipe Contreras (3):
  omap3-iommu: reorganize
  omap3-iommu: split init function into omap_iommu_add
  omap3-iommu: remote registration

 arch/arm/mach-omap2/omap3-iommu.c       |  130 ++++++++++++++-----------------
 arch/arm/plat-omap/include/mach/iommu.h |    2 +
 2 files changed, 62 insertions(+), 70 deletions(-)


^ permalink raw reply	[flat|nested] 53+ messages in thread
* [RFC/PATCH 1/3] omap3-iommu: reorganize
@ 2009-05-16 10:41 Felipe Contreras
  0 siblings, 0 replies; 53+ messages in thread
From: Felipe Contreras @ 2009-05-16 10:41 UTC (permalink / raw)
  To: linux-omap
  Cc: Hiroshi DOYU, Hari Kanigeri, linux-arm-kernel, Felipe Contreras

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 arch/arm/mach-omap2/omap3-iommu.c |   72 ++++++++++++++++++------------------
 1 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c
index 367f36a..f4232ec 100644
--- a/arch/arm/mach-omap2/omap3-iommu.c
+++ b/arch/arm/mach-omap2/omap3-iommu.c
@@ -14,43 +14,31 @@
 
 #include <mach/iommu.h>
 
-#define OMAP3_MMU1_BASE	0x480bd400
-#define OMAP3_MMU2_BASE	0x5d000000
-#define OMAP3_MMU1_IRQ	24
-#define OMAP3_MMU2_IRQ	28
-
-static struct resource omap3_iommu_res[] = {
-	{ /* Camera ISP MMU */
-		.start		= OMAP3_MMU1_BASE,
-		.end		= OMAP3_MMU1_BASE + MMU_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= OMAP3_MMU1_IRQ,
-		.flags		= IORESOURCE_IRQ,
-	},
-	{ /* IVA2.2 MMU */
-		.start		= OMAP3_MMU2_BASE,
-		.end		= OMAP3_MMU2_BASE + MMU_REG_SIZE - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-	{
-		.start		= OMAP3_MMU2_IRQ,
-		.flags		= IORESOURCE_IRQ,
-	},
+struct iommu_device {
+	resource_size_t base;
+	resource_size_t irq;
+	struct iommu_platform_data pdata;
+	struct resource res[2];
 };
-#define NR_IOMMU_RES (ARRAY_SIZE(omap3_iommu_res) / 2)
 
-static const struct iommu_platform_data omap3_iommu_pdata[] __initconst = {
+static struct iommu_device devices[] = {
 	{
-		.name = "isp",
-		.nr_tlb_entries = 8,
-		.clk_name = "cam_ick",
+		.base = 0x480bd400,
+		.irq = 24,
+		.pdata = {
+			.name = "isp",
+			.nr_tlb_entries = 8,
+			.clk_name = "cam_ick",
+		},
 	},
 	{
-		.name = "iva2",
-		.nr_tlb_entries = 32,
-		.clk_name = "iva2_ck",
+		.base = 0x5d000000,
+		.irq = 28,
+		.pdata = {
+			.name = "iva2",
+			.nr_tlb_entries = 32,
+			.clk_name = "iva2_ck",
+		},
 	},
 };
 #define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata)
@@ -63,23 +51,35 @@ static int __init omap3_iommu_init(void)
 
 	for (i = 0; i < NR_IOMMU_DEVICES; i++) {
 		struct platform_device *pdev;
+		const struct iommu_device *d = &devices[i];
+		struct resource res[] = {
+			{ .flags = IORESOURCE_MEM },
+			{ .flags = IORESOURCE_IRQ },
+		};
 
 		pdev = platform_device_alloc("omap-iommu", i + 1);
 		if (!pdev) {
 			err = -ENOMEM;
 			goto err_out;
 		}
-		err = platform_device_add_resources(pdev,
-				    &omap3_iommu_res[2 * i], NR_IOMMU_RES);
+
+		res[0].start = d->base;
+		res[0].end = d->base + MMU_REG_SIZE - 1;
+
+		res[1].start = d->irq;
+
+		err = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
 		if (err)
 			goto err_out;
-		err = platform_device_add_data(pdev, &omap3_iommu_pdata[i],
-					       sizeof(omap3_iommu_pdata[0]));
+
+		err = platform_device_add_data(pdev, &d->pdata, sizeof(d->pdata));
 		if (err)
 			goto err_out;
+
 		err = platform_device_add(pdev);
 		if (err)
 			goto err_out;
+
 		omap3_iommu_pdev[i] = pdev;
 	}
 	return 0;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2009-05-19  9:43 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05 12:46 [PATCH 0/6] Initial support for omap iommu driver Hiroshi DOYU
2009-05-05 12:46 ` [PATCH 1/6] omap iommu: tlb and pagetable primitives Hiroshi DOYU
2009-05-05 20:19   ` Kanigeri, Hari
2009-05-06  5:56     ` Hiroshi DOYU
2009-05-05 12:46 ` [PATCH 2/6] omap iommu: omap2 architecture specific functions Hiroshi DOYU
2009-05-06 14:31   ` Kanigeri, Hari
2009-05-07  5:12     ` Hiroshi DOYU
2009-05-07 14:40       ` Kanigeri, Hari
2009-05-05 12:47 ` [PATCH 3/6] omap iommu: omap3 iommu device registration Hiroshi DOYU
2009-05-05 19:32   ` Felipe Contreras
2009-05-06  6:00     ` Hiroshi DOYU
2009-05-07 20:02       ` Felipe Contreras
2009-05-07 20:11         ` [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration Felipe Contreras
2009-05-07 20:11           ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Contreras
2009-05-07 20:11             ` [RFC/PATCH 2/3] omap3-iommu: split init function into omap_iommu_add Felipe Contreras
2009-05-07 20:11               ` [RFC/PATCH 3/3] omap3-iommu: remote registration Felipe Contreras
2009-05-07 21:14             ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Balbi
2009-05-07 22:16               ` Felipe Contreras
2009-05-08  4:15               ` Hiroshi DOYU
2009-05-07 20:28           ` [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration Kanigeri, Hari
2009-05-07 20:39             ` Felipe Contreras
2009-05-07 20:54               ` Kanigeri, Hari
2009-05-08  4:14           ` Hiroshi DOYU
2009-05-08  8:04             ` Felipe Contreras
2009-05-07 20:05   ` [PATCH 3/6] omap iommu: omap3 iommu device registration Felipe Contreras
2009-05-08  4:10     ` Hiroshi DOYU
2009-05-08  7:32       ` Felipe Contreras
2009-05-08 17:21         ` Aguirre Rodriguez, Sergio Alberto
2009-05-08 22:27           ` Felipe Contreras
2009-05-16  9:20   ` Russell King - ARM Linux
2009-05-16  9:38     ` Felipe Contreras
2009-05-16  9:54       ` Russell King - ARM Linux
2009-05-16  9:56         ` Felipe Contreras
2009-05-16  9:55     ` Russell King - ARM Linux
2009-05-18  5:36       ` Hiroshi DOYU
2009-05-18  9:39       ` Hiroshi DOYU
2009-05-18 14:26       ` Hiroshi DOYU
2009-05-18 16:43         ` [PATCH] omap3-iommu: reorganize Felipe Contreras
2009-05-19  6:03           ` Hiroshi DOYU
2009-05-19  9:43             ` Felipe Contreras
2009-05-18  5:22     ` [PATCH 3/6] omap iommu: omap3 iommu device registration Hiroshi DOYU
2009-05-05 12:47 ` [PATCH 4/6] omap iommu: simple virtual address space management Hiroshi DOYU
2009-05-16  9:22   ` Russell King - ARM Linux
2009-05-18  6:31     ` Hiroshi DOYU
2009-05-18 13:10       ` Russell King - ARM Linux
2009-05-05 12:47 ` [PATCH 5/6] omap iommu: entries for Kconfig and Makefile Hiroshi DOYU
2009-05-18 13:36   ` Russell King - ARM Linux
2009-05-05 12:47 ` [PATCH 6/6] omap2 " Hiroshi DOYU
2009-05-16 10:05 [RFC/PATCH 0/3] omap3-iommu: cleanups and remote registration Felipe Contreras
2009-05-16 10:05 ` [RFC/PATCH 1/3] omap3-iommu: reorganize Felipe Contreras
2009-05-18 12:07   ` Russell King - ARM Linux
2009-05-18 12:59     ` Felipe Contreras
2009-05-18 13:03       ` Russell King - ARM Linux
2009-05-16 10:41 Felipe Contreras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.