All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings
@ 2009-09-16 23:38 Mike Frysinger
  2009-09-16 23:38 ` [PATCH 02/11] USB: musb: kill compile warning for Blackfin systems Mike Frysinger
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Bryan Wu, Cliff Cai

Otherwise gcc will whine about epnum/dma_reg being unused when building
for BF54x parts.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index f2f66eb..80c765e 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
 	void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
 	u8 epnum = hw_ep->epnum;
 	u16 dma_reg = 0;
 
-	DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
-			'R', hw_ep->epnum, fifo, len, dst);
-
-#ifdef CONFIG_BF52x
 	invalidate_dcache_range((unsigned int)dst,
 		(unsigned int)(dst + len));
 
@@ -103,6 +101,9 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 			len & 0x01 ? (len >> 1) + 1 : len >> 1);
 #endif
 
+	DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
+			'R', hw_ep->epnum, fifo, len, dst);
+
 	dump_fifo_data(dst, len);
 }
 
-- 
1.6.5.rc1


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

* [PATCH 02/11] USB: musb: kill compile warning for Blackfin systems
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 03/11] USB: musb: kill some useless comments in Blackfin driver Mike Frysinger
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi; +Cc: linux-kernel, uclinux-dist-devel, Bryan Wu

From: Bryan Wu <cooloney@kernel.org>

The Blackfin version of musb_read_target_reg_base() returns a u16 when the
common code expects a (void __iomem *), so update the Blackfin function to
return the right value.  This fixes the compile warning:

drivers/usb/musb/musb_core.c: In function 'musb_core_init':
drivers/usb/musb/musb_core.c:1448: warning: assignment makes pointer from
	integer without a cast

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/musb_regs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index fbfd3fd..0154e38 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -474,9 +474,9 @@ static inline u16 musb_read_hwvers(void __iomem *mbase)
 	return 0;
 }
 
-static inline u16 musb_read_target_reg_base(u8 i, void __iomem *mbase)
+static inline void __iomem *musb_read_target_reg_base(u8 i, void __iomem *mbase)
 {
-	return 0;
+	return NULL;
 }
 
 static inline void musb_write_rxfunaddr(void __iomem *ep_target_regs,
-- 
1.6.5.rc1


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

* [PATCH 03/11] USB: musb: kill some useless comments in Blackfin driver
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
  2009-09-16 23:38 ` [PATCH 02/11] USB: musb: kill compile warning for Blackfin systems Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 04/11] USB: musb: update Blackfin processor dependency Mike Frysinger
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Bryan Wu, Cliff Cai

From: Bryan Wu <cooloney@kernel.org>

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/blackfin.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 80c765e..bbee5f6 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -263,10 +263,6 @@ int __init musb_platform_init(struct musb *musb)
 		SSYNC();
 	}
 
-	/* TODO
-	 * Set SIC-IVG register
-	 */
-
 	/* Configure PLL oscillator register */
 	bfin_write_USB_PLLOSC_CTRL(0x30a8);
 	SSYNC();
-- 
1.6.5.rc1


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

* [PATCH 04/11] USB: musb: update Blackfin processor dependency
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
  2009-09-16 23:38 ` [PATCH 02/11] USB: musb: kill compile warning for Blackfin systems Mike Frysinger
  2009-09-16 23:38 ` [PATCH 03/11] USB: musb: kill some useless comments in Blackfin driver Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 05/11] USB: musb: add notes for Blackfin anomalies Mike Frysinger
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Sonic Zhang, Bryan Wu, Cliff Cai

From: Sonic Zhang <sonic.zhang@analog.com>

Do not allow MUSB driver to be selected on derivatives that don't have the
MUSB controller on them.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 803adcb..2fb3216 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -10,6 +10,7 @@ comment "Enable Host or Gadget support to see Inventra options"
 config USB_MUSB_HDRC
 	depends on (USB || USB_GADGET) && HAVE_CLK
 	depends on !SUPERH
+	depends on !BLACKFIN || (BF54x && !BF544) || (BF52x && !BF522 && !BF523)
 	select NOP_USB_XCEIV if ARCH_DAVINCI
 	select TWL4030_USB if MACH_OMAP_3430SDP
 	select NOP_USB_XCEIV if MACH_OMAP3EVM
-- 
1.6.5.rc1


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

