public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x
Date: Mon, 23 Jun 2014 16:25:39 -0500	[thread overview]
Message-ID: <1403558739-24461-2-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1403558739-24461-1-git-send-email-balbi@ti.com>

Newer AM437x silicon requires us to explicitly power up
the USB2 PHY. By implementing usb_phy_power() we can
achieve that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/phy/omap_usb_phy.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c
index af46db2..0ed3e70 100644
--- a/drivers/usb/phy/omap_usb_phy.c
+++ b/drivers/usb/phy/omap_usb_phy.c
@@ -222,7 +222,22 @@ static void am437x_enable_usb2_phy2(struct omap_xhci *omap)
 
 void usb_phy_power(int on)
 {
-	return;
+	u32 val;
+
+	/* USB1_CTRL */
+	val = readl(0x44e10628);
+	if (on) {
+		/*
+		 * these bits are re-used on AM437x to power up/down the USB
+		 * CM and OTG PHYs, if we don't toggle them, USB will not be
+		 * functional on newer silicon revisions
+		 */
+		val &= ~0x3;
+	} else {
+		val |= 0x3;
+	}
+
+	writel(val, 0x44e10628);
 }
 #endif /* CONFIG_AM437X_USB2PHY2_HOST */
 
-- 
2.0.0.390.gcb682f8

  reply	other threads:[~2014-06-23 21:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 21:25 [U-Boot] [PATCH 1/2] usb: host: xhci: make sure to power up PHY Felipe Balbi
2014-06-23 21:25 ` Felipe Balbi [this message]
2014-06-23 21:28   ` [U-Boot] [PATCH 2/2] usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x Michael Trimarchi
2014-06-23 21:58     ` Felipe Balbi
2014-06-23 22:02       ` Michael Trimarchi
2014-06-23 22:18         ` [U-Boot] [PATCH v2 " Felipe Balbi
2014-06-24 14:38           ` Michael Trimarchi
2014-06-25 13:50             ` Marek Vasut
2014-07-07 16:14           ` Felipe Balbi
2014-07-07 18:08             ` Marek Vasut
2014-07-09 12:41               ` Tom Rini
2014-07-09 12:48                 ` Michael Trimarchi
2014-07-09 16:02                   ` Marek Vasut
2014-07-09 21:03           ` Marek Vasut
2014-06-27 15:27 ` [U-Boot] [PATCH 1/2] usb: host: xhci: make sure to power up PHY Dan Murphy
2014-06-27 15:36   ` Felipe Balbi
2014-06-27 15:37     ` Dan Murphy
2014-07-07 16:14 ` Felipe Balbi
  -- strict thread matches above, loose matches on Subject: below --
2014-07-10  4:02 Felipe Balbi
2014-07-10  4:02 ` [U-Boot] [PATCH 2/2] usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x Felipe Balbi
2014-07-10  4:06   ` Felipe Balbi
2014-07-10  7:44     ` Marek Vasut

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=1403558739-24461-2-git-send-email-balbi@ti.com \
    --to=balbi@ti.com \
    --cc=u-boot@lists.denx.de \
    /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