Skip to contentSkip to conversation

ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED

PATCH New Eric Nelson 3 participants 11 messages Sep 28, 2014 – Sep 29, 2014 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED

---
 drivers/usb/gadget/ci_udc.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/gadget/ci_udc.c +5 -0
index 2572b34..9f2fd15 100644
@@ -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 */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED

Quoted 11 lines · Eric Nelson
---
 drivers/usb/gadget/ci_udc.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/gadget/ci_udc.c +0 -0
index 2572b34..9f2fd15 100644
@@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int

is_on) /* select DEVICE mode */

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 784

Quoted 7 lines
drivers/usb/gadget/ci_udc.c +5 -0
 		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 ?

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 787

Quoted 3 lines
drivers/usb/gadget/ci_udc.c +0 -0
 		writel(0xffffffff, &udc->epflush);
 
 		/* Turn on the USB connection by enabling the pullup resistor */

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 ci_udc: force full-speed operation if !CONFIG_USB_GADGET_DUALSPEED

Hi Marek,

Quoted 14 lines · Marek Vasut
Quoted 13 lines · Eric Nelson
---
 drivers/usb/gadget/ci_udc.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/gadget/ci_udc.c +0 -0
index 2572b34..9f2fd15 100644
@@ -777,6 +777,11 @@ static int ci_pullup(struct usb_gadget *gadget, int

is_on) /* select DEVICE mode */
writel(USBMODE_DEVICE, &udc->usbmode);

Quoted 9 lines

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 784

Quoted 5 lines
drivers/usb/gadget/ci_udc.c +5 -0
+#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.

Quoted 3 lines

And you also know you should supply a commit message, right ?

I'll give it another shot in V2.

Quoted 4 lines

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 787

Quoted 3 lines
drivers/usb/gadget/ci_udc.c +0 -0
 		writel(0xffffffff, &udc->epflush);
 
 		/* Turn on the USB connection by enabling the pullup resistor */

Regards,

Eric

#3 lore raw

PATCH v2 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

In reply to Eric Nelson

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.

---
 drivers/usb/gadget/ci_udc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/gadget/ci_udc.c +6 -0
index 2572b34..dbbeff7 100644
@@ -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 */
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 781

Quoted 5 lines · Eric Nelson
drivers/usb/gadget/ci_udc.c +1 -0
@@ -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 ?

Signature · 8 lines
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>
#5 lore raw

PATCH v2 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Felipe Balbi

Review static int ci_pullup(struct usb_gadget · line 782

Quoted 6 lines · Eric Nelson
(quoted diff) +1 -0
@@ -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-----

#6 lore raw

PATCH 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

In reply to Felipe Balbi

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.

---
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(+)
drivers/usb/gadget/ci_udc.c +5 -0
index 2572b34..b0ef35e 100644
@@ -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 */
Signature · 1 line
1.9.1
#7 lore raw

PATCH 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

Quoted 7 lines · Eric Nelson

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.

Signature · 8 lines
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>
#8 lore raw

PATCH 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

Quoted 10 lines · Felipe Balbi
Quoted 7 lines · Eric Nelson

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.

This looks good indeed

Best regards,
Marek Vasut

#9 lore raw

PATCH 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

Thanks Marek and Felipe,

Quoted 8 lines · Marek Vasut
Quoted 7 lines · Felipe Balbi
Quoted 6 lines · Eric Nelson

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.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

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

Applied
#10 lore raw

PATCH 1/1 usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED

In reply to Eric Nelson
Quoted 10 lines · Eric Nelson

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.

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