Patchwork [U-Boot,v5,2/4] EHCI: add callback ehci_fixup

login
register
mail settings
Submitter Jana Rapava
Date Sept. 27, 2011, 11:01 a.m.
Message ID <1317121296-17328-1-git-send-email-fermata7@gmail.com>
Download mbox | patch
Permalink /patch/116576/
State Changes Requested
Headers show

Comments

Jana Rapava - Sept. 27, 2011, 11:01 a.m.
Add callback to ehci_fixup to prepare
for solving the problem with VBUS reset on 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
Changes for v5:
	- reorder the patches
	- add coments

 drivers/usb/host/ehci-hcd.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
Marek Vasut - Sept. 27, 2011, 11:23 a.m.
On Tuesday, September 27, 2011 01:01:34 PM Jana Rapava wrote:
> Add callback to ehci_fixup to prepare
> for solving the problem with VBUS reset on 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
> Changes for v5:
> 	- reorder the patches
> 	- add coments

Dear Jana Rapava,

what's the _EXACT_ change in this patch since the last revision? I see you're 
adding the changes for whole patchset, not for each single patch, that's wrong.

> 
>  drivers/usb/host/ehci-hcd.c |   14 +++++++++++++-
>  1 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index bdadd46..2030a40 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>

Do you need this change ?

> 
>  #include <usb/ehci.h>
> 
> @@ -536,6 +537,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
> +*/

This comment is wrong, it should start on next line:

/*
 * comment ...
 */
> +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 +721,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);
>  				/*

Cheers
Jana Rapava - Sept. 27, 2011, 11:42 a.m.
> what's the _EXACT_ change in this patch since the last revision? I see
> you're
> adding the changes for whole patchset, not for each single patch, that's
> wrong.
>
> In this changelog are only changes, which touches this single patch and
reordering all patches in this patchset is one of them. When I repost this
patch, I'll try to express this more clearly.
Thanks for your comments.

Cheers,
Jana Rapava

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bdadd46..2030a40 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 <usb/ehci.h>
 
@@ -536,6 +537,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 +721,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);
 				/*