Skip to content

Commit 2e18f5a

Browse files
lokeshvutlaPaul Walmsley
authored andcommitted
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>
1 parent 92e963f commit 2e18f5a

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Documentation/devicetree/bindings/arm/omap/omap.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Optional properties:
2323
during suspend.
2424
- ti,no-reset-on-init: When present, the module should not be reset at init
2525
- 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.
2627

2728
Example:
2829

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,11 @@ static int _enable(struct omap_hwmod *oh)
22002200
*/
22012201
static int _idle(struct omap_hwmod *oh)
22022202
{
2203+
if (oh->flags & HWMOD_NO_IDLE) {
2204+
oh->_int_flags |= _HWMOD_SKIP_ENABLE;
2205+
return 0;
2206+
}
2207+
22032208
pr_debug("omap_hwmod: %s: idling\n", oh->name);
22042209

22052210
if (oh->_state != _HWMOD_STATE_ENABLED) {
@@ -2504,6 +2509,8 @@ static int __init _init(struct omap_hwmod *oh, void *data)
25042509
oh->flags |= HWMOD_INIT_NO_RESET;
25052510
if (of_find_property(np, "ti,no-idle-on-init", NULL))
25062511
oh->flags |= HWMOD_INIT_NO_IDLE;
2512+
if (of_find_property(np, "ti,no-idle", NULL))
2513+
oh->flags |= HWMOD_NO_IDLE;
25072514
}
25082515

25092516
oh->_state = _HWMOD_STATE_INITIALIZED;
@@ -2630,7 +2637,7 @@ static void __init _setup_postsetup(struct omap_hwmod *oh)
26302637
* XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data -
26312638
* it should be set by the core code as a runtime flag during startup
26322639
*/
2633-
if ((oh->flags & HWMOD_INIT_NO_IDLE) &&
2640+
if ((oh->flags & (HWMOD_INIT_NO_IDLE | HWMOD_NO_IDLE)) &&
26342641
(postsetup_state == _HWMOD_STATE_IDLE)) {
26352642
oh->_int_flags |= _HWMOD_SKIP_ENABLE;
26362643
postsetup_state = _HWMOD_STATE_ENABLED;

arch/arm/mach-omap2/omap_hwmod.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ struct omap_hwmod_omap4_prcm {
525525
* or idled.
526526
* HWMOD_OPT_CLKS_NEEDED: The optional clocks are needed for the module to
527527
* 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.
528530
*/
529531
#define HWMOD_SWSUP_SIDLE (1 << 0)
530532
#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -541,6 +543,7 @@ struct omap_hwmod_omap4_prcm {
541543
#define HWMOD_SWSUP_SIDLE_ACT (1 << 12)
542544
#define HWMOD_RECONFIG_IO_CHAIN (1 << 13)
543545
#define HWMOD_OPT_CLKS_NEEDED (1 << 14)
546+
#define HWMOD_NO_IDLE (1 << 15)
544547

545548
/*
546549
* omap_hwmod._int_flags definitions

0 commit comments

Comments
 (0)