]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/arm/plat-omap/iommu.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / arch / arm / plat-omap / iommu.c
index 6cd151b31bc5f7ee37afe54882737ddb60be1fbf..b1107c08da5605365992bc5906df5f6f361c0a24 100644 (file)
@@ -829,6 +829,28 @@ static int device_match_by_alias(struct device *dev, void *data)
        return strcmp(obj->name, name) == 0;
 }
 
+/**
+ * iommu_set_da_range - Set a valid device address range
+ * @obj:               target iommu
+ * @start              Start of valid range
+ * @end                        End of valid range
+ **/
+int iommu_set_da_range(struct iommu *obj, u32 start, u32 end)
+{
+
+       if (!obj)
+               return -EFAULT;
+
+       if (end < start || !PAGE_ALIGN(start | end))
+               return -EINVAL;
+
+       obj->da_start = start;
+       obj->da_end = end;
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(iommu_set_da_range);
+
 /**
  * iommu_get - Get iommu handler
  * @name:      target iommu name
@@ -922,6 +944,8 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
        obj->name = pdata->name;
        obj->dev = &pdev->dev;
        obj->ctx = (void *)obj + sizeof(*obj);
+       obj->da_start = pdata->da_start;
+       obj->da_end = pdata->da_end;
 
        mutex_init(&obj->iommu_lock);
        mutex_init(&obj->mmap_lock);