From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv9 8/8] ARM: OMAP4: USB: power down MUSB PHY if not used
Date: Thu, 18 Oct 2012 15:18:04 +0300 [thread overview]
Message-ID: <1350562684.2143.52.camel@sokoban> (raw)
In-Reply-To: <20121018103334.GA1449@arwen.pp.htv.fi>
On Thu, 2012-10-18 at 13:33 +0300, Felipe Balbi wrote:
> Hi,
>
> On Thu, Oct 18, 2012 at 12:20:10PM +0300, Tero Kristo wrote:
> > Commit c9e4412ab8eb8ef82d645d8749c4ce96ad490007 removed all of the USB
> > PHY functions for OMAP4, but this causes a problem with core retention
> > as the MUSB module remains enabled if omap-usb2 phy driver is not used.
> > This keeps the USB DPLL enabled and prevents l3_init pwrdm from idling.
> >
> > Fixed by adding a minimal function back that disables the USB PHY in
> > case omap-usb2 driver is not used.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > Cc: Kishon Vijay Abraham I <kishon@ti.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Tony Lindgren <tony@atomide.com>
> > ---
> > arch/arm/mach-omap2/omap_phy_internal.c | 27 +++++++++++++++++++++++++++
> > 1 files changed, 27 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
> > index d992db8..6a4b9cf 100644
> > --- a/arch/arm/mach-omap2/omap_phy_internal.c
> > +++ b/arch/arm/mach-omap2/omap_phy_internal.c
> > @@ -33,6 +33,33 @@
> > #include "soc.h"
> > #include "control.h"
> >
> > +#define CONTROL_DEV_CONF 0x300
> > +#define PHY_PD 0x1
> > +
> > +#ifndef CONFIG_OMAP_USB2
>
> this is a tristate, meaning that can be a module.
Ok, so extra check for that needed.
>
> > +static int __init omap4430_phy_power_down(void)
> > +{
> > + void __iomem *ctrl_base;
> > +
> > + if (!cpu_is_omap44xx())
> > + return 0;
> > +
> > + ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
> > + if (!ctrl_base) {
> > + pr_err("control module ioremap failed\n");
> > + return -ENOMEM;
> > + }
> > +
> > + /* Power down the phy */
> > + __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
> > +
> > + iounmap(ctrl_base);
> > +
> > + return 0;
> > +}
> > +early_initcall(omap4430_phy_power_down);
> > +#endif
>
> I think you could do it even if the driver is enabled.
Actually not at least now, it looks like the driver is not controlling
this bit at all, so the driver would fail if we do this.
>
> Just to make sure I understand the issue right: is the PHY enabled by
> default or did bootloader left this enabled ?
The reset value for the register is zero (at least according to TRM), so
it is enabled from boot. Also, I couldn't find any code from the u-boot
that would touch this bit with a quick look.
-Tero
next prev parent reply other threads:[~2012-10-18 12:18 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 9:20 [PATCHv9 0/8] ARM: OMAP4: core retention support Tero Kristo
2012-10-18 9:20 ` [PATCHv9 1/8] ARM: OMAP: hwmod: Add support for per hwmod/module context lost count Tero Kristo
2012-10-27 3:00 ` Paul Walmsley
2012-11-21 23:05 ` Paul Walmsley
2012-10-18 9:20 ` [PATCHv9 2/8] ARM: OMAP4: PM: add errata support Tero Kristo
2012-11-05 22:36 ` Kevin Hilman
2012-11-06 21:52 ` Kevin Hilman
2012-11-07 10:11 ` Tero Kristo
2012-10-18 9:20 ` [PATCHv9 3/8] ARM: OMAP4460: Workaround for ROM bug because of CA9 r2pX GIC control register change Tero Kristo
2012-10-18 9:20 ` [PATCHv9 4/8] ARM: OMAP4: suspend: Program all domains to retention Tero Kristo
2012-10-18 9:20 ` [PATCHv9 5/8] ARM: OMAP4: PM: put all domains to OSWR during suspend Tero Kristo
2012-10-18 9:20 ` [PATCHv9 6/8] ARM: OMAP4: retrigger localtimers after re-enabling gic Tero Kristo
2012-10-27 2:51 ` Paul Walmsley
2012-11-05 22:25 ` Kevin Hilman
2012-11-06 9:15 ` Tero Kristo
2012-10-18 9:20 ` [PATCHv9 7/8] ARM: OMAP: PM: update target fpwrst to what pwrdm can reach Tero Kristo
2012-10-18 9:20 ` [PATCHv9 8/8] ARM: OMAP4: USB: power down MUSB PHY if not used Tero Kristo
2012-10-18 10:33 ` Felipe Balbi
2012-10-18 12:18 ` Tero Kristo [this message]
2012-10-18 13:53 ` Felipe Balbi
2012-10-18 14:39 ` Tero Kristo
2012-10-18 14:41 ` Felipe Balbi
2012-10-22 8:54 ` kishon
2012-10-22 9:07 ` Felipe Balbi
2012-10-22 9:25 ` kishon
2012-10-27 2:52 ` Paul Walmsley
2012-10-27 3:02 ` [PATCHv9 0/8] ARM: OMAP4: core retention support Paul Walmsley
2012-11-05 22:23 ` Kevin Hilman
2012-11-06 9:18 ` Tero Kristo
2012-11-06 21:19 ` Kevin Hilman
2012-11-07 10:17 ` Tero Kristo
2012-11-12 14:41 ` Tero Kristo
2012-11-13 19:18 ` Kevin Hilman
2012-11-07 18:35 ` Paul Walmsley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350562684.2143.52.camel@sokoban \
--to=t-kristo@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).