Patchwork [U-Boot,v4,1/5] EHCI: add callback ehci_fixup

login
register
mail settings
Submitter Jana Rapava
Date Sept. 25, 2011, 11:55 a.m.
Message ID <1316951758-2235-1-git-send-email-fermata7@gmail.com>
Download mbox | patch
Permalink /patch/116277/
State Superseded
Headers show

Comments

Jana Rapava - Sept. 25, 2011, 11:55 a.m.
EHCI: add callback ehci_fixup to solve VBUS reset
issue for Efika.

Signed-off-by: Jana Rapava <fermata7@gmail.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Stefano Babic <sbabic@denx.de>
---
Changes for v2:
       - changed to proper patch
Changes for v3:
       - merged other USB patches from u-boot-pxa/efikasb
       - offset-based access changed to struct-based access
       - use {clrset,clr,set}bits_le32() calls
       - CodingStyle and naming cleanup
Changes for v4:
	- split into patchset
	- add callback ehci_fixup

 drivers/usb/host/ehci-hcd.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
Marek Vasut - Sept. 25, 2011, 12:02 p.m.
On Sunday, September 25, 2011 01:55:54 PM Jana Rapava wrote:
> EHCI: add callback ehci_fixup to solve VBUS reset
> issue for Efika.
> 
> Signed-off-by: Jana Rapava <fermata7@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Remy Bohmer <linux@bohmer.net>
> Cc: Stefano Babic <sbabic@denx.de>

5/5 is missing ... ok, I'm not reviewing this until correctly submitted.

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2197119..f420279 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -26,6 +26,7 @@ 
 #include <asm/io.h>
 #include <malloc.h>
 #include <watchdog.h>
+#include <usb/ehci-fsl.h>
 
 #include "ehci.h"
 
@@ -536,6 +537,14 @@  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);
+}
+
+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,8 +718,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);
-				/* terminate the reset */
+				ehci_fixup(status_reg, &reg);
 				ehci_writel(status_reg, reg & ~EHCI_PS_PR);
 				/*
 				 * A host controller must terminate the reset