* [PATCH 05/11] USB: musb: add notes for Blackfin anomalies
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (2 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 04/11] USB: musb: update Blackfin processor dependency Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-17 12:33   ` Sergei Shtylyov
  2009-09-16 23:38 ` [PATCH 06/11] USB: musb: add work around for Blackfin anomaly 05000456 Mike Frysinger
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Sonic Zhang, Cliff Cai

From: Sonic Zhang <sonic.zhang@analog.com>

Add some helpful notes about how the driver works around different
anomalies that exist in the on-chip host controller.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/blackfin.h |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/blackfin.h b/drivers/usb/musb/blackfin.h
index a240c1e..de62962 100644
--- a/drivers/usb/musb/blackfin.h
+++ b/drivers/usb/musb/blackfin.h
@@ -14,6 +14,35 @@
  * Blackfin specific definitions
  */
 
+/* Anomalies notes:
+ *
+ *  05000450 - USB DMA Mode 1 Short Packet Data Corruption:
+ *             MUSB driver is designed to transfer buffer of N * maxpacket size
+ *             in DMA mode 1 and leave rest data to the next transfer in DMA
+ *             mode 0, so we never transmit a short packet in DMA mode 1.
+ *
+ *  05000463 - This anomaly doesn't affect this driver,Since it
+ *             never uses L1 or L2 memory as data destination.
+ *
+ *  05000464 - This anomaly doesn't affect this driver,Since it
+ *             never uses L1 or L2 memory as data source.
+ *
+ *  05000465 - Actually,the anomaly still can be seen when SCLK
+ *             is over 100 MHz,and there is no way to workaround
+ *             for bulk endpoints,because the wMaxPackSize of bulk
+ *             is less than or equal to 512,while the fifo size of
+ *             endpoint 5,6,7 is 1024,the double buffer mode is
+ *             enabled automatically when these endpoints are used
+ *             for bulk OUT.
+ *
+ *  05000466 - This anomaly doesn't affect this driver,Since it
+ *             never mixs concurrent DMA and core accesses to the
+ *             TX endpoint FIFOs.
+ *
+ *  05000467 - The workaround for this anomaly will introduce another
+ *             anomaly - 05000465.
+ */
+
 #undef DUMP_FIFO_DATA
 #ifdef DUMP_FIFO_DATA
 static void dump_fifo_data(u8 *buf, u16 len)
-- 
1.6.5.rc1


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

* [PATCH 06/11] USB: musb: add work around for Blackfin anomaly 05000456
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (3 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 05/11] USB: musb: add notes for Blackfin anomalies Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 07/11] USB: musb: fix musb_platform_set_mode() definition Mike Frysinger
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Sonic Zhang, Cliff Cai

From: Sonic Zhang <sonic.zhang@analog.com>

Only allow USE_MODE1 when the Blackfin part is not affected by anomaly
05000456 (USB Receive Interrupt Is Not Generated in DMA Mode 1) since we
can't support the mode in that case.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/musb_dma.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h
index 0a2c4e3..916065b 100644
--- a/drivers/usb/musb/musb_dma.h
+++ b/drivers/usb/musb/musb_dma.h
@@ -80,6 +80,17 @@ struct musb_hw_ep;
 #define tusb_dma_omap()			0
 #endif
 
