aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2011-03-31 14:46:28 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:19:17 -0400
commitd17f9291f07ef9bfcf24d936c11c10bcc148d706 (patch)
tree58a349ef83314bf18c2019fe86c49e4db513dc20 /arch/arm
parente3696eca8424c9921779acfa7b16b771dfccc815 (diff)
omap4: iommu: add pm constraints for ducati iommu
A constraint for CORE domain is requested by the IOMMU driver before releasing the Ducati's RST3, and is released when the IOMMU is being disabled. This ensures that the CORE domain does not go into Retention after releasing RST3, thereby eliminating any context loss in the Ducati Unicache registers due to CORE domain OSWR transitions. For runtime PM, the constraint is relaxed after the IOMMU driver has saved its context when Ducati is either self-hibernating or being suspended, and the constraint is requested again before restoring the context for ducati resume. Change-Id: Ib4042226d2529be141d69917bdb211ee6f30bd22 Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Miguel Vadillo <vadillo@ti.com> Signed-off-by: Juan Gutierrez <jgutierrez@ti.com> Signed-off-by: Paul Hunt <hunt@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/iommu2.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 055269b560c..ef255161466 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -20,6 +20,9 @@
20 20
21#include <plat/iommu.h> 21#include <plat/iommu.h>
22#include <plat/omap_device.h> 22#include <plat/omap_device.h>
23#ifdef CONFIG_OMAP_PM
24#include <plat/omap-pm.h>
25#endif
23 26
24/* 27/*
25 * omap2 architecture specific register bit definitions 28 * omap2 architecture specific register bit definitions
@@ -66,6 +69,12 @@
66 ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \ 69 ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \
67 ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0) 70 ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0)
68 71
72#ifdef CONFIG_OMAP_PM
73struct pm_qos_request_list *pm_iommu1_handle;
74#define PM_IOMMU1_SDMA_LAT_CONSTRAINT 400
75#define PM_IOMMU1_NO_LAT_CONSTRAINT -1
76#endif
77
69 78
70static void __iommu_set_twl(struct iommu *obj, bool on) 79static void __iommu_set_twl(struct iommu *obj, bool on)
71{ 80{
@@ -103,6 +112,16 @@ static int omap2_iommu_enable(struct iommu *obj)
103 if (!IS_ALIGNED(pa, SZ_16K)) 112 if (!IS_ALIGNED(pa, SZ_16K))
104 return -EINVAL; 113 return -EINVAL;
105 114
115#ifdef CONFIG_OMAP_PM
116 if (!strcmp(obj->name, "ducati")) {
117 ret = omap_pm_set_max_sdma_lat(&pm_iommu1_handle,
118 PM_IOMMU1_SDMA_LAT_CONSTRAINT);
119 if (ret) {
120 pr_err("omap2_iommu_enable - Unable to set constraint "
121 "on CORE domain\n");
122 }
123 }
124#endif
106 ret = omap_device_enable(obj->pdev); 125 ret = omap_device_enable(obj->pdev);
107 if (ret) 126 if (ret)
108 return ret; 127 return ret;
@@ -153,6 +172,17 @@ static void omap2_iommu_disable(struct iommu *obj)
153 dev_dbg(obj->dev, "%s is shutting down\n", obj->name); 172 dev_dbg(obj->dev, "%s is shutting down\n", obj->name);
154 if (omap_device_shutdown(obj->pdev)) 173 if (omap_device_shutdown(obj->pdev))
155 dev_err(obj->dev, "%s err 0x%x\n", __func__, ret); 174 dev_err(obj->dev, "%s err 0x%x\n", __func__, ret);
175
176#ifdef CONFIG_OMAP_PM
177 if (!strcmp(obj->name, "ducati")) {
178 int status1 = omap_pm_set_max_sdma_lat(&pm_iommu1_handle,
179 PM_IOMMU1_NO_LAT_CONSTRAINT);
180 if (status1) {
181 pr_err("omap2_iommu_disable failed to release "
182 "constraint on CORE domain\n");
183 }
184 }
185#endif
156} 186}
157 187
158static void omap2_iommu_set_twl(struct iommu *obj, bool on) 188static void omap2_iommu_set_twl(struct iommu *obj, bool on)