]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
platform: tegra: iommu: Cleanup unused code
authorSri Krishna chowdary <schowdary@nvidia.com>
Thu, 4 Sep 2014 13:39:43 +0000 (19:09 +0530)
committerSri Krishna Chowdary <schowdary@nvidia.com>
Mon, 22 Sep 2014 05:37:55 +0000 (22:37 -0700)
tegra-smmu now gets address space properties from domains=
property in SMMU device tree node. So, devices which have DT
nodes and which do not, are initialized from map properties got
from DT.

So, __tegra_smmu_map_init_dev() is not used anymore. Clean it up.

Bug 200031968

Change-Id: I3f5f06f948a3adf0e0a96246043ce3c19396008e
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/494309
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
arch/arm/mach-tegra/include/mach/tegra_smmu.h
drivers/platform/tegra/iommu.c
include/linux/tegra_smmu.h

index 35332c4ee0fd9e2d15d61cf90b68d96ea4443182..7c27bcbff549eb4b4c2c4633c20b6c3b661c3e75 100644 (file)
@@ -35,19 +35,11 @@ extern struct notifier_block tegra_smmu_device_nb;
 
 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
 
-extern struct dma_iommu_mapping *tegra_smmu_get_map(struct device *dev,
-                                                   u64 swgids);
 void tegra_smmu_unmap_misc_device(struct device *dev);
 void tegra_smmu_map_misc_device(struct device *dev);
 int tegra_smmu_get_asid(struct device *dev);
 #else
 
-static inline struct dma_iommu_mapping *tegra_smmu_get_map(struct device *dev,
-                                                          u64 swgids)
-{
-       return NULL;
-}
-
 static inline void tegra_smmu_unmap_misc_device(struct device *dev)
 {
 }
index bc0d679cdda9b6fbc47cf94394a5f2272bad4d0b..9cdf2ac95774c282e3a0e9211e9e949c5c543fd3 100644 (file)
 #include "../../../arch/arm/mach-tegra/board.h"
 #include "../../../arch/arm/mach-tegra/common.h"
 
-struct tegra_iommu_mapping {
-       dma_addr_t base;
-       size_t size;
-       int asid;
-       struct dma_iommu_mapping *map;
-};
-
-static struct dma_iommu_mapping *__tegra_smmu_map_init_dev(struct device *dev,
-                                          struct tegra_iommu_mapping *info);
-
 static struct iommu_linear_map tegra_fb_linear_map[16]; /* Terminated with 0 */
 
 #ifdef CONFIG_TEGRA_BPMP
@@ -314,79 +304,6 @@ u64 tegra_smmu_fixup_swgids(struct device *dev, struct iommu_linear_map **map)
 }
 EXPORT_SYMBOL(tegra_smmu_fixup_swgids);
 
-#ifdef CONFIG_PLATFORM_ENABLE_IOMMU
-
-#define IOVA_SZ(strt) ((u32)~0 - strt)
-
-#define DC_START  0x00010000
-#define GPU_START 0x00100000
-
-static struct tegra_iommu_mapping smmu_default_map[] = {
-       [SYSTEM_DEFAULT] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [SYSTEM_PROTECTED] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [PPCS1_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [SYSTEM_DC] = {DC_START, IOVA_SZ(DC_START)},
-       [SYSTEM_DCB] = {DC_START, IOVA_SZ(DC_START)},
-       /* Non-zero base to account for gk20a driver's assumptions */
-       [SYSTEM_GK20A] = {GPU_START, IOVA_SZ(GPU_START)},
-       [SDMMC1A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [SDMMC2A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [SDMMC3A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-       [SDMMC4A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-#if defined(CONFIG_ARCH_TEGRA_APE)
-       [SYSTEM_ADSP] = {TEGRA_APE_DRAM_MAP2_BASE, TEGRA_APE_DRAM_MAP2_SIZE},
-#endif
-       [AFI_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
-};
-
-/* XXX: Remove this function once all client devices moved to DT */
-static struct dma_iommu_mapping *__tegra_smmu_map_init_dev(struct device *dev,
-                                          struct tegra_iommu_mapping *info)
-{
-       struct dma_iommu_mapping *map;
-
-       map = arm_iommu_create_mapping(&platform_bus_type,
-                                      info->base, info->size, 0);
-       if (IS_ERR(map)) {
-               dev_err(dev, "%s: Failed create IOVA map for ASID[%d]\n",
-                       __func__, info->asid);
-               return NULL;
-       }
-
-       BUG_ON(cmpxchg(&info->map, NULL, map));
-       dev_info(dev, "Created a new map %p(asid=%d)\n", map, info->asid);
-       return map;
-}
-
-struct dma_iommu_mapping *tegra_smmu_map_init_dev(struct device *dev,
-                                                 u64 swgids)
-{
-       int asid;
-       struct tegra_iommu_mapping *info;
-
-       BUG_ON(_tegra_smmu_get_asid(swgids) >= ARRAY_SIZE(smmu_default_map));
-
-       asid = _tegra_smmu_get_asid(swgids);
-       info = &smmu_default_map[asid];
-       info->asid = asid;
-       if (!info->size)
-               return NULL;
-
-       if (info->map) {
-               dev_info(dev, "Use an existing map %p(asid=%d)\n",
-                        info->map, info->asid);
-               return info->map;
-       }
-
-       return __tegra_smmu_map_init_dev(dev, info);
-}
-
-#else
-static inline void tegra_smmu_map_init(struct platform_device *pdev)
-{
-}
-#endif
-
 static int __init tegra_smmu_init(void)
 {
        tegra_bpmp_linear_set();
index 3be54a7bb7cb8b98e345da4795bd2ed4b02274be..8456afd50347fc68372c1a99353ff649dd125531 100644 (file)
@@ -31,32 +31,8 @@ struct iommu_linear_map {
 };
 
 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
-/*
- * ASID[0] for the system default
- * ASID[1] for PPCS, which has SDMMC
- * ASID[2] for PPCS1
- * ASID[3][4] open for drivers, first come, first served.
- */
-enum {
-       SYSTEM_DEFAULT,
-       SYSTEM_PROTECTED,
-       PPCS1_ASID,
-       SYSTEM_DC,
-       SYSTEM_DCB,
-       SYSTEM_GK20A,
-       SDMMC1A_ASID,
-       SDMMC2A_ASID,
-       SDMMC3A_ASID,
-       SDMMC4A_ASID,
-       SYSTEM_ADSP,
-       AFI_ASID,
-       NUM_ASIDS,
-};
-
 /* Maximum number of iommu address spaces in the system */
 #define TEGRA_IOMMU_NUM_ASIDS NUM_ASIDS
-extern struct dma_iommu_mapping *tegra_smmu_map_init_dev(struct device *dev,
-                                                 u64 swgids);
 void tegra_smmu_unmap_misc_device(struct device *dev);
 void tegra_smmu_map_misc_device(struct device *dev);
 int tegra_smmu_get_asid(struct device *dev);