aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2017-10-30 05:11:04 -0400
committerTony Lindgren <tony@atomide.com>2017-10-30 12:14:55 -0400
commit6301d58477bc11116c78c9542871f27ae374278d (patch)
treee0067591f4296fa9943577750360073a6d41adfb
parent3c4d296e58a23687f2076d8ad531e6ae2b725846 (diff)
ARM: OMAP2/3: CM: fix cm_split_idlest functionality
cm_split_idlest doesn't take the CM base offset into account right now, causing it to read reserved registers which show idlestatus as active always. This will cause the wait_module_ready functionality to be effectively an expensive NOP, which will cause problems if the module hasn't really activated during its execution. Fix by adding the CM offset into the calculation so the wait_module_ready will access correct register. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reported-by: Filip Matijevic <filip.matijevic.pz@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/cm_common.c6
-rw-r--r--arch/arm/mach-omap2/prcm-common.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
index d555791cf349..83c6fa74cc31 100644
--- a/arch/arm/mach-omap2/cm_common.c
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -68,14 +68,17 @@ void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2)
68int cm_split_idlest_reg(struct clk_omap_reg *idlest_reg, s16 *prcm_inst, 68int cm_split_idlest_reg(struct clk_omap_reg *idlest_reg, s16 *prcm_inst,
69 u8 *idlest_reg_id) 69 u8 *idlest_reg_id)
70{ 70{
71 int ret;
71 if (!cm_ll_data->split_idlest_reg) { 72 if (!cm_ll_data->split_idlest_reg) {
72 WARN_ONCE(1, "cm: %s: no low-level function defined\n", 73 WARN_ONCE(1, "cm: %s: no low-level function defined\n",
73 __func__); 74 __func__);
74 return -EINVAL; 75 return -EINVAL;
75 } 76 }
76 77
77 return cm_ll_data->split_idlest_reg(idlest_reg, prcm_inst, 78 ret = cm_ll_data->split_idlest_reg(idlest_reg, prcm_inst,
78 idlest_reg_id); 79 idlest_reg_id);
80 *prcm_inst -= cm_base.offset;
81 return ret;
79} 82}
80 83
81/** 84/**
@@ -337,6 +340,7 @@ int __init omap2_cm_base_init(void)
337 if (mem) { 340 if (mem) {
338 mem->pa = res.start + data->offset; 341 mem->pa = res.start + data->offset;
339 mem->va = data->mem + data->offset; 342 mem->va = data->mem + data->offset;
343 mem->offset = data->offset;
340 } 344 }
341 345
342 data->np = np; 346 data->np = np;
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index ee7041d523cf..ac9ee2ef3471 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -529,6 +529,7 @@ struct omap_prcm_irq_setup {
529struct omap_domain_base { 529struct omap_domain_base {
530 u32 pa; 530 u32 pa;
531 void __iomem *va; 531 void __iomem *va;
532 s16 offset;
532}; 533};
533 534
534/** 535/**