diff mbox series

[U-Boot] drivers: usb: dwc3: setup phy before dwc3 core soft reset

Message ID 9b714bb2e06e947416d11a4d01e6bcee2a89360b.1568213138.git.michal.simek@xilinx.com
State Accepted
Commit 1a031d236a9eeb28ced5438242987ae6a45f3054
Delegated to: Michal Simek
Headers show
Series [U-Boot] drivers: usb: dwc3: setup phy before dwc3 core soft reset | expand

Commit Message

Michal Simek Sept. 11, 2019, 2:45 p.m. UTC
From: T Karthik Reddy <t.karthik.reddy@xilinx.com>

Phy setup should be done before dwc3 soft core reset as it is done
in linux & this fixes unreliable detection of usb cable on host side.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/usb/dwc3/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michal Simek Oct. 8, 2019, 7:51 a.m. UTC | #1
st 11. 9. 2019 v 16:45 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> From: T Karthik Reddy <t.karthik.reddy@xilinx.com>
>
> Phy setup should be done before dwc3 soft core reset as it is done
> in linux & this fixes unreliable detection of usb cable on host side.
>
> Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  drivers/usb/dwc3/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 56e2a046bf06..2498f0efb1a4 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -440,6 +440,8 @@ static int dwc3_core_init(struct dwc3 *dwc)
>                 goto err0;
>         }
>
> +       dwc3_phy_setup(dwc);
> +
>         ret = dwc3_core_soft_reset(dwc);
>         if (ret)
>                 goto err0;
> @@ -514,8 +516,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
>
>         dwc3_writel(dwc->regs, DWC3_GCTL, reg);
>
> -       dwc3_phy_setup(dwc);
> -
>         ret = dwc3_alloc_scratch_buffers(dwc);
>         if (ret)
>                 goto err0;
> --
> 2.17.1
>

Haven't got any reply on this and patchwork assigned it to me that's
why I am applying it.
M
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 56e2a046bf06..2498f0efb1a4 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -440,6 +440,8 @@  static int dwc3_core_init(struct dwc3 *dwc)
 		goto err0;
 	}
 
+	dwc3_phy_setup(dwc);
+
 	ret = dwc3_core_soft_reset(dwc);
 	if (ret)
 		goto err0;
@@ -514,8 +516,6 @@  static int dwc3_core_init(struct dwc3 *dwc)
 
 	dwc3_writel(dwc->regs, DWC3_GCTL, reg);
 
-	dwc3_phy_setup(dwc);
-
 	ret = dwc3_alloc_scratch_buffers(dwc);
 	if (ret)
 		goto err0;