diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-09-23 19:28:28 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-09-23 19:28:28 -0400 |
commit | b71c72178e24118214f21567a15adcad61b4238a (patch) | |
tree | 65d550588f5c76db32905c6ceddc2dc20ef0a1cd /arch/arm/mach-omap2/clockdomain.h | |
parent | 5c3e4ec48586f6dfb482f1c524748948ba14021e (diff) |
ARM: OMAP2+: clockdomain/hwmod: add workaround for EMU clockdomain idle problems
The idle status of the IP blocks and clocks inside the EMU clockdomain
isn't taken into account by the PRCM hardware when deciding whether
the clockdomain is idle. Add a workaround flag in the clockdomain
code, CLKDM_MISSING_IDLE_REPORTING, to deal with this problem, and add
the code necessary to support it.
If CLKDM_MISSING_IDLE_REPORTING is set on a clockdomain, the
clockdomain will be forced active whenever an IP block inside that
clockdomain is in use, even if the clockdomain supports
hardware-supervised idle. When the kernel indicates that the last
active IP block inside the clockdomain is no longer used, the
clockdomain will be forced idle, or, if that mode is not supported in
the hardware, it will be placed into hardware-supervised idle.
This patch is an equal collaboration with Jon Hunter
<jon-hunter@ti.com>. Ming Lei <ming.lei@canonical.com>, Will Deacon
<will.deacon@arm.com>, Madhav Vij <mvij@ti.com>, Kevin Hilman
<khilman@ti.com>, Benoît Cousson <b-cousson@ti.com>, and Santosh
Shilimkar <santosh.shilimkar@ti.com> all made essential contributions
to the understanding of EMU clockdomain power management on OMAP.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Jon Hunter <jon-hunter@ti.com>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Madhav Vij <mvij@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Jon Hunter <jon-hunter@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain.h')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index 5601dc13785e..629576be7444 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
@@ -1,9 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/clockdomain.h | ||
3 | * | ||
4 | * OMAP2/3 clockdomain framework functions | 2 | * OMAP2/3 clockdomain framework functions |
5 | * | 3 | * |
6 | * Copyright (C) 2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2008, 2012 Texas Instruments, Inc. |
7 | * Copyright (C) 2008-2011 Nokia Corporation | 5 | * Copyright (C) 2008-2011 Nokia Corporation |
8 | * | 6 | * |
9 | * Paul Walmsley | 7 | * Paul Walmsley |
@@ -34,6 +32,20 @@ | |||
34 | * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is | 32 | * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is |
35 | * active whenever the MPU is active. True for interconnects and | 33 | * active whenever the MPU is active. True for interconnects and |
36 | * the WKUP clockdomains. | 34 | * the WKUP clockdomains. |
35 | * CLKDM_MISSING_IDLE_REPORTING: The idle status of the IP blocks and | ||
36 | * clocks inside this clockdomain are not taken into account by | ||
37 | * the PRCM when determining whether the clockdomain is idle. | ||
38 | * Without this flag, if the clockdomain is set to | ||
39 | * hardware-supervised idle mode, the PRCM may transition the | ||
40 | * enclosing powerdomain to a low power state, even when devices | ||
41 | * inside the clockdomain and powerdomain are in use. (An example | ||
42 | * of such a clockdomain is the EMU clockdomain on OMAP3/4.) If | ||
43 | * this flag is set, and the clockdomain does not support the | ||
44 | * force-sleep mode, then the HW_AUTO mode will be used to put the | ||
45 | * clockdomain to sleep. Similarly, if the clockdomain supports | ||
46 | * the force-wakeup mode, then it will be used whenever a clock or | ||
47 | * IP block inside the clockdomain is active, rather than the | ||
48 | * HW_AUTO mode. | ||
37 | */ | 49 | */ |
38 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 50 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
39 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | 51 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) |
@@ -41,6 +53,7 @@ | |||
41 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | 53 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) |
42 | #define CLKDM_NO_AUTODEPS (1 << 4) | 54 | #define CLKDM_NO_AUTODEPS (1 << 4) |
43 | #define CLKDM_ACTIVE_WITH_MPU (1 << 5) | 55 | #define CLKDM_ACTIVE_WITH_MPU (1 << 5) |
56 | #define CLKDM_MISSING_IDLE_REPORTING (1 << 6) | ||
44 | 57 | ||
45 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | 58 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) |
46 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | 59 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
@@ -187,6 +200,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); | |||
187 | void clkdm_allow_idle(struct clockdomain *clkdm); | 200 | void clkdm_allow_idle(struct clockdomain *clkdm); |
188 | void clkdm_deny_idle(struct clockdomain *clkdm); | 201 | void clkdm_deny_idle(struct clockdomain *clkdm); |
189 | bool clkdm_in_hwsup(struct clockdomain *clkdm); | 202 | bool clkdm_in_hwsup(struct clockdomain *clkdm); |
203 | bool clkdm_missing_idle_reporting(struct clockdomain *clkdm); | ||
190 | 204 | ||
191 | int clkdm_wakeup(struct clockdomain *clkdm); | 205 | int clkdm_wakeup(struct clockdomain *clkdm); |
192 | int clkdm_sleep(struct clockdomain *clkdm); | 206 | int clkdm_sleep(struct clockdomain *clkdm); |