public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC 3/6] usb: exynos: add init_after_reset for usb reset
Date: Mon,  1 Apr 2019 11:52:29 +0000	[thread overview]
Message-ID: <20190401115232.453-4-linux.amoon@gmail.com> (raw)
In-Reply-To: <20190401115232.453-1-linux.amoon@gmail.com>

Some host controllers need addidional re-initialization
after ehci_reset() so we add .init_after_reset callback
which is requires to reinit the phy after controller reset.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/usb/host/ehci-exynos.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index b0f7bd4936..e6a542e092 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -143,6 +143,23 @@ static void exynos5_setup_usb_phy(struct exynos_usb_phy *usb)
 			EHCICTRL_ENAINCR16);
 }
 
+static int ehci_exynos_init_after_reset(struct ehci_ctrl *ehcntl)
+{
+	if (cpu_is_exynos4()) {
+		if (proid_is_exynos4412()) {
+			/*
+			 * "usb reset" cmd: restart re-initialize the usb driver
+			 */
+			exynos_usb_init();
+		}
+	}
+	return 0;
+}
+
+static const struct ehci_ops exynos_ehci_ops = {
+	.init_after_reset = ehci_exynos_init_after_reset,
+};
+
 static void exynos4412_setup_usb_phy(struct exynos4412_usb_phy *usb)
 {
 	writel(CLK_24MHZ, &usb->usbphyclk);
@@ -234,7 +251,8 @@ static int ehci_usb_probe(struct udevice *dev)
 	hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd +
 			HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase)));
 
-	return ehci_register(dev, ctx->hcd, hcor, NULL, 0, USB_INIT_HOST);
+	return ehci_register(dev, ctx->hcd, hcor, &exynos_ehci_ops,
+			0, USB_INIT_HOST);
 }
 
 static int ehci_usb_remove(struct udevice *dev)
-- 
2.21.0

  parent reply	other threads:[~2019-04-01 11:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 11:52 [U-Boot] [RFC 0/6] Odroid U3 usb initialization Anand Moon
2019-04-01 11:52 ` [U-Boot] [RFC 1/6] odroid: exynos: USB initialization on the U3/X2 Anand Moon
2019-04-01 12:48   ` Krzysztof Kozlowski
2019-04-01 16:20     ` Anand Moon
2019-04-01 12:57   ` Lukasz Majewski
2019-04-01 13:22     ` Jack Mitchell
2019-04-03 19:58   ` Tobias Jakobi
2019-04-04  3:01     ` Anand Moon
2019-04-01 11:52 ` [U-Boot] [RFC 2/6] odroid: exynos: usb clean up for U3/X2 Anand Moon
2019-04-01 12:51   ` Krzysztof Kozlowski
2019-04-01 15:57     ` Anand Moon
2019-04-01 16:12       ` Krzysztof Kozlowski
2019-04-01 11:52 ` Anand Moon [this message]
2019-04-01 12:55   ` [U-Boot] [RFC 3/6] usb: exynos: add init_after_reset for usb reset Krzysztof Kozlowski
2019-04-01 16:05     ` Anand Moon
2019-04-01 16:14       ` Krzysztof Kozlowski
2019-04-01 11:52 ` [U-Boot] [RFC 4/6] configs: exynos: Add new CONFIG_SYS_ODROID_USB config option Anand Moon
2019-04-01 12:57   ` Krzysztof Kozlowski
2019-04-01 15:50     ` Anand Moon
2019-04-01 16:16       ` Krzysztof Kozlowski
2019-04-01 17:16         ` Anand Moon
2019-04-02  7:02           ` Krzysztof Kozlowski
2019-04-02  7:52             ` Anand Moon
2019-04-02  7:56               ` Krzysztof Kozlowski
2019-04-01 11:52 ` [U-Boot] [RFC 5/6] arm: exynos: odroid: fix the confict scripaddr extra env setting Anand Moon
2019-04-01 13:00   ` Krzysztof Kozlowski
2019-04-01 15:43     ` Anand Moon
2019-04-01 11:52 ` [U-Boot] [RFC 6/6] arm: exynos: add usbnet_devaddr setting to env Anand Moon
2019-04-01 13:04   ` Krzysztof Kozlowski
2019-04-01 16:42     ` Anand Moon

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=20190401115232.453-4-linux.amoon@gmail.com \
    --to=linux.amoon@gmail.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