[U-Boot] [PATCH v7 2/4] EHCI: add callback ehci_fixup

Jana Rapava fermata7 at gmail.com
Wed Sep 28 00:21:16 CEST 2011


Add callback to ehci_fixup to prepare
for solving the problem with VBUS reset on Efika.

Signed-off-by: Jana Rapava <fermata7 at gmail.com>
Cc: Marek Vasut <marek.vasut at gmail.com>
Cc: Remy Bohmer <linux at bohmer.net>
Cc: Stefano Babic <sbabic at denx.de>
---
Changes for v1:
    - split into patchset
    - add callback ehci_fixup
Changes for v2:
      - make this the second patch in series
      - add comment to alias ehci_fixup
Changes for v3:
       - make the comment a sentence
       - rebase patch on top of u-boot-imx/next
Changes for v4:
	- change the versioning of changelog
	from per patchset to per patch
	- fix the appearance of comment

 drivers/usb/host/ehci-hcd.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bdadd46..ef0c578 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -536,6 +536,17 @@ static inline int min3(int a, int b, int c)
 	return a;
 }
 
+inline void __ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+{
+	wait_ms(50);
+}
+/*
+ * this function will alias to __ehci_fixup,
+ * unless function ehci_fixup is defined somewhere
+ */
+void ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+	 __attribute__((weak, alias("__ehci_fixup")));
+
 int
 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 		 int length, struct devrequest *req)
@@ -709,7 +720,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 				 * usb 2.0 specification say 50 ms resets on
 				 * root
 				 */
-				wait_ms(50);
+				ehci_fixup(status_reg, &reg);
 				/* terminate the reset */
 				ehci_writel(status_reg, reg & ~EHCI_PS_PR);
 				/*
-- 
1.7.6.3



More information about the U-Boot mailing list