diff options
author | Guzman Lugo, Fernando <x0095840@ti.com> | 2010-12-14 19:54:03 -0500 |
---|---|---|
committer | Hari Kanigeri <h-kanigeri2@ti.com> | 2010-12-15 12:29:10 -0500 |
commit | c7f4ab26e3bcdaeb3e19ec658e3ad9092f1a6ceb (patch) | |
tree | b80f93995d8e9daa1f53a18c105e8d532102cd21 /arch/arm/plat-omap/iommu.c | |
parent | 9205a109fbeee180254bb5a4020eb71d50735944 (diff) |
OMAP: iommu: create new api to set valid da range
Some IOMMUs cannot use the whole 0x0 - 0xFFFFFFFF range.
With this new API the valid range can be set.
Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/plat-omap/iommu.c')
-rw-r--r-- | arch/arm/plat-omap/iommu.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index 6cd151b31bc5..b1107c08da56 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -830,6 +830,28 @@ static int device_match_by_alias(struct device *dev, void *data) | |||
830 | } | 830 | } |
831 | 831 | ||
832 | /** | 832 | /** |
833 | * iommu_set_da_range - Set a valid device address range | ||
834 | * @obj: target iommu | ||
835 | * @start Start of valid range | ||
836 | * @end End of valid range | ||
837 | **/ | ||
838 | int iommu_set_da_range(struct iommu *obj, u32 start, u32 end) | ||
839 | { | ||
840 | |||
841 | if (!obj) | ||
842 | return -EFAULT; | ||
843 | |||
844 | if (end < start || !PAGE_ALIGN(start | end)) | ||
845 | return -EINVAL; | ||
846 | |||
847 | obj->da_start = start; | ||
848 | obj->da_end = end; | ||
849 | |||
850 | return 0; | ||
851 | } | ||
852 | EXPORT_SYMBOL_GPL(iommu_set_da_range); | ||
853 | |||
854 | /** | ||
833 | * iommu_get - Get iommu handler | 855 | * iommu_get - Get iommu handler |
834 | * @name: target iommu name | 856 | * @name: target iommu name |
835 | **/ | 857 | **/ |
@@ -922,6 +944,8 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) | |||
922 | obj->name = pdata->name; | 944 | obj->name = pdata->name; |
923 | obj->dev = &pdev->dev; | 945 | obj->dev = &pdev->dev; |
924 | obj->ctx = (void *)obj + sizeof(*obj); | 946 | obj->ctx = (void *)obj + sizeof(*obj); |
947 | obj->da_start = pdata->da_start; | ||
948 | obj->da_end = pdata->da_end; | ||
925 | 949 | ||
926 | mutex_init(&obj->iommu_lock); | 950 | mutex_init(&obj->iommu_lock); |
927 | mutex_init(&obj->mmap_lock); | 951 | mutex_init(&obj->mmap_lock); |