Skip to contentSkip to conversation

OMAP3: PM: Disable OTG autoidle when waking up from off-mode

DISCUSSION Gupta, Ajay Kumar 2 participants 2 messages Jan 21, 2010 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Kristo,

There are some issues with this patch in PM branch.

Please find my comments inline.

Regards,
Ajay

Quoted 30 lines

OMAP3: PM: Disable OTG autoidle when waking up from off-mode

OMAP3 sleep can be prevented in some cases where OTG autoidle is
enabled.
This patch force disables autoidle during wakeup from off-mode. See
omap
errata 1.164.

This fix can't be done in driver level, as off-mode entry resets and
enables
the autoidle bit, and driver does not access the register after each
off-mode
entry even if it is loaded.

Tero Kristo <tero.kristo nokia.com> Kevin Hilman <khilman deeprootsystems.com>

arch/arm/mach-omap2/pm34xx.c +1 -0
index 81ed252..ddd19cd 100644
@@ -37,6 +37,7 @@
 #include <plat/gpmc.h>
 #include <plat/dma.h>
 #include <plat/dmtimer.h>
+#include <plat/usb.h>
 
 #include <asm/tlbflush.h>
 

arch/arm/mach-omap2/pm34xx.c void omap_sram_idle(void) · line 438

Quoted 8 lines
arch/arm/mach-omap2/pm34xx.c +5 -0
@@ -430,6 +431,11 @@ void omap_sram_idle(void)
 			omap3_prcm_restore_context();
 			omap3_sram_restore_context();
 			omap2_sms_restore_context();
+			/*
+			 * Errata 1.164 fix : OTG autoidle can prevent
+			 * sleep
+			 */
+			usb_musb_disable_autoidle();

Do we really need it? We are anyway disabling autoidle in Drivers/usb/musb/omap2430.c file.

Quoted 4 lines
arch/arm/mach-omap2/pm34xx.c +1 -2
 		clk_disable(otg_clk);
-		clk_put(otg_clk);
-	}
+}

<snip..>

arch/arm/mach-omap2/pm34xx.c

Quoted 5 lines
arch/arm/mach-omap2/pm34xx.c +3 -1
-	iounmap(otg_base);
+void usb_musb_disable_autoidle(void)
+{
+	__raw_writel(0, otg_base + OTG_SYSCONFIG);

We should first read the register and the reset the first bit D0 for disabling autoidle.

Also, musb clock needs to be enabled during this function call. When I tool musb save/restore patch (accepted and in queue), I found a system hand during resume.

-Ajay

Quoted 1 line

}

#2 lore raw
Quoted 52 lines

-----Original Message-----
From: ext Gupta, Ajay Kumar [mailto:[email protected]]
Sent: 21 January, 2010 12:31
To: Kristo Tero (Nokia-D/Tampere); [email protected]
Cc: Kevin Hilman
Subject: RE: OMAP3: PM: Disable OTG autoidle when waking up from off-mode

Hi Kristo,

There are some issues with this patch in PM branch.

Please find my comments inline.

Regards,
Ajay

Quoted 5 lines

OMAP3: PM: Disable OTG autoidle when waking up from off-mode

OMAP3 sleep can be prevented in some cases where OTG autoidle is
enabled.
This patch force disables autoidle during wakeup from

off-mode. See

Quoted 4 lines

omap
errata 1.164.

This fix can't be done in driver level, as off-mode

entry resets and

Quoted 2 lines

enables
the autoidle bit, and driver does not access the

register after each

Review

Quoted 7 lines

off-mode
entry even if it is loaded.

Tero Kristo <tero.kristo nokia.com> Kevin Hilman <khilman deeprootsystems.com>

(quoted diff) +0 -0

b/arch/arm/mach-omap2/pm34xx.c

Quoted 11 lines

index 81ed252..ddd19cd 100644

arch/arm/mach-omap2/pm34xx.c +1 -0
@@ -37,6 +37,7 @@
 #include <plat/gpmc.h>
 #include <plat/dma.h>
 #include <plat/dmtimer.h>
+#include <plat/usb.h>
 
 #include <asm/tlbflush.h>
 
Quoted 12 lines

arch/arm/mach-omap2/pm34xx.c void omap_sram_idle(void) · line 438

Quoted 9 lines
arch/arm/mach-omap2/pm34xx.c +5 -0
@@ -430,6 +431,11 @@ void omap_sram_idle(void)
 			omap3_prcm_restore_context();
 			omap3_sram_restore_context();
 			omap2_sms_restore_context();
+			/*
+			 * Errata 1.164 fix : OTG autoidle can prevent
+			 * sleep
+			 */
+			usb_musb_disable_autoidle();

Do we really need it? We are anyway disabling autoidle in Drivers/usb/musb/omap2430.c file.

This is not enough, as off-mode entry will reset this register. And, we are not calling MUSB resume functions after every wakeup from off.

Quoted 10 lines
Quoted 6 lines
arch/arm/mach-omap2/pm34xx.c +1 -2
 		clk_disable(otg_clk);
-		clk_put(otg_clk);
-	}
+}

<snip..>

Quoted 1 line
Quoted 8 lines

arch/arm/mach-omap2/pm34xx.c

Quoted 4 lines
arch/arm/mach-omap2/pm34xx.c +3 -1
-	iounmap(otg_base);
+void usb_musb_disable_autoidle(void)
+{
+	__raw_writel(0, otg_base + OTG_SYSCONFIG);

We should first read the register and the reset the first bit D0 for disabling autoidle.

We know that always when we are calling this function, we are waking up from off-mode and MUSB module has been reset also. Thus, no need to read it, as we know what the reset value is.

Quoted 4 lines

Also, musb clock needs to be enabled during this function call. When I tool musb save/restore patch (accepted and in queue), I found a system hand during resume.

It is possible that MUSB clock is disabled here if you are fiddling with the clocks on the MUSB module side. In that case this patch should probably be modified.

-Tero