+/* Anomaly 05000456 - USB Receive Interrupt Is Not Generated in DMA Mode 1
+ *	Only allow DMA mode 1 to be used when the USB will actually generate the
+ *	interrupts we expect.
+ */
+#ifdef CONFIG_BLACKFIN
+# undef USE_MODE1
+# if !ANOMALY_05000456
+#  define USE_MODE1
+# endif
+#endif
+
 /*
  * DMA channel status ... updated by the dma controller driver whenever that
  * status changes, and protected by the overall controller spinlock.
-- 
1.6.5.rc1


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

* [PATCH 07/11] USB: musb: fix musb_platform_set_mode() definition
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (4 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 06/11] USB: musb: add work around for Blackfin anomaly 05000456 Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 08/11] USB: musb: clear the Blackfin interrupt pending bits early in the ISR Mike Frysinger
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Bryan Wu, Cliff Cai

From: Bryan Wu <cooloney@kernel.org>

Update function definition to match latest MUSB framework.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/blackfin.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index bbee5f6..db099e2 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -227,8 +227,9 @@ int musb_platform_get_vbus_status(struct musb *musb)
 	return 0;
 }
 
-void musb_platform_set_mode(struct musb *musb, u8 musb_mode)
+int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 {
+	return -EIO;
 }
 
 int __init musb_platform_init(struct musb *musb)
-- 
1.6.5.rc1


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

* [PATCH 08/11] USB: musb: clear the Blackfin interrupt pending bits early in the ISR
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (5 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 07/11] USB: musb: fix musb_platform_set_mode() definition Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 09/11] USB: musb: error out when anomaly 05000380 is applicable Mike Frysinger
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi; +Cc: linux-kernel, uclinux-dist-devel, Cliff Cai

From: Cliff Cai <cliff.cai@analog.com>

If we clear the interrupt pending bits at the end, we sometimes return too
fast and have the same interrupt assert itself.  There is no way in a
Blackfin system to force a sync of this state, so the hardware manual
instructs people to clear interrupt flags early in their ISR.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/musbhsdma.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index 5e83f96..c767387 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -259,6 +259,11 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
 	if (!int_hsdma)
 		goto done;
 
+#ifdef CONFIG_BLACKFIN
+	/* Clear DMA interrupt flags */
+	musb_writeb(mbase, MUSB_HSDMA_INTR, int_hsdma);
+#endif
+
 	for (bchannel = 0; bchannel < MUSB_HSDMA_CHANNELS; bchannel++) {
 		if (int_hsdma & (1 << bchannel)) {
 			musb_channel = (struct musb_dma_channel *)
@@ -324,11 +329,6 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
 		}
 	}
 
-#ifdef CONFIG_BLACKFIN
-	/* Clear DMA interrup flags */
-	musb_writeb(mbase, MUSB_HSDMA_INTR, int_hsdma);
-#endif
-
 	retval = IRQ_HANDLED;
 done:
 	spin_unlock_irqrestore(&musb->lock, flags);
-- 
1.6.5.rc1


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

* [PATCH 09/11] USB: musb: error out when anomaly 05000380 is applicable
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (6 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 08/11] USB: musb: clear the Blackfin interrupt pending bits early in the ISR Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 10/11] USB: musb: Blackfin code needs NOP_USB_XCEIV too Mike Frysinger
  2009-09-16 23:38 ` [PATCH 11/11] USB: musb: fix printf warning in debug code Mike Frysinger
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi; +Cc: linux-kernel, uclinux-dist-devel, Sonic Zhang

From: Sonic Zhang <sonic.zhang@analog.com>

Since we can't work around anomaly 05000380, throw a build error up and
instruct the user to use a different mode.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/blackfin.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/blackfin.h b/drivers/usb/musb/blackfin.h
index de62962..21b7730 100644
--- a/drivers/usb/musb/blackfin.h
+++ b/drivers/usb/musb/blackfin.h
@@ -43,6 +43,16 @@
  *             anomaly - 05000465.
  */
 
+/* The Mentor USB DMA engine on BF52x (silicon v0.0 and v0.1) seems to be
+ * unstable in host mode.  This may be caused by Anomaly 05000380.  After
+ * digging out the root cause, we will change this number accordingly.
+ * So, need to either use silicon v0.2+ or disable DMA mode in MUSB.
+ */
+#if ANOMALY_05000380 && defined(CONFIG_BF52x) && \
+    defined(CONFIG_USB_MUSB_HDRC) && !defined(CONFIG_MUSB_PIO_ONLY)
+# error "Please use PIO mode in MUSB driver on bf52x chip v0.0 and v0.1"
+#endif
+
 #undef DUMP_FIFO_DATA
 #ifdef DUMP_FIFO_DATA
 static void dump_fifo_data(u8 *buf, u16 len)
-- 
1.6.5.rc1


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

* [PATCH 10/11] USB: musb: Blackfin code needs NOP_USB_XCEIV too
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (7 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 09/11] USB: musb: error out when anomaly 05000380 is applicable Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  2009-09-16 23:38 ` [PATCH 11/11] USB: musb: fix printf warning in debug code Mike Frysinger
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi; +Cc: linux-kernel, uclinux-dist-devel, Cliff Cai

From: Cliff Cai <cliff.cai@analog.com>

