* [PATCH 0/3] USB compile fixes omaps
@ 2010-03-11 18:03 Tony Lindgren
2010-03-11 18:03 ` [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc Tony Lindgren
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 18:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe & Greg,
Here are three fixes to make USB compile for omaps.
Can you please take a look and queue?
The tusb6010 DMA fix needs a platform init patch that I'll
send along with other omap fixes.
Regards,
Tony
---
Tony Lindgren (3):
usb: Fix compile error for omaps for musb_hdrc
usb: Fix USB_SUSPEND dependency for OTG
usb: Fix tusb6010 for DMA API
drivers/usb/core/Kconfig | 2 +-
drivers/usb/musb/musb_core.h | 4 ++--
drivers/usb/musb/tusb6010.c | 13 +++++++++++++
drivers/usb/musb/tusb6010_omap.c | 22 ++++++++++++++--------
4 files changed, 30 insertions(+), 11 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc
2010-03-11 18:03 [PATCH 0/3] USB compile fixes omaps Tony Lindgren
@ 2010-03-11 18:03 ` Tony Lindgren
2010-03-12 8:30 ` Felipe Balbi
2010-03-11 18:03 ` [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG Tony Lindgren
2010-03-11 18:03 ` [PATCH 3/3] usb: Fix tusb6010 for DMA API Tony Lindgren
2 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 18:03 UTC (permalink / raw)
To: linux-arm-kernel
CONFIG_ARCH_OMAP34XX is now CONFIG_ARCH_OMAP3.
But since drivers/usb/musb/omap2430.c use CONFIG_PM for these
registers and functions, do the same for the header.
Otherwise we get the following for most omap3 defconfigs:
drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do'
drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'while'
drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do'
drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'while'
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/usb/musb/musb_core.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index d849fb8..cd9f4a9 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -469,7 +469,7 @@ struct musb_csr_regs {
struct musb_context_registers {
-#if defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP2430)
+#ifdef CONFIG_PM
u32 otg_sysconfig, otg_forcestandby;
#endif
u8 power;
@@ -483,7 +483,7 @@ struct musb_context_registers {
struct musb_csr_regs index_regs[MUSB_C_NUM_EPS];
};
-#if defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP2430)
+#ifdef CONFIG_PM
extern void musb_platform_save_context(struct musb *musb,
struct musb_context_registers *musb_context);
extern void musb_platform_restore_context(struct musb *musb,
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG
2010-03-11 18:03 [PATCH 0/3] USB compile fixes omaps Tony Lindgren
2010-03-11 18:03 ` [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc Tony Lindgren
@ 2010-03-11 18:03 ` Tony Lindgren
2010-03-11 18:20 ` Gadiyar, Anand
2010-03-11 18:03 ` [PATCH 3/3] usb: Fix tusb6010 for DMA API Tony Lindgren
2 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 18:03 UTC (permalink / raw)
To: linux-arm-kernel
To use this, PM_RUNTIME must be set as discussed at:
http://thread.gmane.org/gmane.linux.usb.general/27432/focus=4460
Otherwise we'll get errors like:
drivers/usb/core/hcd.c:1892: error: 'pm_wq' undeclared (first use in this function)
drivers/usb/core/hcd.c:1892: error: (Each undeclared identifier is reported only once
drivers/usb/core/hcd.c:1892: error: for each function it appears in.)
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/usb/core/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 97a819c..7e59444 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -109,7 +109,7 @@ config USB_SUSPEND
config USB_OTG
bool
depends on USB && EXPERIMENTAL
- select USB_SUSPEND
+ depends on USB_SUSPEND
default n
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] usb: Fix tusb6010 for DMA API
2010-03-11 18:03 [PATCH 0/3] USB compile fixes omaps Tony Lindgren
2010-03-11 18:03 ` [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc Tony Lindgren
2010-03-11 18:03 ` [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG Tony Lindgren
@ 2010-03-11 18:03 ` Tony Lindgren
2 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 18:03 UTC (permalink / raw)
To: linux-arm-kernel
Commit 18eabe2347ae7a11b3db768695913724166dfb0e introduced
DMA buffer ownership. Fix tusb6010 accordingly.
Also change the order of musb_read_fifo() to happen after
dma_cache_maint to have the DMA operations completed before
moving the remaining unaligned bytes with PIO. The DMA
access and PIO touch different areas of the FIFO, so this
change only makes the code a bit easier to follow.
Tested on n810 and g_ether with variable size ping test.
The test seems to fail for some ping sizes, but that seems to
be a different problem.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/usb/musb/tusb6010.c | 13 +++++++++++++
drivers/usb/musb/tusb6010_omap.c | 22 ++++++++++++++--------
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index ab776a8..60d3938 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -29,6 +29,19 @@ static void tusb_source_power(struct musb *musb, int is_on);
#define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf)
#define TUSB_REV_MINOR(reg_val) (reg_val & 0xf)
+#ifdef CONFIG_PM
+/* REVISIT: These should be only needed if somebody implements off idle */
+void musb_platform_save_context(struct musb *musb,
+ struct musb_context_registers *musb_context)
+{
+}
+
+void musb_platform_restore_context(struct musb *musb,
+ struct musb_context_registers *musb_context)
+{
+}
+#endif
+
/*
* Checks the revision. We need to use the DMA register as 3.0 does not
* have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV.
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c
index 1c86809..6f0e943 100644
--- a/drivers/usb/musb/tusb6010_omap.c
+++ b/drivers/usb/musb/tusb6010_omap.c
@@ -38,7 +38,7 @@ struct tusb_omap_dma_ch {
struct tusb_omap_dma *tusb_dma;
- void __iomem *dma_addr;
+ dma_addr_t dma_addr;
u32 len;
u16 packet_sz;
@@ -125,6 +125,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data)
struct tusb_omap_dma_ch *chdat = to_chdat(channel);
struct tusb_omap_dma *tusb_dma = chdat->tusb_dma;
struct musb *musb = chdat->musb;
+ struct device *dev = musb->controller;
struct musb_hw_ep *hw_ep = chdat->hw_ep;
void __iomem *ep_conf = hw_ep->conf;
void __iomem *mbase = musb->mregs;
@@ -172,13 +173,15 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data)
DBG(3, "Using PIO for remaining %lu bytes\n", pio);
buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len;
if (chdat->tx) {
- dma_cache_maint(phys_to_virt((u32)chdat->dma_addr),
- chdat->transfer_len, DMA_TO_DEVICE);
+ dma_unmap_single(dev, chdat->dma_addr,
+ chdat->transfer_len,
+ DMA_TO_DEVICE);
musb_write_fifo(hw_ep, pio, buf);
} else {
+ dma_unmap_single(dev, chdat->dma_addr,
+ chdat->transfer_len,
+ DMA_FROM_DEVICE);
musb_read_fifo(hw_ep, pio, buf);
- dma_cache_maint(phys_to_virt((u32)chdat->dma_addr),
- chdat->transfer_len, DMA_FROM_DEVICE);
}
channel->actual_len += pio;
}
@@ -223,6 +226,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
struct tusb_omap_dma_ch *chdat = to_chdat(channel);
struct tusb_omap_dma *tusb_dma = chdat->tusb_dma;
struct musb *musb = chdat->musb;
+ struct device *dev = musb->controller;
struct musb_hw_ep *hw_ep = chdat->hw_ep;
void __iomem *mbase = musb->mregs;
void __iomem *ep_conf = hw_ep->conf;
@@ -298,14 +302,16 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
chdat->packet_sz = packet_sz;
chdat->len = len;
channel->actual_len = 0;
- chdat->dma_addr = (void __iomem *)dma_addr;
+ chdat->dma_addr = dma_addr;
channel->status = MUSB_DMA_STATUS_BUSY;
/* Since we're recycling dma areas, we need to clean or invalidate */
if (chdat->tx)
- dma_cache_maint(phys_to_virt(dma_addr), len, DMA_TO_DEVICE);
+ dma_map_single(dev, phys_to_virt(dma_addr), len,
+ DMA_TO_DEVICE);
else
- dma_cache_maint(phys_to_virt(dma_addr), len, DMA_FROM_DEVICE);
+ dma_map_single(dev, phys_to_virt(dma_addr), len,
+ DMA_FROM_DEVICE);
/* Use 16-bit transfer if dma_addr is not 32-bit aligned */
if ((dma_addr & 0x3) == 0) {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG
2010-03-11 18:03 ` [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG Tony Lindgren
@ 2010-03-11 18:20 ` Gadiyar, Anand
2010-03-11 18:41 ` Tony Lindgren
0 siblings, 1 reply; 8+ messages in thread
From: Gadiyar, Anand @ 2010-03-11 18:20 UTC (permalink / raw)
To: linux-arm-kernel
Tony Lindgren wrote:
>
> To use this, PM_RUNTIME must be set as discussed at:
>
> http://thread.gmane.org/gmane.linux.usb.general/27432/focus=4460
>
> Otherwise we'll get errors like:
>
> drivers/usb/core/hcd.c:1892: error: 'pm_wq' undeclared (first use in this function)
> drivers/usb/core/hcd.c:1892: error: (Each undeclared identifier is reported only once
> drivers/usb/core/hcd.c:1892: error: for each function it appears in.)
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Hi Tony,
I already posted this patch last month. Still waiting for it
to get queued.
<http://marc.info/?l=linux-usb&m=126675883221098&w=2>
- Anand
> ---
> drivers/usb/core/Kconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index 97a819c..7e59444 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -109,7 +109,7 @@ config USB_SUSPEND
> config USB_OTG
> bool
> depends on USB && EXPERIMENTAL
> - select USB_SUSPEND
> + depends on USB_SUSPEND
> default n
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG
2010-03-11 18:20 ` Gadiyar, Anand
@ 2010-03-11 18:41 ` Tony Lindgren
0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 18:41 UTC (permalink / raw)
To: linux-arm-kernel
* Gadiyar, Anand <gadiyar@ti.com> [100311 10:24]:
> Tony Lindgren wrote:
> >
> > To use this, PM_RUNTIME must be set as discussed at:
> >
> > http://thread.gmane.org/gmane.linux.usb.general/27432/focus=4460
> >
> > Otherwise we'll get errors like:
> >
> > drivers/usb/core/hcd.c:1892: error: 'pm_wq' undeclared (first use in this function)
> > drivers/usb/core/hcd.c:1892: error: (Each undeclared identifier is reported only once
> > drivers/usb/core/hcd.c:1892: error: for each function it appears in.)
> >
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> Hi Tony,
>
> I already posted this patch last month. Still waiting for it
> to get queued.
>
> <http://marc.info/?l=linux-usb&m=126675883221098&w=2>
OK thanks, I just found the thread but no patches. So my version
can then be dropped.
Tony
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc
2010-03-11 18:03 ` [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc Tony Lindgren
@ 2010-03-12 8:30 ` Felipe Balbi
2010-03-12 8:33 ` Felipe Balbi
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2010-03-12 8:30 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 11, 2010 at 07:03:22PM +0100, ext Tony Lindgren wrote:
>CONFIG_ARCH_OMAP34XX is now CONFIG_ARCH_OMAP3.
>
>But since drivers/usb/musb/omap2430.c use CONFIG_PM for these
>registers and functions, do the same for the header.
>
>Otherwise we get the following for most omap3 defconfigs:
>
>drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do'
>drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'while'
>drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do'
>drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'while'
>
>Signed-off-by: Tony Lindgren <tony@atomide.com>
I sent a version for that yesterday. Sorry :-(
--
balbi
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc
2010-03-12 8:30 ` Felipe Balbi
@ 2010-03-12 8:33 ` Felipe Balbi
0 siblings, 0 replies; 8+ messages in thread
From: Felipe Balbi @ 2010-03-12 8:33 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Mar 12, 2010 at 09:30:12AM +0100, Balbi Felipe (Nokia-D/Helsinki) wrote:
>>Signed-off-by: Tony Lindgren <tony@atomide.com>
>
>I sent a version for that yesterday. Sorry :-(
turns out I used your version because I didn't know the OMAP3 config was
changed.
--
balbi
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-03-12 8:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 18:03 [PATCH 0/3] USB compile fixes omaps Tony Lindgren
2010-03-11 18:03 ` [PATCH 1/3] usb: Fix compile error for omaps for musb_hdrc Tony Lindgren
2010-03-12 8:30 ` Felipe Balbi
2010-03-12 8:33 ` Felipe Balbi
2010-03-11 18:03 ` [PATCH 2/3] usb: Fix USB_SUSPEND dependency for OTG Tony Lindgren
2010-03-11 18:20 ` Gadiyar, Anand
2010-03-11 18:41 ` Tony Lindgren
2010-03-11 18:03 ` [PATCH 3/3] usb: Fix tusb6010 for DMA API Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).