public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] musb: am335x: disable bulk split-combine feature
@ 2013-03-21 15:27 Bin Liu
  2013-03-21 15:27 ` [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG Bin Liu
  2013-04-08 16:56 ` [U-Boot] musb: am335x: disable bulk split-combine feature Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Bin Liu @ 2013-03-21 15:27 UTC (permalink / raw)
  To: u-boot

On TI AM335x devices, MUSB has bulk split/combine feature enabled
in the ConfigData register, but the current MUSB driver does not
support it yet. Therefore, disable the feature for now, until the
driver adds the support.

One usecase which is broken because of this feature is that Ether
gadget stops working in Fullspeed mode (by un-defining
CONFIG_USB_GADGET_DUALSPEED)

After desabled this feature, MUSB driver send packets in proper size
(no more than 64 bytes) in Fullspeed mode.

This has been validated with Ether gadget in Fullspeed mode on AM335x
EVM.

Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/musb-new/musb_core.c |    5 +++++
 include/configs/am335x_evm.h     |    1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c
index 040a5c0..aa647e6 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -1421,6 +1421,7 @@ static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
 		strcat(aInfo, ", dyn FIFOs");
 		musb->dyn_fifo = true;
 	}
+#ifndef CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 	if (reg & MUSB_CONFIGDATA_MPRXE) {
 		strcat(aInfo, ", bulk combine");
 		musb->bulk_combine = true;
@@ -1429,6 +1430,10 @@ static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
 		strcat(aInfo, ", bulk split");
 		musb->bulk_split = true;
 	}
+#else
+	musb->bulk_combine = false;
+	musb->bulk_split = false;
+#endif
 	if (reg & MUSB_CONFIGDATA_HBRXE) {
 		strcat(aInfo, ", HB-ISO Rx");
 		musb->hb_iso_rx = true;
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 74a70ee..faf9581 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -450,6 +450,7 @@
 #define CONFIG_ARCH_MISC_INIT
 #define CONFIG_MUSB_GADGET
 #define CONFIG_MUSB_PIO_ONLY
+#define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_MUSB_HOST
-- 
1.7.9.5

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

* [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG
  2013-03-21 15:27 [U-Boot] [PATCH] musb: am335x: disable bulk split-combine feature Bin Liu
@ 2013-03-21 15:27 ` Bin Liu
  2013-04-08 16:56   ` [U-Boot] " Tom Rini
  2013-04-08 16:56 ` [U-Boot] musb: am335x: disable bulk split-combine feature Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Bin Liu @ 2013-03-21 15:27 UTC (permalink / raw)
  To: u-boot

Do not config MUSB to highspeed mode if CONFIG_USB_GADGET_DUALSPEED
is not set, in which case Ether gadget only operates in fullspeed.

Reviewed-by: Tom Rini <trini@ti.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/musb-new/musb_core.c  |    2 ++
 drivers/usb/musb-new/musb_uboot.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c
index aa647e6..da93571 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -943,7 +943,9 @@ void musb_start(struct musb *musb)
 
 	/* put into basic highspeed mode and start session */
 	musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE
+#ifdef CONFIG_USB_GADGET_DUALSPEED
 						| MUSB_POWER_HSENAB
+#endif
 						/* ENSUSPEND wedges tusb */
 						/* | MUSB_POWER_ENSUSPEND */
 						);
diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c
index 096c4f4..ee3e6c5 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -174,7 +174,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 {
 	int ret;
 
-	if (!driver || driver->speed < USB_SPEED_HIGH || !driver->bind ||
+	if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind ||
 	    !driver->setup) {
 		printf("bad parameter.\n");
 		return -EINVAL;
-- 
1.7.9.5

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

* [U-Boot] musb: am335x: disable bulk split-combine feature
  2013-03-21 15:27 [U-Boot] [PATCH] musb: am335x: disable bulk split-combine feature Bin Liu
  2013-03-21 15:27 ` [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG Bin Liu
@ 2013-04-08 16:56 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2013-04-08 16:56 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 21, 2013 at 05:27:48AM -0000, Bin Liu wrote:

> On TI AM335x devices, MUSB has bulk split/combine feature enabled
> in the ConfigData register, but the current MUSB driver does not
> support it yet. Therefore, disable the feature for now, until the
> driver adds the support.
> 
> One usecase which is broken because of this feature is that Ether
> gadget stops working in Fullspeed mode (by un-defining
> CONFIG_USB_GADGET_DUALSPEED)
> 
> After desabled this feature, MUSB driver send packets in proper size
> (no more than 64 bytes) in Fullspeed mode.
> 
> This has been validated with Ether gadget in Fullspeed mode on AM335x
> EVM.
> 
> Signed-off-by: Bin Liu <b-liu@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130408/8bea7571/attachment.pgp>

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

* [U-Boot] musb: set MUSB speed based on CONFIG
  2013-03-21 15:27 ` [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG Bin Liu
@ 2013-04-08 16:56   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2013-04-08 16:56 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 21, 2013 at 05:27:49AM -0000, Bin Liu wrote:

> Do not config MUSB to highspeed mode if CONFIG_USB_GADGET_DUALSPEED
> is not set, in which case Ether gadget only operates in fullspeed.
> 
> Reviewed-by: Tom Rini <trini@ti.com>
> Signed-off-by: Bin Liu <b-liu@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130408/1a2deced/attachment.pgp>

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

end of thread, other threads:[~2013-04-08 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 15:27 [U-Boot] [PATCH] musb: am335x: disable bulk split-combine feature Bin Liu
2013-03-21 15:27 ` [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG Bin Liu
2013-04-08 16:56   ` [U-Boot] " Tom Rini
2013-04-08 16:56 ` [U-Boot] musb: am335x: disable bulk split-combine feature Tom Rini

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