diff mbox series

[U-Boot,3/8] phy: sun4i-usb: Call phy_passby even for PHY#0

Message ID 20180709191710.22446-4-jagan@amarulasolutions.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series musb: sunxi: Few fixes/improvements | expand

Commit Message

Jagan Teki July 9, 2018, 7:17 p.m. UTC
phy_passby is not calling for phy id 0 in legacy code,
which has no information on why it restricted.
Since Linux phy driver doesn't restrict like this,
so call it directly with out any condition

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Chen-Yu Tsai July 10, 2018, 2:30 a.m. UTC | #1
On Tue, Jul 10, 2018 at 3:17 AM, Jagan Teki <jagan@amarulasolutions.com> wrote:
> phy_passby is not calling for phy id 0 in legacy code,
> which has no information on why it restricted.
> Since Linux phy driver doesn't restrict like this,
> so call it directly with out any condition

See

https://github.com/wens/u-boot-sunxi/commit/b1d3cb2973e75097bbee1835efdc07afb8a7ef2f

for a better commit message. This is an older version. I tried
rebasing on the latest version, but apparently there are merge
conflicts between master and sunxi/next. Even worse, it fails
to boot properly.

Please try to understand why the code is what it is. The reason we
started out with not calling it for PHY 0 is because in the past
USB0 did not have EHCI/OHCI host pairs, which in turn means there's
no "pmu" (whatever that is) register associated with that PHY.

In time, the check for the pointer to that register was moved into
sun4i_usb_phy_passby() itself, which directly returns if that pointer
is not set. And the PHY driver only sets that pointer if a "pmuX"
resource for X PHY is provided.

ChenYu

> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  drivers/phy/allwinner/phy-sun4i-usb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
> index 2b3cf48025..01f585a283 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -300,8 +300,7 @@ static int sun4i_usb_phy_init(struct phy *phy)
>                                     data->cfg->disc_thresh, PHY_DISCON_TH_LEN);
>         }
>
> -       if (usb_phy->id != 0)
> -               sun4i_usb_phy_passby(phy, true);
> +       sun4i_usb_phy_passby(phy, true);
>
>         sun4i_usb_phy0_reroute(data, true);
>
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 2b3cf48025..01f585a283 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -300,8 +300,7 @@  static int sun4i_usb_phy_init(struct phy *phy)
 				    data->cfg->disc_thresh, PHY_DISCON_TH_LEN);
 	}
 
-	if (usb_phy->id != 0)
-		sun4i_usb_phy_passby(phy, true);
+	sun4i_usb_phy_passby(phy, true);
 
 	sun4i_usb_phy0_reroute(data, true);