[U-Boot] [PATCH v5 3/9] phy: Add a new driver for OMAP's USB2 PHYs
Marek Vasut
marex at denx.de
Fri May 4 14:38:07 UTC 2018
On 05/04/2018 04:34 PM, Jean-Jacques Hiblot wrote:
> This drivers supports the USB2 PHY found on omap5 and dra7 SOCs.
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
>
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2:
> - omap-usb2-phy: Implement power_on and power_off callbacks
>
> drivers/phy/Kconfig | 8 ++
> drivers/phy/Makefile | 1 +
> drivers/phy/omap-usb2-phy.c | 196 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 205 insertions(+)
> create mode 100644 drivers/phy/omap-usb2-phy.c
>
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index 119edec..ed2b0a8 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -118,4 +118,12 @@ config MESON_GXL_USB_PHY
> This is the generic phy driver for the Amlogic Meson GXL
> USB2 and USB3 PHYS.
>
> +config OMAP_USB2_PHY
> + bool "Support OMAP's USB2 PHY"
s/OMAP's/TI OMAP/ ?
[...]
> +
> +#define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT BIT(0)
> +
> +#define OMAP_DEV_PHY_PD BIT(0)
> +#define OMAP_USB2_PHY_PD BIT(28)
> +
> +#define USB2PHY_DISCON_BYP_LATCH BIT(31)
> +#define USB2PHY_ANA_CONFIG1 (0x4c)
Parenthesis not needed
> +DECLARE_GLOBAL_DATA_PTR;
Is GD really needed for DM driver ?
[...]
> +static int omap_usb2_phy_init(struct phy *usb_phy)
> +{
> + struct udevice *dev = usb_phy->dev;
> + struct omap_usb2_phy *priv = dev_get_priv(dev);
> + u32 val;
> +
> + if (priv->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) {
Invert the condition to reduce level of indent .
> + /*
> + *
> + * Reduce the sensitivity of internal PHY by enabling the
> + * DISCON_BYP_LATCH of the USB2PHY_ANA_CONFIG1 register. This
> + * resolves issues with certain devices which can otherwise
> + * be prone to false disconnects.
> + *
> + */
> + val = readl(priv->phy_base + USB2PHY_ANA_CONFIG1);
> + val |= USB2PHY_DISCON_BYP_LATCH;
> + writel(val, priv->phy_base + USB2PHY_ANA_CONFIG1);
> + }
> +
> + return 0;
> +}
[...]
--
Best regards,
Marek Vasut
More information about the U-Boot
mailing list