public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED
@ 2014-09-28 19:12 Eric Nelson
  2014-09-28 20:28 ` Marek Vasut
  2014-09-29  0:36 ` [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED Eric Nelson
  0 siblings, 2 replies; 11+ messages in thread
From: Eric Nelson @ 2014-09-28 19:12 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED
  2014-09-28 19:12 [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED Eric Nelson
@ 2014-09-28 20:28 ` Marek Vasut
  2014-09-28 22:01   ` Eric Nelson
  2014-09-29  0:36 ` [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED Eric Nelson
  1 sibling, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2014-09-28 20:28 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED
  2014-09-28 20:28 ` Marek Vasut
@ 2014-09-28 22:01   ` Eric Nelson
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Nelson @ 2014-09-28 22:01 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-28 19:12 [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED Eric Nelson
  2014-09-28 20:28 ` Marek Vasut
@ 2014-09-29  0:36 ` Eric Nelson
  2014-09-29  1:21   ` Felipe Balbi
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Nelson @ 2014-09-29  0:36 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29  0:36 ` [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED Eric Nelson
@ 2014-09-29  1:21   ` Felipe Balbi
  2014-09-29  1:30     ` Eric Nelson
  2014-09-29  1:35     ` [U-Boot] [PATCH] " Eric Nelson
  0 siblings, 2 replies; 11+ messages in thread
From: Felipe Balbi @ 2014-09-29  1:21 UTC (permalink / raw)
  To: u-boot

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 ?

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140928/0effd476/attachment.pgp>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29  1:21   ` Felipe Balbi
@ 2014-09-29  1:30     ` Eric Nelson
  2014-09-29  1:35     ` [U-Boot] [PATCH] " Eric Nelson
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Nelson @ 2014-09-29  1:30 UTC (permalink / raw)
  To: u-boot

-----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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUKLZJAAoJEFUqXmm9AiVrK9gH/0XPpea8XDasyCtElV3WolzP
C4RaqGrL6iRL2haiuY4zhIHv3KMxg+1L2P6rGrbYFn7+15mNhSMwqkSleRcDL8bw
47j5snivpd0BEnznC+dIzc/vghJ+gpkZdwmnRsfAvfGN+PWV1jNJUSR+jFkzTS6F
19rp2TIoIR9XgFx9chHmluI1iWp39yXTFhgqXLoLLMYMR0qXKTp8TV7asXvWLBsw
+Rrlqf58j3rEmhBA8zNDIbDJe/aQDKbxHcZrK386n2izBK3fZqf4Ew2Pln8vSToU
jHLnEwUp0PoeolUg1EK3oAlitNnwE7GLxxEoxsA/v7KaLzyUoR/c4wpG5/pIu2A=
=Hdj5
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29  1:21   ` Felipe Balbi
  2014-09-29  1:30     ` Eric Nelson
@ 2014-09-29  1:35     ` Eric Nelson
  2014-09-29 14:01       ` Felipe Balbi
  2014-09-29 22:59       ` Marek Vasut
  1 sibling, 2 replies; 11+ messages in thread
From: Eric Nelson @ 2014-09-29  1:35 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29  1:35     ` [U-Boot] [PATCH] " Eric Nelson
@ 2014-09-29 14:01       ` Felipe Balbi
  2014-09-29 14:43         ` Marek Vasut
  2014-09-29 22:59       ` Marek Vasut
  1 sibling, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2014-09-29 14:01 UTC (permalink / raw)
  To: u-boot

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>

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140929/301c63b1/attachment.pgp>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29 14:01       ` Felipe Balbi
@ 2014-09-29 14:43         ` Marek Vasut
  2014-09-29 17:04           ` Eric Nelson
  0 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2014-09-29 14:43 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29 14:43         ` Marek Vasut
@ 2014-09-29 17:04           ` Eric Nelson
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Nelson @ 2014-09-29 17:04 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED
  2014-09-29  1:35     ` [U-Boot] [PATCH] " Eric Nelson
  2014-09-29 14:01       ` Felipe Balbi
@ 2014-09-29 22:59       ` Marek Vasut
  1 sibling, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2014-09-29 22:59 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-09-29 22:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28 19:12 [U-Boot] [PATCH] ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED Eric Nelson
2014-09-28 20:28 ` Marek Vasut
2014-09-28 22:01   ` Eric Nelson
2014-09-29  0:36 ` [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED Eric Nelson
2014-09-29  1:21   ` Felipe Balbi
2014-09-29  1:30     ` Eric Nelson
2014-09-29  1:35     ` [U-Boot] [PATCH] " Eric Nelson
2014-09-29 14:01       ` Felipe Balbi
2014-09-29 14:43         ` Marek Vasut
2014-09-29 17:04           ` Eric Nelson
2014-09-29 22:59       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox