[U-Boot] [PATCH 4/5] dm: usb: Add more debugging in ehci-hcd.c

Simon Glass sjg at chromium.org
Sat Apr 18 19:33:46 CEST 2015


Add some debugging to detect init failure.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/usb/host/ehci-hcd.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bd9861d..066e7c5 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1140,26 +1140,34 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
 	ctrl->ops = default_ehci_ops;
 
 	rc = ehci_hcd_init(index, init, &ctrl->hccr, &ctrl->hcor);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_hcd_init failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 	if (init == USB_INIT_DEVICE)
 		goto done;
 
 	/* EHCI spec section 4.1 */
-	if (ehci_reset(ctrl))
+	if (ehci_reset(ctrl)) {
+		debug("%s: ehci_reset failed\n", __func__);
 		return -1;
+	}
 
 #if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
 	rc = ehci_hcd_init(index, init, &ctrl->hccr, &ctrl->hcor);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_hcd_init2 failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 #endif
 #ifdef CONFIG_USB_EHCI_FARADAY
 	tweaks |= EHCI_TWEAK_NO_INIT_CF;
 #endif
 	rc = ehci_common_init(ctrl, tweaks);
-	if (rc)
+	if (rc) {
+		debug("%s: ehci_common_init failed, rc=%d\n", __func__, rc);
 		return rc;
+	}
 
 	ctrl->rootdev = 0;
 done:
-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list