public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrick Delaunay <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [RESEND PATCH v6 4/5] usb: host: dwc2: force reset assert
Date: Mon, 27 Apr 2020 15:30:00 +0200	[thread overview]
Message-ID: <20200427133001.5557-5-patrick.delaunay@st.com> (raw)
In-Reply-To: <20200427133001.5557-1-patrick.delaunay@st.com>

Assert reset before deassert in dwc2_reset;
this patch solve issues when the DWC2 registers are already
initialized with value incompatible with host mode.

Force a hardware reset of the IP reset all the DWC2 registers at
default value, the host driver start with a clean state
(Core Soft reset doen in dwc_otg_core_reset is not enought
 to reset all register).

The error can occurs in U-Boot when DWC2 device gadget driver
force device mode (called by ums or dfu command, before to execute
the usb start command).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- add clk_disable_bulk in dwc2_usb_remove

 drivers/usb/host/dwc2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index b1b79d0a18..640ae3e730 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1151,6 +1151,8 @@ static int dwc2_reset(struct udevice *dev)
 			return ret;
 	}
 
+	/* force reset to clear all IP register */
+	reset_assert_bulk(&priv->resets);
 	ret = reset_deassert_bulk(&priv->resets);
 	if (ret) {
 		reset_release_bulk(&priv->resets);
-- 
2.17.1

  parent reply	other threads:[~2020-04-27 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 13:29 [RESEND PATCH v6 0/5] usb: host: dwc2: use driver model for PHY and CLOCK Patrick Delaunay
2020-04-27 13:29 ` [RESEND PATCH v6 1/5] dm: clk: add stub when CONFIG_CLK is deactivated Patrick Delaunay
2020-04-27 13:29 ` [RESEND PATCH v6 2/5] usb: host: dwc2: add phy support Patrick Delaunay
2020-04-27 13:29 ` [RESEND PATCH v6 3/5] usb: host: dwc2: add clk support Patrick Delaunay
2020-04-27 13:30 ` Patrick Delaunay [this message]
2020-04-27 13:30 ` [RESEND PATCH v6 5/5] usb: host: dwc2: add trace to have clean usb start Patrick Delaunay
2020-04-27 13:37 ` [RESEND PATCH v6 0/5] usb: host: dwc2: use driver model for PHY and CLOCK 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=20200427133001.5557-5-patrick.delaunay@st.com \
    --to=patrick.delaunay@st.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