* [PATCH 0/5] OMAP4: power framework fixes
@ 2010-05-11 7:27 Rajendra Nayak
2010-05-11 7:27 ` [PATCH 1/5] OMAP4 clock: Support clk_set_parent Rajendra Nayak
2010-05-19 2:20 ` [PATCH 0/5] OMAP4: power framework fixes Paul Walmsley
0 siblings, 2 replies; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
Hi,
This is a short series of fixes for OMAP4 in the PM frameworks,
clock/clockdomain and powerdomain.
regards,
Rajendra
Rajendra Nayak (5):
OMAP4 clock: Support clk_set_parent
OMAP: timers: Fix clock source names for OMAP4
OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains
OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx
OMAP4 powerdomain: Support LOWPOWERSTATECHANGE for powerdomains
arch/arm/mach-omap2/clockdomain.c | 6 +++++
arch/arm/mach-omap2/powerdomain.c | 28 +++++++++++++++++++++++++
arch/arm/mach-omap2/powerdomains44xx.h | 13 +++++++++-
arch/arm/plat-omap/clock.c | 3 --
arch/arm/plat-omap/dmtimer.c | 4 +-
arch/arm/plat-omap/include/plat/powerdomain.h | 7 ++++++
6 files changed, 54 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] OMAP4 clock: Support clk_set_parent
2010-05-11 7:27 [PATCH 0/5] OMAP4: power framework fixes Rajendra Nayak
@ 2010-05-11 7:27 ` Rajendra Nayak
2010-05-11 7:27 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Rajendra Nayak
2010-05-19 2:20 ` [PATCH 0/5] OMAP4: power framework fixes Paul Walmsley
1 sibling, 1 reply; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
Remove the hack put in place while clock framework
was still not in place for OMAP4.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/plat-omap/clock.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 5261a09..701e4ea 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -140,9 +140,6 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
unsigned long flags;
int ret = -EINVAL;
- if (cpu_is_omap44xx())
- /* OMAP4 clk framework not supported yet */
- return 0;
if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
return ret;
--
1.7.0.rc1.33.g07cf0f
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4
2010-05-11 7:27 ` [PATCH 1/5] OMAP4 clock: Support clk_set_parent Rajendra Nayak
@ 2010-05-11 7:27 ` Rajendra Nayak
2010-05-11 7:27 ` [PATCH 3/5] OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains Rajendra Nayak
2010-05-11 15:00 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Kevin Hilman
0 siblings, 2 replies; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
The clock sources for timers on OMAP4 (system clock and 32k
clock) have their names wronly populated.
This patch fixes them so the omap_dm_timer_set_source
does not fail anymore.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/plat-omap/dmtimer.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 4d99dfb..c64875f 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -264,8 +264,8 @@ static struct omap_dm_timer omap4_dm_timers[] = {
{ .phys_base = 0x4a320000, .irq = OMAP44XX_IRQ_GPT12 },
};
static const char *omap4_dm_source_names[] __initdata = {
- "sys_ck",
- "omap_32k_fck",
+ "sys_clkin_ck",
+ "sys_32k_ck",
NULL
};
static struct clk *omap4_dm_source_clocks[2];
--
1.7.0.rc1.33.g07cf0f
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains
2010-05-11 7:27 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Rajendra Nayak
@ 2010-05-11 7:27 ` Rajendra Nayak
2010-05-11 7:27 ` [PATCH 4/5] OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx Rajendra Nayak
2010-05-11 15:00 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Kevin Hilman
1 sibling, 1 reply; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
The pwrsts flag for ALWAYS ON domains like always_on_core_pwrdm
and wkup_pwrdm is wrongly populated with the define for a
powerdomain power state, instead of the allowable state
bitfields.
This causes a few api's to fail sensing invalid pwrst
requested.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/powerdomains44xx.h | 4 ++--
arch/arm/plat-omap/include/plat/powerdomain.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach-omap2/powerdomains44xx.h
index c101514..ad2fbd7 100644
--- a/arch/arm/mach-omap2/powerdomains44xx.h
+++ b/arch/arm/mach-omap2/powerdomains44xx.h
@@ -130,7 +130,7 @@ static struct powerdomain wkup_44xx_pwrdm = {
.name = "wkup_pwrdm",
.prcm_offs = OMAP4430_PRM_WKUP_MOD,
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
- .pwrsts = PWRDM_POWER_ON,
+ .pwrsts = PWRSTS_ON,
.banks = 1,
.pwrsts_mem_ret = {
[0] = PWRDM_POWER_OFF, /* wkup_bank */
@@ -286,7 +286,7 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
.name = "always_on_core_pwrdm",
.prcm_offs = OMAP4430_PRM_ALWAYS_ON_MOD,
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
- .pwrsts = PWRDM_POWER_ON,
+ .pwrsts = PWRSTS_ON,
};
/* cefuse_44xx_pwrdm: Customer efuse controller power domain */
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h
index d82b2c0..e7cc7e6 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/plat-omap/include/plat/powerdomain.h
@@ -31,6 +31,7 @@
#define PWRDM_MAX_PWRSTS 4
/* Powerdomain allowable state bitfields */
+#define PWRSTS_ON (1 << PWRDM_POWER_ON)
#define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \
(1 << PWRDM_POWER_ON))
--
1.7.0.rc1.33.g07cf0f
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx
2010-05-11 7:27 ` [PATCH 3/5] OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains Rajendra Nayak
@ 2010-05-11 7:27 ` Rajendra Nayak
2010-05-11 7:27 ` [PATCH 5/5] OMAP4 powerdomain: Support LOWPOWERSTATECHANGE for powerdomains Rajendra Nayak
0 siblings, 1 reply; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
Currently omap2_clkdm_clk_enable/disable api's program all clockdomains
in forced sleep/wakeup, even if they support HWSUP/AUTO control mode.
This patch fixes this by adding the missing check for omap44xx cpu.
For omap44xx omap2_clkdm_clk_enable/disbale are actually not expected
to do anything if the clockdomain is already in HWAUTO.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/clockdomain.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 6e568ec..13dcd6f 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -994,6 +994,9 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
v = omap2_clkdm_clktrctrl_read(clkdm);
+ if (cpu_is_omap44xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO)
+ return 0;
+
if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ||
(cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) {
/* Disable HW transitions when we are changing deps */
@@ -1056,6 +1059,9 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
v = omap2_clkdm_clktrctrl_read(clkdm);
+ if (cpu_is_omap44xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO)
+ return 0;
+
if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ||
(cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) {
/* Disable HW transitions when we are changing deps */
--
1.7.0.rc1.33.g07cf0f
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] OMAP4 powerdomain: Support LOWPOWERSTATECHANGE for powerdomains
2010-05-11 7:27 ` [PATCH 4/5] OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx Rajendra Nayak
@ 2010-05-11 7:27 ` Rajendra Nayak
0 siblings, 0 replies; 8+ messages in thread
From: Rajendra Nayak @ 2010-05-11 7:27 UTC (permalink / raw)
To: linux-omap; +Cc: Rajendra Nayak
Some powerdomains in OMAP4 support a direct transition from one sleep
state to another deeper sleep state without having to wakeup the
powerdomain. This patch adds an api in the powerdomain framework to
set the LOWPOWERSTATECHANGE bit in PWRSTCTRL register.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/powerdomain.c | 28 +++++++++++++++++++++++++
arch/arm/mach-omap2/powerdomains44xx.h | 9 ++++++++
arch/arm/plat-omap/include/plat/powerdomain.h | 6 +++++
3 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index ebfce7d..7e000bc 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -978,6 +978,34 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
}
/**
+ * pwrdm_set_lowpwrstchange - Request a low power state change
+ * @pwrdm: struct powerdomain *
+ *
+ * Allows a powerdomain to transtion to a lower power sleep state
+ * from an existing sleep state without waking up the powerdomain.
+ * Returns -EINVAL if the powerdomain pointer is null or if the
+ * powerdomain does not support LOWPOWERSTATECHANGE, or returns 0
+ * upon success.
+ */
+int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
+{
+ if (!pwrdm)
+ return -EINVAL;
+
+ if (!(pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE))
+ return -EINVAL;
+
+ pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n",
+ pwrdm->name);
+
+ prm_rmw_mod_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
+ (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT),
+ pwrdm->prcm_offs, pwrstctrl_reg_offs);
+
+ return 0;
+}
+
+/**
* pwrdm_wait_transition - wait for powerdomain power transition to finish
* @pwrdm: struct powerdomain * to wait for
*
diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach-omap2/powerdomains44xx.h
index ad2fbd7..0e88f8c 100644
--- a/arch/arm/mach-omap2/powerdomains44xx.h
+++ b/arch/arm/mach-omap2/powerdomains44xx.h
@@ -54,6 +54,7 @@ static struct powerdomain core_44xx_pwrdm = {
[3] = PWRDM_POWER_ON, /* ducati_l2ram */
[4] = PWRDM_POWER_ON, /* ducati_unicache */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* gfx_44xx_pwrdm: 3D accelerator power domain */
@@ -69,6 +70,7 @@ static struct powerdomain gfx_44xx_pwrdm = {
.pwrsts_mem_on = {
[0] = PWRDM_POWER_ON, /* gfx_mem */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* abe_44xx_pwrdm: Audio back end power domain */
@@ -87,6 +89,7 @@ static struct powerdomain abe_44xx_pwrdm = {
[0] = PWRDM_POWER_ON, /* aessmem */
[1] = PWRDM_POWER_ON, /* periphmem */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* dss_44xx_pwrdm: Display subsystem power domain */
@@ -103,6 +106,7 @@ static struct powerdomain dss_44xx_pwrdm = {
.pwrsts_mem_on = {
[0] = PWRDM_POWER_ON, /* dss_mem */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* tesla_44xx_pwrdm: Tesla processor power domain */
@@ -123,6 +127,7 @@ static struct powerdomain tesla_44xx_pwrdm = {
[1] = PWRDM_POWER_ON, /* tesla_l1 */
[2] = PWRDM_POWER_ON, /* tesla_l2 */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* wkup_44xx_pwrdm: Wake-up power domain */
@@ -227,6 +232,7 @@ static struct powerdomain ivahd_44xx_pwrdm = {
[2] = PWRDM_POWER_ON, /* tcm1_mem */
[3] = PWRDM_POWER_ON, /* tcm2_mem */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* cam_44xx_pwrdm: Camera subsystem power domain */
@@ -242,6 +248,7 @@ static struct powerdomain cam_44xx_pwrdm = {
.pwrsts_mem_on = {
[0] = PWRDM_POWER_ON, /* cam_mem */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */
@@ -258,6 +265,7 @@ static struct powerdomain l3init_44xx_pwrdm = {
.pwrsts_mem_on = {
[0] = PWRDM_POWER_ON, /* l3init_bank1 */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/* l4per_44xx_pwrdm: Target peripherals power domain */
@@ -276,6 +284,7 @@ static struct powerdomain l4per_44xx_pwrdm = {
[0] = PWRDM_POWER_ON, /* nonretained_bank */
[1] = PWRDM_POWER_ON, /* retained_bank */
},
+ .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
};
/*
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h
index e7cc7e6..fb6ec74 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/plat-omap/include/plat/powerdomain.h
@@ -50,6 +50,12 @@
* in MEM bank 1 position. This is
* true for OMAP3430
*/
+#define PWRDM_HAS_LOWPOWERSTATECHANGE (1 << 2) /*
+ * support to transition from a
+ * sleep state to a lower sleep
+ * state without waking up the
+ * powerdomain
+ */
/*
* Number of memory banks that are power-controllable. On OMAP4430, the
--
1.7.0.rc1.33.g07cf0f
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4
2010-05-11 7:27 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Rajendra Nayak
2010-05-11 7:27 ` [PATCH 3/5] OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains Rajendra Nayak
@ 2010-05-11 15:00 ` Kevin Hilman
1 sibling, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2010-05-11 15:00 UTC (permalink / raw)
To: Rajendra Nayak; +Cc: linux-omap
Rajendra Nayak <rnayak@ti.com> writes:
> The clock sources for timers on OMAP4 (system clock and 32k
> clock) have their names wronly populated.
typo: wrongly
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] OMAP4: power framework fixes
2010-05-11 7:27 [PATCH 0/5] OMAP4: power framework fixes Rajendra Nayak
2010-05-11 7:27 ` [PATCH 1/5] OMAP4 clock: Support clk_set_parent Rajendra Nayak
@ 2010-05-19 2:20 ` Paul Walmsley
1 sibling, 0 replies; 8+ messages in thread
From: Paul Walmsley @ 2010-05-19 2:20 UTC (permalink / raw)
To: Rajendra Nayak; +Cc: linux-omap, paul
Hi Rajendra,
On Tue, 11 May 2010, Rajendra Nayak wrote:
> This is a short series of fixes for OMAP4 in the PM frameworks,
> clock/clockdomain and powerdomain.
>
> regards,
> Rajendra
>
> Rajendra Nayak (5):
> OMAP4 clock: Support clk_set_parent
> OMAP: timers: Fix clock source names for OMAP4
> OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains
> OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx
> OMAP4 powerdomain: Support LOWPOWERSTATECHANGE for powerdomains
>
> arch/arm/mach-omap2/clockdomain.c | 6 +++++
> arch/arm/mach-omap2/powerdomain.c | 28 +++++++++++++++++++++++++
> arch/arm/mach-omap2/powerdomains44xx.h | 13 +++++++++-
> arch/arm/plat-omap/clock.c | 3 --
> arch/arm/plat-omap/dmtimer.c | 4 +-
> arch/arm/plat-omap/include/plat/powerdomain.h | 7 ++++++
> 6 files changed, 54 insertions(+), 7 deletions(-)
Thanks - I've queued patches 1-3 and 5 for 2.6.35; patch 4 I need to think
about some more.
- Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-05-19 2:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 7:27 [PATCH 0/5] OMAP4: power framework fixes Rajendra Nayak
2010-05-11 7:27 ` [PATCH 1/5] OMAP4 clock: Support clk_set_parent Rajendra Nayak
2010-05-11 7:27 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Rajendra Nayak
2010-05-11 7:27 ` [PATCH 3/5] OMAP4 powerdomain: Fix pwrsts flags for ALWAYS ON domains Rajendra Nayak
2010-05-11 7:27 ` [PATCH 4/5] OMAP4 clockdomain: Fix omap2_clkdm_clk_enable/disable api for 44xx Rajendra Nayak
2010-05-11 7:27 ` [PATCH 5/5] OMAP4 powerdomain: Support LOWPOWERSTATECHANGE for powerdomains Rajendra Nayak
2010-05-11 15:00 ` [PATCH 2/5] OMAP: timers: Fix clock source names for OMAP4 Kevin Hilman
2010-05-19 2:20 ` [PATCH 0/5] OMAP4: power framework fixes Paul Walmsley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).