Loading arch/arm/mach-omap2/Makefile +1 −4 Original line number Diff line number Diff line Loading @@ -89,10 +89,7 @@ obj-$(CONFIG_OMAP3_EMU) += emu.o obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o mailbox_mach-objs := mailbox.o iommu-y += iommu2.o iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y) obj-$(CONFIG_OMAP_IOMMU) := iommu2.o omap-iommu.o i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o obj-y += $(i2c-omap-m) $(i2c-omap-y) Loading arch/arm/mach-omap2/iommu2.c +4 −2 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) printk("\n"); iommu_write_reg(obj, stat, MMU_IRQSTATUS); omap2_iommu_disable(obj); return stat; } Loading Loading @@ -184,7 +185,7 @@ static struct cr_regs *omap2_alloc_cr(struct iommu *obj, struct iotlb_entry *e) if (!cr) return ERR_PTR(-ENOMEM); cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz; cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz | e->valid; cr->ram = e->pa | e->endian | e->elsz | e->mixed; return cr; Loading Loading @@ -212,7 +213,8 @@ static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf) char *p = buf; /* FIXME: Need more detail analysis of cam/ram */ p += sprintf(p, "%08x %08x\n", cr->cam, cr->ram); p += sprintf(p, "%08x %08x %01x\n", cr->cam, cr->ram, (cr->cam & MMU_CAM_P) ? 1 : 0); return p - buf; } Loading arch/arm/mach-omap2/omap3-iommu.c→arch/arm/mach-omap2/omap-iommu.c +157 −0 Original line number Diff line number Diff line /* * omap iommu: omap3 device registration * omap iommu: omap device registration * * Copyright (C) 2008-2009 Nokia Corporation * Loading @@ -13,6 +13,7 @@ #include <linux/platform_device.h> #include <plat/iommu.h> #include <plat/irqs.h> struct iommu_device { resource_size_t base; Loading @@ -20,8 +21,11 @@ struct iommu_device { struct iommu_platform_data pdata; struct resource res[2]; }; static struct iommu_device *devices; static int num_iommu_devices; static struct iommu_device devices[] = { #ifdef CONFIG_ARCH_OMAP3 static struct iommu_device omap3_devices[] = { { .base = 0x480bd400, .irq = 24, Loading @@ -43,11 +47,48 @@ static struct iommu_device devices[] = { }, #endif }; #define NR_IOMMU_DEVICES ARRAY_SIZE(devices) #define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices) static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES]; #else #define omap3_devices NULL #define NR_OMAP3_IOMMU_DEVICES 0 #define omap3_iommu_pdev NULL #endif #ifdef CONFIG_ARCH_OMAP4 static struct iommu_device omap4_devices[] = { { .base = OMAP4_MMU1_BASE, .irq = INT_44XX_DUCATI_MMU_IRQ, .pdata = { .name = "ducati", .nr_tlb_entries = 32, .clk_name = "ducati_ick", }, }, #if defined(CONFIG_MPU_TESLA_IOMMU) { .base = OMAP4_MMU2_BASE, .irq = INT_44XX_DSP_MMU, .pdata = { .name = "tesla", .nr_tlb_entries = 32, .clk_name = "tesla_ick", }, }, #endif }; #define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices) static struct platform_device *omap4_iommu_pdev[NR_OMAP4_IOMMU_DEVICES]; #else #define omap4_devices NULL #define NR_OMAP4_IOMMU_DEVICES 0 #define omap4_iommu_pdev NULL #endif static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES]; static struct platform_device **omap_iommu_pdev; static int __init omap3_iommu_init(void) static int __init omap_iommu_init(void) { int i, err; struct resource res[] = { Loading @@ -55,7 +96,18 @@ static int __init omap3_iommu_init(void) { .flags = IORESOURCE_IRQ }, }; for (i = 0; i < NR_IOMMU_DEVICES; i++) { if (cpu_is_omap34xx()) { devices = omap3_devices; omap_iommu_pdev = omap3_iommu_pdev; num_iommu_devices = NR_OMAP3_IOMMU_DEVICES; } else if (cpu_is_omap44xx()) { devices = omap4_devices; omap_iommu_pdev = omap4_iommu_pdev; num_iommu_devices = NR_OMAP4_IOMMU_DEVICES; } else return -ENODEV; for (i = 0; i < num_iommu_devices; i++) { struct platform_device *pdev; const struct iommu_device *d = &devices[i]; Loading @@ -80,26 +132,26 @@ static int __init omap3_iommu_init(void) err = platform_device_add(pdev); if (err) goto err_out; omap3_iommu_pdev[i] = pdev; omap_iommu_pdev[i] = pdev; } return 0; err_out: while (i--) platform_device_put(omap3_iommu_pdev[i]); platform_device_put(omap_iommu_pdev[i]); return err; } module_init(omap3_iommu_init); module_init(omap_iommu_init); static void __exit omap3_iommu_exit(void) static void __exit omap_iommu_exit(void) { int i; for (i = 0; i < NR_IOMMU_DEVICES; i++) platform_device_unregister(omap3_iommu_pdev[i]); for (i = 0; i < num_iommu_devices; i++) platform_device_unregister(omap_iommu_pdev[i]); } module_exit(omap3_iommu_exit); module_exit(omap_iommu_exit); MODULE_AUTHOR("Hiroshi DOYU"); MODULE_DESCRIPTION("omap iommu: omap3 device registration"); MODULE_DESCRIPTION("omap iommu: omap device registration"); MODULE_LICENSE("GPL v2"); arch/arm/plat-omap/Kconfig +7 −2 Original line number Diff line number Diff line Loading @@ -110,8 +110,13 @@ config OMAP_IOMMU tristate config OMAP_IOMMU_DEBUG depends on OMAP_IOMMU tristate tristate "Export OMAP IOMMU internals in DebugFS" depends on OMAP_IOMMU && DEBUG_FS help Select this to see extensive information about the internal state of OMAP IOMMU in debugfs. Say N unless you know you need this. choice prompt "System timer" Loading arch/arm/plat-omap/include/plat/omap44xx.h +3 −0 Original line number Diff line number Diff line Loading @@ -48,5 +48,8 @@ #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) #define OMAP44XX_HSUSB_OTG_BASE (L4_44XX_BASE + 0xAB000) #define OMAP4_MMU1_BASE 0x55082000 #define OMAP4_MMU2_BASE 0x4A066000 #endif /* __ASM_ARCH_OMAP44XX_H */ Loading
arch/arm/mach-omap2/Makefile +1 −4 Original line number Diff line number Diff line Loading @@ -89,10 +89,7 @@ obj-$(CONFIG_OMAP3_EMU) += emu.o obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o mailbox_mach-objs := mailbox.o iommu-y += iommu2.o iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y) obj-$(CONFIG_OMAP_IOMMU) := iommu2.o omap-iommu.o i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o obj-y += $(i2c-omap-m) $(i2c-omap-y) Loading
arch/arm/mach-omap2/iommu2.c +4 −2 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) printk("\n"); iommu_write_reg(obj, stat, MMU_IRQSTATUS); omap2_iommu_disable(obj); return stat; } Loading Loading @@ -184,7 +185,7 @@ static struct cr_regs *omap2_alloc_cr(struct iommu *obj, struct iotlb_entry *e) if (!cr) return ERR_PTR(-ENOMEM); cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz; cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz | e->valid; cr->ram = e->pa | e->endian | e->elsz | e->mixed; return cr; Loading Loading @@ -212,7 +213,8 @@ static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf) char *p = buf; /* FIXME: Need more detail analysis of cam/ram */ p += sprintf(p, "%08x %08x\n", cr->cam, cr->ram); p += sprintf(p, "%08x %08x %01x\n", cr->cam, cr->ram, (cr->cam & MMU_CAM_P) ? 1 : 0); return p - buf; } Loading
arch/arm/mach-omap2/omap3-iommu.c→arch/arm/mach-omap2/omap-iommu.c +157 −0 Original line number Diff line number Diff line /* * omap iommu: omap3 device registration * omap iommu: omap device registration * * Copyright (C) 2008-2009 Nokia Corporation * Loading @@ -13,6 +13,7 @@ #include <linux/platform_device.h> #include <plat/iommu.h> #include <plat/irqs.h> struct iommu_device { resource_size_t base; Loading @@ -20,8 +21,11 @@ struct iommu_device { struct iommu_platform_data pdata; struct resource res[2]; }; static struct iommu_device *devices; static int num_iommu_devices; static struct iommu_device devices[] = { #ifdef CONFIG_ARCH_OMAP3 static struct iommu_device omap3_devices[] = { { .base = 0x480bd400, .irq = 24, Loading @@ -43,11 +47,48 @@ static struct iommu_device devices[] = { }, #endif }; #define NR_IOMMU_DEVICES ARRAY_SIZE(devices) #define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices) static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES]; #else #define omap3_devices NULL #define NR_OMAP3_IOMMU_DEVICES 0 #define omap3_iommu_pdev NULL #endif #ifdef CONFIG_ARCH_OMAP4 static struct iommu_device omap4_devices[] = { { .base = OMAP4_MMU1_BASE, .irq = INT_44XX_DUCATI_MMU_IRQ, .pdata = { .name = "ducati", .nr_tlb_entries = 32, .clk_name = "ducati_ick", }, }, #if defined(CONFIG_MPU_TESLA_IOMMU) { .base = OMAP4_MMU2_BASE, .irq = INT_44XX_DSP_MMU, .pdata = { .name = "tesla", .nr_tlb_entries = 32, .clk_name = "tesla_ick", }, }, #endif }; #define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices) static struct platform_device *omap4_iommu_pdev[NR_OMAP4_IOMMU_DEVICES]; #else #define omap4_devices NULL #define NR_OMAP4_IOMMU_DEVICES 0 #define omap4_iommu_pdev NULL #endif static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES]; static struct platform_device **omap_iommu_pdev; static int __init omap3_iommu_init(void) static int __init omap_iommu_init(void) { int i, err; struct resource res[] = { Loading @@ -55,7 +96,18 @@ static int __init omap3_iommu_init(void) { .flags = IORESOURCE_IRQ }, }; for (i = 0; i < NR_IOMMU_DEVICES; i++) { if (cpu_is_omap34xx()) { devices = omap3_devices; omap_iommu_pdev = omap3_iommu_pdev; num_iommu_devices = NR_OMAP3_IOMMU_DEVICES; } else if (cpu_is_omap44xx()) { devices = omap4_devices; omap_iommu_pdev = omap4_iommu_pdev; num_iommu_devices = NR_OMAP4_IOMMU_DEVICES; } else return -ENODEV; for (i = 0; i < num_iommu_devices; i++) { struct platform_device *pdev; const struct iommu_device *d = &devices[i]; Loading @@ -80,26 +132,26 @@ static int __init omap3_iommu_init(void) err = platform_device_add(pdev); if (err) goto err_out; omap3_iommu_pdev[i] = pdev; omap_iommu_pdev[i] = pdev; } return 0; err_out: while (i--) platform_device_put(omap3_iommu_pdev[i]); platform_device_put(omap_iommu_pdev[i]); return err; } module_init(omap3_iommu_init); module_init(omap_iommu_init); static void __exit omap3_iommu_exit(void) static void __exit omap_iommu_exit(void) { int i; for (i = 0; i < NR_IOMMU_DEVICES; i++) platform_device_unregister(omap3_iommu_pdev[i]); for (i = 0; i < num_iommu_devices; i++) platform_device_unregister(omap_iommu_pdev[i]); } module_exit(omap3_iommu_exit); module_exit(omap_iommu_exit); MODULE_AUTHOR("Hiroshi DOYU"); MODULE_DESCRIPTION("omap iommu: omap3 device registration"); MODULE_DESCRIPTION("omap iommu: omap device registration"); MODULE_LICENSE("GPL v2");
arch/arm/plat-omap/Kconfig +7 −2 Original line number Diff line number Diff line Loading @@ -110,8 +110,13 @@ config OMAP_IOMMU tristate config OMAP_IOMMU_DEBUG depends on OMAP_IOMMU tristate tristate "Export OMAP IOMMU internals in DebugFS" depends on OMAP_IOMMU && DEBUG_FS help Select this to see extensive information about the internal state of OMAP IOMMU in debugfs. Say N unless you know you need this. choice prompt "System timer" Loading
arch/arm/plat-omap/include/plat/omap44xx.h +3 −0 Original line number Diff line number Diff line Loading @@ -48,5 +48,8 @@ #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) #define OMAP44XX_HSUSB_OTG_BASE (L4_44XX_BASE + 0xAB000) #define OMAP4_MMU1_BASE 0x55082000 #define OMAP4_MMU2_BASE 0x4A066000 #endif /* __ASM_ARCH_OMAP44XX_H */