Otherwise we get the link failure:
drivers/built-in.o: In function 'musb_platform_init':
drivers/usb/musb/blackfin.c:300: undefined reference to 'usb_nop_xceiv_register'
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/Kconfig |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 2fb3216..06135a1 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -11,9 +11,8 @@ config USB_MUSB_HDRC
 	depends on (USB || USB_GADGET) && HAVE_CLK
 	depends on !SUPERH
 	depends on !BLACKFIN || (BF54x && !BF544) || (BF52x && !BF522 && !BF523)
-	select NOP_USB_XCEIV if ARCH_DAVINCI
+	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
 	select TWL4030_USB if MACH_OMAP_3430SDP
-	select NOP_USB_XCEIV if MACH_OMAP3EVM
 	select USB_OTG_UTILS
 	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
 	help
-- 
1.6.5.rc1


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

* [PATCH 11/11] USB: musb: fix printf warning in debug code
  2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
                   ` (8 preceding siblings ...)
  2009-09-16 23:38 ` [PATCH 10/11] USB: musb: Blackfin code needs NOP_USB_XCEIV too Mike Frysinger
@ 2009-09-16 23:38 ` Mike Frysinger
  9 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-16 23:38 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi; +Cc: linux-kernel, uclinux-dist-devel

The debug code in the DMA ISR uses a %d for a size_t when it should be
using %zu.  Otherwise gcc whines with:

drivers/usb/musb/musbhsdma.c: In function 'dma_controller_irq':
drivers/usb/musb/musbhsdma.c:288: warning: format '%d' expects type 'int',
	but argument 7 has type 'size_t'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/musbhsdma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index c767387..a237550 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -285,7 +285,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
 				channel->actual_len = addr
 					- musb_channel->start_addr;
 
-				DBG(2, "ch %p, 0x%x -> 0x%x (%d / %d) %s\n",
+				DBG(2, "ch %p, 0x%x -> 0x%x (%zu / %d) %s\n",
 					channel, musb_channel->start_addr,
 					addr, channel->actual_len,
 					musb_channel->len,
-- 
1.6.5.rc1


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

* Re: [PATCH 05/11] USB: musb: add notes for Blackfin anomalies
  2009-09-16 23:38 ` [PATCH 05/11] USB: musb: add notes for Blackfin anomalies Mike Frysinger
@ 2009-09-17 12:33   ` Sergei Shtylyov
  2009-09-17 16:25     ` [PATCH 05/12 v2] " Mike Frysinger
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2009-09-17 12:33 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: linux-usb, Felipe Balbi, linux-kernel, uclinux-dist-devel,
	Sonic Zhang, Cliff Cai

Hello.

Mike Frysinger wrote:

> From: Sonic Zhang <sonic.zhang@analog.com>

> Add some helpful notes about how the driver works around different
> anomalies that exist in the on-chip host controller.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> Signed-off-by: Cliff Cai <cliff.cai@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

    Grammar and style nipicking follows... :-)

> diff --git a/drivers/usb/musb/blackfin.h b/drivers/usb/musb/blackfin.h
> index a240c1e..de62962 100644
> --- a/drivers/usb/musb/blackfin.h
> +++ b/drivers/usb/musb/blackfin.h
> @@ -14,6 +14,35 @@
>   * Blackfin specific definitions
>   */
>  
> +/* Anomalies notes:
> + *
> + *  05000450 - USB DMA Mode 1 Short Packet Data Corruption:
> + *             MUSB driver is designed to transfer buffer of N * maxpacket size
> + *             in DMA mode 1 and leave rest data to the next transfer in DMA
> + *             mode 0, so we never transmit a short packet in DMA mode 1.
> + *
> + *  05000463 - This anomaly doesn't affect this driver,Since it

    No comma needed here, and why capitalize "since"?

> + *             never uses L1 or L2 memory as data destination.
> + *
> + *  05000464 - This anomaly doesn't affect this driver,Since it

    Same here...

> + *             never uses L1 or L2 memory as data source.
> + *
> + *  05000465 - Actually,the anomaly still can be seen when SCLK
> + *             is over 100 MHz,and there is no way to workaround
> + *             for bulk endpoints,because the wMaxPackSize of bulk
> + *             is less than or equal to 512,while the fifo size of

    Shouldn't there be spaces after commas?

> + *             endpoint 5,6,7 is 1024,the double buffer mode is

    Either comma doesn't fit here, or "so" is needed after it...

> + *             enabled automatically when these endpoints are used
> + *             for bulk OUT.
> + *
> + *  05000466 - This anomaly doesn't affect this driver,Since it

    No comma or uppercase needed...

> + *             never mixs concurrent DMA and core accesses to the

    "Mixes"...

> + *             TX endpoint FIFOs.

WBR, Sergei

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

* [PATCH 05/12 v2] USB: musb: add notes for Blackfin anomalies
  2009-09-17 12:33   ` Sergei Shtylyov
@ 2009-09-17 16:25     ` Mike Frysinger
  0 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2009-09-17 16:25 UTC (permalink / raw)
  To: linux-usb, Felipe Balbi
  Cc: linux-kernel, uclinux-dist-devel, Sonic Zhang, Cliff Cai

From: Sonic Zhang <sonic.zhang@analog.com>

Add some helpful notes about how the driver works around different
anomalies that exist in the on-chip host controller.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
	- clean up grammar pointed out by Sergei Shtylyov

 drivers/usb/musb/blackfin.h |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/blackfin.h b/drivers/usb/musb/blackfin.h
index a240c1e..b49a362 100644
--- a/drivers/usb/musb/blackfin.h
+++ b/drivers/usb/musb/blackfin.h
@@ -14,6 +14,33 @@
  * Blackfin specific definitions
  */
 
