Merge tag 'iommu-updates-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Feb 2013 19:09:17 +0000 (11:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Feb 2013 19:09:17 +0000 (11:09 -0800)
Pull IOMMU Updates from Joerg Roedel:
 "Besides some fixes and cleanups in the code there are three more
  important changes to point out this time:

* New IOMMU driver for the ARM SHMOBILE platform
* An IOMMU-API extension for non-paging IOMMUs (required for
  upcoming PAMU driver)
* Rework of the way the Tegra IOMMU driver accesses its
  registetrs - register windows are easier to extend now.

  There are also a few changes to non-iommu code, but that is acked by
  the respective maintainers."

* tag 'iommu-updates-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (23 commits)
  iommu/tegra: assume CONFIG_OF in SMMU driver
  iommu/tegra: assume CONFIG_OF in gart driver
  iommu/amd: Remove redundant NULL check before dma_ops_domain_free().
  iommu/amd: Initialize device table after dma_ops
  iommu/vt-d: Zero out allocated memory in dmar_enable_qi
  iommu/tegra: smmu: Fix incorrect mask for regbase
  iommu/exynos: Make exynos_sysmmu_disable static
  ARM: mach-shmobile: r8a7740: Add IPMMU device
  ARM: mach-shmobile: sh73a0: Add IPMMU device
  ARM: mach-shmobile: sh7372: Add IPMMU device
  iommu/shmobile: Add iommu driver for Renesas IPMMU modules
  iommu: Add DOMAIN_ATTR_WINDOWS domain attribute
  iommu: Add domain window handling functions
  iommu: Implement DOMAIN_ATTR_PAGING attribute
  iommu: Check for valid pgsize_bitmap in iommu_map/unmap
  iommu: Make sure DOMAIN_ATTR_MAX is really the maximum
  iommu/tegra: smmu: Change SMMU's dependency on ARCH_TEGRA
  iommu/tegra: smmu: Use helper function to check for valid register offset
  iommu/tegra: smmu: Support variable MMIO ranges/blocks
  iommu/tegra: Add missing spinlock initialization
  ...

1  2 
arch/arm/mach-exynos/mach-exynos4-dt.c
arch/arm/mach-exynos/mach-exynos5-dt.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-shmobile/setup-sh7372.c
arch/arm/mach-shmobile/setup-sh73a0.c
drivers/iommu/Kconfig
drivers/iommu/amd_iommu.c
drivers/iommu/dmar.c
drivers/iommu/tegra-smmu.c

index 973a06637572842f5c8ff7fca86e590a78812e62,26710758c3857b3c41b809537c8ddaa4c6d60e00..acaeb14db54b933f0c658a0ded6fdb7608abe011
@@@ -103,12 -104,36 +103,42 @@@ static const struct of_dev_auxdata exyn
        OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
        OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
                                "exynos-tmu", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x03830000,
 +                              "samsung-i2s.0", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D60000,
 +                              "samsung-i2s.1", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D70000,
 +                              "samsung-i2s.2", NULL),
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11210000,
+                       "exynos-sysmmu.0", "mfc"), /* MFC_L */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11200000,
+                       "exynos-sysmmu.1", "mfc"), /* MFC_R */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x14650000,
+                       "exynos-sysmmu.2", NULL), /* TV */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11F20000,
+                       "exynos-sysmmu.3", "jpeg"), /* JPEG */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x11D40000,
+                       "exynos-sysmmu.4", NULL), /* ROTATOR */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E80000,
+                       "exynos-sysmmu.5", "gscl"), /* GSCL0 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13E90000,
+                       "exynos-sysmmu.6", "gscl"), /* GSCL1 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13EA0000,
+                       "exynos-sysmmu.7", "gscl"), /* GSCL2 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13EB0000,
+                       "exynos-sysmmu.8", "gscl"), /* GSCL3 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13260000,
+                       "exynos-sysmmu.9", NULL), /* FIMC-IS0 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x132C0000,
+                       "exynos-sysmmu.10", NULL), /* FIMC-IS1 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x14640000,
+                       "exynos-sysmmu.11", NULL), /* FIMD1 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13C40000,
+                       "exynos-sysmmu.12", NULL), /* FIMC-LITE0 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x13C50000,
+                       "exynos-sysmmu.13", NULL), /* FIMC-LITE1 */
+       OF_DEV_AUXDATA("samsung,exynos-sysmmu", 0x10A60000,
+                       "exynos-sysmmu.14", NULL), /* G2D */
        {},
  };
  
index 30ac79c7c68737ad340e595c862eb29629a84819,b85bea517d9b980aaf47c3e00b95e9d16a9c4af2..8b85d4d8fab6692861dbd7a642b7a803ef8afbd6
@@@ -27,6 -27,8 +27,7 @@@
  #include <linux/serial_sci.h>
  #include <linux/sh_dma.h>
  #include <linux/sh_timer.h>
 -#include <linux/dma-mapping.h>
+ #include <linux/platform_data/sh_ipmmu.h>
  #include <mach/dma-register.h>
  #include <mach/r8a7740.h>
  #include <mach/pm-rmobile.h>
