[U-Boot] [PATCH v2 2/2] usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x
Felipe Balbi
balbi at ti.com
Mon Jul 7 18:14:23 CEST 2014
hi,
On Mon, Jun 23, 2014 at 05:18:24PM -0500, Felipe Balbi wrote:
> 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 at ti.com>
> ---
>
> Changes since v1:
> - add macros for USB1_CTRL register and bits
same here. Still pending, am437x will remain broken until this is
applied.
cheers
>
> arch/arm/include/asm/arch-am33xx/hardware_am43xx.h | 5 +++++
> drivers/usb/phy/omap_usb_phy.c | 17 ++++++++++++++++-
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
> index 15399dc..b5875e3 100644
> --- a/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
> +++ b/arch/arm/include/asm/arch-am33xx/hardware_am43xx.h
> @@ -40,6 +40,11 @@
> #define VTP0_CTRL_ADDR 0x44E10E0C
> #define VTP1_CTRL_ADDR 0x48140E10
>
> +/* USB CTRL Base Address */
> +#define USB1_CTRL 0x44e10628
> +#define USB1_CTRL_CM_PWRDN BIT(0)
> +#define USB1_CTRL_OTG_PWRDN BIT(1)
> +
> /* DDR Base address */
> #define DDR_PHY_CMD_ADDR 0x44E12000
> #define DDR_PHY_DATA_ADDR 0x44E120C8
> diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c
> index af46db2..f78d532 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(USB1_CTRL);
> + 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 &= ~(USB1_CTRL_CM_PWRDN | USB1_CTRL_OTG_PWRDN);
> + } else {
> + val |= USB1_CTRL_CM_PWRDN | USB1_CTRL_OTG_PWRDN;
> + }
> +
> + writel(val, USB1_CTRL);
> }
> #endif /* CONFIG_AM437X_USB2PHY2_HOST */
>
> --
> 2.0.0.390.gcb682f8
>
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140707/3570fc32/attachment.pgp>
More information about the U-Boot
mailing list