summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorHiroshi Doyu <hdoyu@nvidia.com>2013-03-04 21:38:21 +0200
committerHarshada Kale <hkale@nvidia.com>2013-06-10 03:46:16 -0700
commit65a83830e7530148e172e68268cc8b26b894c649 (patch)
tree2d5f866ffd789ce92dbedde3dc749ffc4e2274a5 /drivers/iommu
parent60a4be75a2e7bb399abc41f8c8495a8ea9d8daa5 (diff)
ARM: tegra: Create IOVA maps for ASID[0/1]
Create IOVA maps: * ASID[0] for the system default * ASID[1] for PPCS, which has SDMMC * ASID[3][4][....], not created, open for drivers, first come, first served. bug 1286500 Change-Id: I475455ee9cec3b382d96fe2e7af5a59ae4361cbf (cherry picked from commit 4516ece11d26150267fea46800f71a087e16cdbc) Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/234114 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index f36287755cc9..a497a0eab48e 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1438,9 +1438,6 @@ static int tegra_smmu_device_notifier(struct notifier_block *nb,
{
struct dma_iommu_mapping *map = tegra_smmu_get_map();
struct device *dev = _dev;
- dma_addr_t base;
- size_t size;
- int err;
switch (event) {
case BUS_NOTIFY_BIND_DRIVER:
@@ -1448,13 +1445,11 @@ static int tegra_smmu_device_notifier(struct notifier_block *nb,
break;
/* FALLTHROUGH */
case BUS_NOTIFY_ADD_DEVICE:
- err = of_get_dma_window(dev->of_node, NULL, 0, NULL, &base,
- &size);
- if (!err)
- map = arm_iommu_create_mapping(&platform_bus_type,
- base, size, 0);
- if (IS_ERR_OR_NULL(map))
+ if (!smmu_handle) {
+ dev_warn(dev, "No map yet available\n");
break;
+ }
+
if (arm_iommu_attach_device(dev, map)) {
arm_iommu_release_mapping(map);
dev_err(dev, "Failed to attach %s\n", dev_name(dev));