[U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED

Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com --- drivers/usb/gadget/ci_udc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..9f2fd15 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6) + /* force full-speed mode */ + writel(readl(&udc->portsc)|(1<<24), &udc->portsc); +#endif + writel(0xffffffff, &udc->epflush);
/* Turn on the USB connection by enabling the pullup resistor */

On Sunday, September 28, 2014 at 09:12:35 PM, Eric Nelson wrote:
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
drivers/usb/gadget/ci_udc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..9f2fd15 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6)
/* force full-speed mode */
writel(readl(&udc->portsc)|(1<<24), &udc->portsc);
+#endif
setbits_le32() and I'm sure you know better than to use 1 << 24 . Please define that bit proper. And you also know you should supply a commit message, right ?
writel(0xffffffff, &udc->epflush); /* Turn on the USB connection by enabling the pullup resistor */
Best regards, Marek Vasut

Hi Marek,
On 09/28/2014 01:28 PM, Marek Vasut wrote:
On Sunday, September 28, 2014 at 09:12:35 PM, Eric Nelson wrote:
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
drivers/usb/gadget/ci_udc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..9f2fd15 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6)
/* force full-speed mode */
writel(readl(&udc->portsc)|(1<<24), &udc->portsc);
+#endif
setbits_le32() and I'm sure you know better than to use 1 << 24 . Please define that bit proper.
Yep. Will do.
And you also know you should supply a commit message, right ?
I'll give it another shot in V2.
writel(0xffffffff, &udc->epflush); /* Turn on the USB connection by enabling the pullup resistor */
Regards,
Eric

Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com --- drivers/usb/gadget/ci_udc.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..dbbeff7 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -766,6 +766,7 @@ void udc_disconnect(void)
static int ci_pullup(struct usb_gadget *gadget, int is_on) { + u32 regval; struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor; if (is_on) { /* RESET */ @@ -777,6 +778,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6) + /* Port force Full-Speed Connect */ + setbits_le32(&udc->portsc, PFSC); +#endif + writel(0xffffffff, &udc->epflush);
/* Turn on the USB connection by enabling the pullup resistor */

On Sun, Sep 28, 2014 at 05:36:56PM -0700, Eric Nelson wrote:
@@ -777,6 +778,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6)
why only MX6 ?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 09/28/2014 06:21 PM, Felipe Balbi wrote:
On Sun, Sep 28, 2014 at 05:36:56PM -0700, Eric Nelson wrote:
@@ -777,6 +778,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6)
why only MX6 ?
This shouldn't be the case. I'll fix in V3.
I also just noticed an extraneous variable declaration.

Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com --- V2 uses PFSC constant, setbits_le32, and expands commit message V3 removes restriction on i.MX6 and extraneous declaration
drivers/usb/gadget/ci_udc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..b0ef35e 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode);
+#if !defined(CONFIG_USB_GADGET_DUALSPEED) + /* Port force Full-Speed Connect */ + setbits_le32(&udc->portsc, PFSC); +#endif + writel(0xffffffff, &udc->epflush);
/* Turn on the USB connection by enabling the pullup resistor */

On Sun, Sep 28, 2014 at 06:35:14PM -0700, Eric Nelson wrote:
Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
Reviewed-by: Felipe Balbi balbi@ti.com

On Monday, September 29, 2014 at 04:01:19 PM, Felipe Balbi wrote:
On Sun, Sep 28, 2014 at 06:35:14PM -0700, Eric Nelson wrote:
Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
Reviewed-by: Felipe Balbi balbi@ti.com
Acked-by: Marek Vasut marex@denx.de
This looks good indeed
Best regards, Marek Vasut

Thanks Marek and Felipe,
On 09/29/2014 07:43 AM, Marek Vasut wrote:
On Monday, September 29, 2014 at 04:01:19 PM, Felipe Balbi wrote:
On Sun, Sep 28, 2014 at 06:35:14PM -0700, Eric Nelson wrote:
Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
Reviewed-by: Felipe Balbi balbi@ti.com
Acked-by: Marek Vasut marex@denx.de
This looks good indeed
We've found that it comes in handy, especially in prototypes of SOM carrier boards, where the USB signals tend to take some twisty routes.
Regards,
Eric

On Monday, September 29, 2014 at 03:35:14 AM, Eric Nelson wrote:
Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined.
The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation.
Signed-off-by: Eric Nelson eric.nelson@boundarydevices.com
V2 uses PFSC constant, setbits_le32, and expands commit message V3 removes restriction on i.MX6 and extraneous declaration
Applied, thanks.
Best regards, Marek Vasut
participants (3)
-
Eric Nelson
-
Felipe Balbi
-
Marek Vasut