aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2016-03-07 03:41:21 -0500
committerPaul Walmsley <paul@pwsan.com>2016-03-07 03:41:21 -0500
commit2e18f5a1bc18e8af7031b3b26efde25307014837 (patch)
tree900b14053e28a5a387e823d7db61474224adc072
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
ARM: OMAP2+: hwmod: Introduce ti,no-idle dt property
Introduce a dt property, ti,no-idle, that prevents an IP to idle at any point. This is to handle Errata i877, which tells that GMAC clocks cannot be disabled. Acked-by: Roger Quadros <rogerq@ti.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Acked-by: Rob Herring <robh@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r--Documentation/devicetree/bindings/arm/omap/omap.txt1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c9
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h3
3 files changed, 12 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index a2bd593881ca..66422d663184 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -23,6 +23,7 @@ Optional properties:
23 during suspend. 23 during suspend.
24- ti,no-reset-on-init: When present, the module should not be reset at init 24- ti,no-reset-on-init: When present, the module should not be reset at init
25- ti,no-idle-on-init: When present, the module should not be idled at init 25- ti,no-idle-on-init: When present, the module should not be idled at init
26- ti,no-idle: When present, the module is never allowed to idle.
26 27
27Example: 28Example:
28 29
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fec55c0..b6d62e4cdfdd 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2200,6 +2200,11 @@ static int _enable(struct omap_hwmod *oh)
2200 */ 2200 */
2201static int _idle(struct omap_hwmod *oh) 2201static int _idle(struct omap_hwmod *oh)
2202{ 2202{
2203 if (oh->flags & HWMOD_NO_IDLE) {
2204 oh->_int_flags |= _HWMOD_SKIP_ENABLE;
2205 return 0;
2206 }
2207
2203 pr_debug("omap_hwmod: %s: idling\n", oh->name); 2208 pr_debug("omap_hwmod: %s: idling\n", oh->name);
2204 2209
2205 if (oh->_state != _HWMOD_STATE_ENABLED) { 2210 if (oh->_state != _HWMOD_STATE_ENABLED) {
@@ -2504,6 +2509,8 @@ static int __init _init(struct omap_hwmod *oh, void *data)
2504 oh->flags |= HWMOD_INIT_NO_RESET; 2509 oh->flags |= HWMOD_INIT_NO_RESET;
2505 if (of_find_property(np, "ti,no-idle-on-init", NULL)) 2510 if (of_find_property(np, "ti,no-idle-on-init", NULL))
2506 oh->flags |= HWMOD_INIT_NO_IDLE; 2511 oh->flags |= HWMOD_INIT_NO_IDLE;
2512 if (of_find_property(np, "ti,no-idle", NULL))
2513 oh->flags |= HWMOD_NO_IDLE;
2507 } 2514 }
2508 2515
2509 oh->_state = _HWMOD_STATE_INITIALIZED; 2516 oh->_state = _HWMOD_STATE_INITIALIZED;
@@ -2630,7 +2637,7 @@ static void __init _setup_postsetup(struct omap_hwmod *oh)
2630 * XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data - 2637 * XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data -
2631 * it should be set by the core code as a runtime flag during startup 2638 * it should be set by the core code as a runtime flag during startup
2632 */ 2639 */
2633 if ((oh->flags & HWMOD_INIT_NO_IDLE) && 2640 if ((oh->flags & (HWMOD_INIT_NO_IDLE | HWMOD_NO_IDLE)) &&
2634 (postsetup_state == _HWMOD_STATE_IDLE)) { 2641 (postsetup_state == _HWMOD_STATE_IDLE)) {
2635 oh->_int_flags |= _HWMOD_SKIP_ENABLE; 2642 oh->_int_flags |= _HWMOD_SKIP_ENABLE;
2636 postsetup_state = _HWMOD_STATE_ENABLED; 2643 postsetup_state = _HWMOD_STATE_ENABLED;
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 76bce11c85a4..7c7a31169475 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -525,6 +525,8 @@ struct omap_hwmod_omap4_prcm {
525 * or idled. 525 * or idled.
526 * HWMOD_OPT_CLKS_NEEDED: The optional clocks are needed for the module to 526 * HWMOD_OPT_CLKS_NEEDED: The optional clocks are needed for the module to
527 * operate and they need to be handled at the same time as the main_clk. 527 * operate and they need to be handled at the same time as the main_clk.
528 * HWMOD_NO_IDLE: Do not idle the hwmod at all. Useful to handle certain
529 * IPs like CPSW on DRA7, where clocks to this module cannot be disabled.
528 */ 530 */
529#define HWMOD_SWSUP_SIDLE (1 << 0) 531#define HWMOD_SWSUP_SIDLE (1 << 0)
530#define HWMOD_SWSUP_MSTANDBY (1 << 1) 532#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -541,6 +543,7 @@ struct omap_hwmod_omap4_prcm {
541#define HWMOD_SWSUP_SIDLE_ACT (1 << 12) 543#define HWMOD_SWSUP_SIDLE_ACT (1 << 12)
542#define HWMOD_RECONFIG_IO_CHAIN (1 << 13) 544#define HWMOD_RECONFIG_IO_CHAIN (1 << 13)
543#define HWMOD_OPT_CLKS_NEEDED (1 << 14) 545#define HWMOD_OPT_CLKS_NEEDED (1 << 14)
546#define HWMOD_NO_IDLE (1 << 15)
544 547
545/* 548/*
546 * omap_hwmod._int_flags definitions 549 * omap_hwmod._int_flags definitions