aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/iommu.c
diff options
context:
space:
mode:
authorSubramaniam C.A <subramaniam.ca@ti.com>2012-04-13 11:38:41 -0500
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:58:03 +0200
commit268ebf01d357d4b99de2f8e2476004eb5ec24ebb (patch)
treebb5a7fd12885029789a2507a62ba30a3d8495640 /arch/arm/plat-omap/iommu.c
parent27404fd8b2c1e23ac21203a5c2546bccf9b94cd0 (diff)
downloadkernel_samsung_tuna-268ebf01d357d4b99de2f8e2476004eb5ec24ebb.zip
kernel_samsung_tuna-268ebf01d357d4b99de2f8e2476004eb5ec24ebb.tar.gz
kernel_samsung_tuna-268ebf01d357d4b99de2f8e2476004eb5ec24ebb.tar.bz2
omap: iommu: program constraints based on platform data
IOMMU driver requests and releases constraints in iommu_get and iommu_put respectively. These constraints are actually needed only on OMAP4 and beyond for sub-systems that have an AMMU. The current driver code has these values hard-coded for all the chips. A new platform data field has been added now for the constraints values, and this allows the values to be programmed based on the OMAP chip and also allow a unique value if needed for each iommu instance. The logic in IOMMU driver code is adjusted to request the constraints only if the relevant platform data field is set. Change-Id: Iab18cbdde1d7fa7507dbff0b9512c8577b42fefd Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/iommu.c')
-rw-r--r--arch/arm/plat-omap/iommu.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index f82db49..b3c575c 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -31,10 +31,6 @@
(__i < (n)) && (cr = __iotlb_read_cr((obj), __i), true); \
__i++)
-#define SET_MPU_CORE_CONSTRAINT 10
-#define SET_DSP_CONSTRAINT 10
-#define CLEAR_CONSTRAINT -1
-
/* accommodate the difference between omap1 and omap2/3 */
static const struct iommu_functions *arch_iommu;
@@ -857,13 +853,13 @@ static void _set_latency_cstr(struct iommu *obj, bool set)
{
int val;
- if (!strcmp(obj->name, "ducati")) {
- val = set ? SET_MPU_CORE_CONSTRAINT : CLEAR_CONSTRAINT;
+ val = set ? obj->pm_constraint : PM_QOS_DEFAULT_VALUE;
+ if (!strcmp(obj->name, "ducati"))
pm_qos_update_request(obj->qos_request, val);
- } else if (!strcmp(obj->name, "tesla")) {
- val = set ? SET_DSP_CONSTRAINT : CLEAR_CONSTRAINT;
- omap_pm_set_max_dev_wakeup_lat(obj->dev, obj->dev, val);
- }
+ else if (!strcmp(obj->name, "tesla"))
+ omap_pm_set_max_dev_wakeup_lat(obj->dev,
+ obj->dev, val);
+
return;
}
@@ -887,12 +883,13 @@ struct iommu *iommu_get(const char *name)
mutex_lock(&obj->iommu_lock);
if (obj->refcount++ == 0) {
- _set_latency_cstr(obj, true);
+ if (obj->pm_constraint)
+ _set_latency_cstr(obj, true);
+
err = iommu_enable(obj);
- if (err) {
- _set_latency_cstr(obj, false);
+ if (err)
goto err_enable;
- }
+
flush_iotlb_all(obj);
}
@@ -908,6 +905,9 @@ err_module:
if (obj->refcount == 1)
iommu_disable(obj);
err_enable:
+ if (obj->pm_constraint)
+ _set_latency_cstr(obj, false);
+
obj->refcount--;
mutex_unlock(&obj->iommu_lock);
return ERR_PTR(err);
@@ -933,7 +933,8 @@ void iommu_put(struct iommu *obj)
if (--obj->refcount == 0) {
iommu_disable(obj);
- _set_latency_cstr(obj, false);
+ if (obj->pm_constraint)
+ _set_latency_cstr(obj, false);
}
module_put(obj->owner);
@@ -1016,6 +1017,7 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
obj->ctx = (void *)obj + sizeof(*obj);
obj->da_start = pdata->da_start;
obj->da_end = pdata->da_end;
+ obj->pm_constraint = pdata->pm_constraint;
mutex_init(&obj->iommu_lock);
mutex_init(&obj->mmap_lock);