diff mbox

[U-Boot] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

Message ID 1411954514-18549-1-git-send-email-eric.nelson@boundarydevices.com
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Eric Nelson Sept. 29, 2014, 1:35 a.m. UTC
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(+)

Comments

Felipe Balbi Sept. 29, 2014, 2:01 p.m. UTC | #1
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>
Marek Vasut Sept. 29, 2014, 2:43 p.m. UTC | #2
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
Eric Nelson Sept. 29, 2014, 5:04 p.m. UTC | #3
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
Marek Vasut Sept. 29, 2014, 10:59 p.m. UTC | #4
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
diff mbox

Patch

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 */