+/* Anomalies notes:
+ *
+ *  05000450 - USB DMA Mode 1 Short Packet Data Corruption:
+ *             MUSB driver is designed to transfer buffer of N * maxpacket size
+ *             in DMA mode 1 and leave the rest of the data to the next
+ *             transfer in DMA mode 0, so we never transmit a short packet in
+ *             DMA mode 1.
+ *
+ *  05000463 - This anomaly doesn't affect this driver since it
+ *             never uses L1 or L2 memory as data destination.
+ *
+ *  05000464 - This anomaly doesn't affect this driver since it
+ *             never uses L1 or L2 memory as data source.
+ *
+ *  05000465 - The anomaly can be seen when SCLK is over 100 MHz, and there is
+ *             no way to workaround for bulk endpoints.  Since the wMaxPackSize
+ *             of bulk is less than or equal to 512, while the fifo size of
+ *             endpoint 5, 6, 7 is 1024, the double buffer mode is enabled
+ *             automatically when these endpoints are used for bulk OUT.
+ *
+ *  05000466 - This anomaly doesn't affect this driver since it never mixes
+ *             concurrent DMA and core accesses to the TX endpoint FIFOs.
+ *
+ *  05000467 - The workaround for this anomaly will introduce another
+ *             anomaly - 05000465.
+ */
+
 #undef DUMP_FIFO_DATA
 #ifdef DUMP_FIFO_DATA
 static void dump_fifo_data(u8 *buf, u16 len)
-- 
1.6.5.rc1


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

end of thread, other threads:[~2009-09-17 16:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16 23:38 [PATCH 01/11] USB: musb: tweak musb_read_fifo() to avoid unused warnings Mike Frysinger
2009-09-16 23:38 ` [PATCH 02/11] USB: musb: kill compile warning for Blackfin systems Mike Frysinger
2009-09-16 23:38 ` [PATCH 03/11] USB: musb: kill some useless comments in Blackfin driver Mike Frysinger
2009-09-16 23:38 ` [PATCH 04/11] USB: musb: update Blackfin processor dependency Mike Frysinger
2009-09-16 23:38 ` [PATCH 05/11] USB: musb: add notes for Blackfin anomalies Mike Frysinger
2009-09-17 12:33   ` Sergei Shtylyov
2009-09-17 16:25     ` [PATCH 05/12 v2] " Mike Frysinger
2009-09-16 23:38 ` [PATCH 06/11] USB: musb: add work around for Blackfin anomaly 05000456 Mike Frysinger
2009-09-16 23:38 ` [PATCH 07/11] USB: musb: fix musb_platform_set_mode() definition Mike Frysinger
2009-09-16 23:38 ` [PATCH 08/11] USB: musb: clear the Blackfin interrupt pending bits early in the ISR Mike Frysinger
2009-09-16 23:38 ` [PATCH 09/11] USB: musb: error out when anomaly 05000380 is applicable Mike Frysinger
2009-09-16 23:38 ` [PATCH 10/11] USB: musb: Blackfin code needs NOP_USB_XCEIV too Mike Frysinger
2009-09-16 23:38 ` [PATCH 11/11] USB: musb: fix printf warning in debug code Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.