aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2011-07-01 16:54:00 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-09 21:13:35 -0400
commit724019b0137acf2ea43e5ca854798851f5ebf51f (patch)
tree7868806c219b4e31507f998cde481ad8add42888 /arch/arm
parentecba3287b4121dcf3ca7607fe71c205913edec06 (diff)
OMAP2+: hwmod: Fix smart-standby + wakeup support
The commit 86009eb326afde34ffdc5648cd344aa86b8d58d4 was adding the wakeup support for new OMAP4 IPs. This support is incomplete for busmaster IPs that need as well to use smart-standby with wakeup. This new standbymode is suported on HSI and USB_HOST_FS for the moment. Add the new MSTANDBY_SMART_WKUP flag to mark the IPs that support this capability. Enable this new mode when applicable in _enable_wakeup, _disable_wakeup, _enable_sysc and _idle_sysc. The omap_hwmod_44xx_data.c will have to be updated to add this new flag. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Djamil Elaidi <d-elaidi@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c34
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h2
2 files changed, 29 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 293fa6cd50e1..384d3c3ec36d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -391,7 +391,8 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
391 391
392 if (!oh->class->sysc || 392 if (!oh->class->sysc ||
393 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || 393 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
394 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP))) 394 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) ||
395 (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)))
395 return -EINVAL; 396 return -EINVAL;
396 397
397 if (!oh->class->sysc->sysc_fields) { 398 if (!oh->class->sysc->sysc_fields) {
@@ -405,6 +406,8 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
405 406
406 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) 407 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
407 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v); 408 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
409 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
410 _set_master_standbymode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
408 411
409 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 412 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
410 413
@@ -426,7 +429,8 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
426 429
427 if (!oh->class->sysc || 430 if (!oh->class->sysc ||
428 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || 431 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
429 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP))) 432 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) ||
433 (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)))
430 return -EINVAL; 434 return -EINVAL;
431 435
432 if (!oh->class->sysc->sysc_fields) { 436 if (!oh->class->sysc->sysc_fields) {
@@ -440,6 +444,8 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
440 444
441 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) 445 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
442 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v); 446 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v);
447 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
448 _set_master_standbymode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
443 449
444 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 450 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
445 451
@@ -781,8 +787,16 @@ static void _enable_sysc(struct omap_hwmod *oh)
781 } 787 }
782 788
783 if (sf & SYSC_HAS_MIDLEMODE) { 789 if (sf & SYSC_HAS_MIDLEMODE) {
784 idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? 790 if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
785 HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; 791 idlemode = HWMOD_IDLEMODE_NO;
792 } else {
793 if (sf & SYSC_HAS_ENAWAKEUP)
794 _enable_wakeup(oh, &v);
795 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
796 idlemode = HWMOD_IDLEMODE_SMART_WKUP;
797 else
798 idlemode = HWMOD_IDLEMODE_SMART;
799 }
786 _set_master_standbymode(oh, idlemode, &v); 800 _set_master_standbymode(oh, idlemode, &v);
787 } 801 }
788 802
@@ -840,8 +854,16 @@ static void _idle_sysc(struct omap_hwmod *oh)
840 } 854 }
841 855
842 if (sf & SYSC_HAS_MIDLEMODE) { 856 if (sf & SYSC_HAS_MIDLEMODE) {
843 idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? 857 if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
844 HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; 858 idlemode = HWMOD_IDLEMODE_FORCE;
859 } else {
860 if (sf & SYSC_HAS_ENAWAKEUP)
861 _enable_wakeup(oh, &v);
862 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
863 idlemode = HWMOD_IDLEMODE_SMART_WKUP;
864 else
865 idlemode = HWMOD_IDLEMODE_SMART;
866 }
845 _set_master_standbymode(oh, idlemode, &v); 867 _set_master_standbymode(oh, idlemode, &v);
846 } 868 }
847 869
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1adea9c62984..e93438c4bdac 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -77,7 +77,6 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
77#define HWMOD_IDLEMODE_FORCE (1 << 0) 77#define HWMOD_IDLEMODE_FORCE (1 << 0)
78#define HWMOD_IDLEMODE_NO (1 << 1) 78#define HWMOD_IDLEMODE_NO (1 << 1)
79#define HWMOD_IDLEMODE_SMART (1 << 2) 79#define HWMOD_IDLEMODE_SMART (1 << 2)
80/* Slave idle mode flag only */
81#define HWMOD_IDLEMODE_SMART_WKUP (1 << 3) 80#define HWMOD_IDLEMODE_SMART_WKUP (1 << 3)
82 81
83/** 82/**
@@ -258,6 +257,7 @@ struct omap_hwmod_ocp_if {
258#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT) 257#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
259#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT) 258#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
260#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT) 259#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
260#define MSTANDBY_SMART_WKUP (HWMOD_IDLEMODE_SMART_WKUP << MASTER_STANDBY_SHIFT)
261 261
262/* omap_hwmod_sysconfig.sysc_flags capability flags */ 262/* omap_hwmod_sysconfig.sysc_flags capability flags */
263#define SYSC_HAS_AUTOIDLE (1 << 0) 263#define SYSC_HAS_AUTOIDLE (1 << 0)