@@@ -287,97 -263,37 +288,128 @@@ static struct platform_device cmt10_dev
        .num_resources  = ARRAY_SIZE(cmt10_resources),
  };
  
 +/* TMU */
 +static struct sh_timer_config tmu00_platform_data = {
 +      .name = "TMU00",
 +      .channel_offset = 0x4,
 +      .timer_bit = 0,
 +      .clockevent_rating = 200,
 +};
 +
 +static struct resource tmu00_resources[] = {
 +      [0] = {
 +              .name   = "TMU00",
 +              .start  = 0xfff80008,
 +              .end    = 0xfff80014 - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0xe80),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device tmu00_device = {
 +      .name           = "sh_tmu",
 +      .id             = 0,
 +      .dev = {
 +              .platform_data  = &tmu00_platform_data,
 +      },
 +      .resource       = tmu00_resources,
 +      .num_resources  = ARRAY_SIZE(tmu00_resources),
 +};
 +
 +static struct sh_timer_config tmu01_platform_data = {
 +      .name = "TMU01",
 +      .channel_offset = 0x10,
 +      .timer_bit = 1,
 +      .clocksource_rating = 200,
 +};
 +
 +static struct resource tmu01_resources[] = {
 +      [0] = {
 +              .name   = "TMU01",
 +              .start  = 0xfff80014,
 +              .end    = 0xfff80020 - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0xea0),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device tmu01_device = {
 +      .name           = "sh_tmu",
 +      .id             = 1,
 +      .dev = {
 +              .platform_data  = &tmu01_platform_data,
 +      },
 +      .resource       = tmu01_resources,
 +      .num_resources  = ARRAY_SIZE(tmu01_resources),
 +};
 +
 +static struct sh_timer_config tmu02_platform_data = {
 +      .name = "TMU02",
 +      .channel_offset = 0x1C,
 +      .timer_bit = 2,
 +      .clocksource_rating = 200,
 +};
 +
 +static struct resource tmu02_resources[] = {
 +      [0] = {
 +              .name   = "TMU02",
 +              .start  = 0xfff80020,
 +              .end    = 0xfff8002C - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0xec0),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device tmu02_device = {
 +      .name           = "sh_tmu",
 +      .id             = 2,
 +      .dev = {
 +              .platform_data  = &tmu02_platform_data,
 +      },
 +      .resource       = tmu02_resources,
 +      .num_resources  = ARRAY_SIZE(tmu02_resources),
 +};
 +
+ /* IPMMUI (an IPMMU module for ICB/LMB) */
+ static struct resource ipmmu_resources[] = {
+       [0] = {
+               .name   = "IPMMUI",
+               .start  = 0xfe951000,
+               .end    = 0xfe9510ff,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ static const char * const ipmmu_dev_names[] = {
+       "sh_mobile_lcdc_fb.0",
+       "sh_mobile_lcdc_fb.1",
+       "sh_mobile_ceu.0",
+ };
+ static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
+       .dev_names = ipmmu_dev_names,
+       .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
+ };
+ static struct platform_device ipmmu_device = {
+       .name           = "ipmmu",
+       .id             = -1,
+       .dev = {
+               .platform_data = &ipmmu_platform_data,
+       },
+       .resource       = ipmmu_resources,
+       .num_resources  = ARRAY_SIZE(ipmmu_resources),
+ };
  static struct platform_device *r8a7740_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif7_device,
        &scifb_device,
        &cmt10_device,
 +      &tmu00_device,
 +      &tmu01_device,
 +      &tmu02_device,
+       &ipmmu_device,
  };
  
  /* DMA */
Simple merge
index 2ecd6681692f0ad177923eac0a8cbbae0df88743,36c2b2ec2f332a772017379d892dbb65b0a5af6a..bdab575f88bcf0bc57fe267d8369a6603c9fcc26
@@@ -780,7 -755,36 +781,36 @@@ static struct platform_device pmu_devic
        .resource       = pmu_resources,
  };
  
 -static struct platform_device *sh73a0_early_devices[] __initdata = {
+ /* an IPMMU module for ICB */
+ static struct resource ipmmu_resources[] = {
+       [0] = {
+               .name   = "IPMMU",
+               .start  = 0xfe951000,
+               .end    = 0xfe9510ff,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ static const char * const ipmmu_dev_names[] = {
+       "sh_mobile_lcdc_fb.0",
+ };
+ static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
+       .dev_names = ipmmu_dev_names,
+       .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
+ };
+ static struct platform_device ipmmu_device = {
+       .name           = "ipmmu",
+       .id             = -1,
+       .dev = {
+               .platform_data = &ipmmu_platform_data,
+       },
+       .resource       = ipmmu_resources,
+       .num_resources  = ARRAY_SIZE(ipmmu_resources),
+ };
 +static struct platform_device *sh73a0_early_devices_dt[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif2_device,
        &scif7_device,
        &scif8_device,
        &cmt10_device,
 +};
 +
 +static struct platform_device *sh73a0_early_devices[] __initdata = {
        &tmu00_device,
        &tmu01_device,
+       &ipmmu_device,
  };
  
  static struct platform_device *sh73a0_late_devices[] __initdata = {
Simple merge
Simple merge
Simple merge
index f08dbcd2f17585875e863a7ec24c032d8ee40413,8b1d9f758076395f65fc4e1a5662b417594dda86..eb0109f98946d6ab2c6267e408a836e0bc9bc3ee
@@@ -1177,10 -1185,13 +1186,13 @@@ static int tegra_smmu_probe(struct plat
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
                if (!res)
                        return -ENODEV;
 -              smmu->regs[i] = devm_request_and_ioremap(&pdev->dev, res);
 -              if (!smmu->regs[i])
 -                      return -EBUSY;
 +              smmu->regs[i] = devm_ioremap_resource(&pdev->dev, res);
 +              if (IS_ERR(smmu->regs[i]))
 +                      return PTR_ERR(smmu->regs[i]);
+               smmu->rege[i] = smmu->regs[i] + resource_size(res) - 1;
        }
+       /* Same as "mc" 1st regiter block start address */
+       smmu->regbase = (void __iomem *)((u32)smmu->regs[0] & PAGE_MASK);
  
        err = of_get_dma_window(dev->of_node, NULL, 0, NULL, &base, &size);
        if (err)