From: Venkatraman S <svenkatr@ti.com>
To: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 3/3 v2] musb: AM35x: Workaround for fifo read issue
Date: Sat, 15 May 2010 00:53:34 +0530 [thread overview]
Message-ID: <AANLkTim78r8bwcKc4MAqEexam_NJbrEkqNrgoBIknisH@mail.gmail.com> (raw)
In-Reply-To: <1273838737-6995-3-git-send-email-ajay.gupta@ti.com>
Ajay Kumar Gupta <ajay.gupta@ti.com> wrote:
> AM35x supports only 32bit read operations so we need to have
> workaround for 8bit and 16bit read operations.
>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
> drivers/usb/musb/am3517.c | 30 ++++++++++++++++++++++++++++++
> drivers/usb/musb/musb_core.c | 2 ++
> 2 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/musb/am3517.c b/drivers/usb/musb/am3517.c
> index dd9e883..24bdc2e 100644
> --- a/drivers/usb/musb/am3517.c
> +++ b/drivers/usb/musb/am3517.c
> @@ -515,3 +515,33 @@ void musb_platform_restore_context(struct musb_context_registers
> phy_on();
> }
> #endif
> +
> +/* AM35x supports only 32bit read operation */
> +void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
> +{
> + void __iomem *fifo = hw_ep->fifo;
> + u32 val;
> + int i;
> +
> + /* Read for 32bit-aligned destination address */
> + if ((likely((0x03 & (unsigned long) dst) == 0)) && len >= 4) {
> + readsl(fifo, dst, len >> 2);
> + dst += (len & ~0x03);
> + len &= 0x03;
> + }
> + /* Now read the rest 1 to 3 bytes or complete length if
check multiline comments style
> + * unaligned address.
> + */
> + if (len > 4) {
> + for (i = 0; i < (len >> 2); i++) {
> + val = musb_readl(fifo, 0);
> + memcpy(dst, &val, 4);
> + dst += 4;
> + }
> + len %= 4;
> + }
> + if (len > 0) {
> + val = musb_readl(fifo, 0);
> + memcpy(dst, &val, len);
> + }
> +}
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 705cc4a..bc2cf14 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -191,6 +191,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
> }
> }
>
> +#if !defined(CONFIG_MACH_OMAP3517EVM)
> /*
> * Unload an endpoint's FIFO
> */
> @@ -228,6 +229,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
> readsb(fifo, dst, len);
> }
> }
> +#endif
>
> #endif /* normal PIO */
>
> --
> 1.6.2.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-05-14 19:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 12:05 [PATCH 1/3 v2] AM35x: Add musb support Ajay Kumar Gupta
[not found] ` <1273838737-6995-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-05-14 12:05 ` [PATCH 2/3 v2] musb: add musb support for AM35x Ajay Kumar Gupta
2010-05-14 12:05 ` [PATCH 3/3 v2] musb: AM35x: Workaround for fifo read issue Ajay Kumar Gupta
2010-05-14 19:23 ` Venkatraman S [this message]
[not found] ` <1273838737-6995-2-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-05-14 19:16 ` [PATCH 2/3 v2] musb: add musb support for AM35x Venkatraman S
2010-05-15 1:54 ` Gupta, Ajay Kumar
-- strict thread matches above, loose matches on Subject: below --
2010-05-18 12:09 [PATCH 3/3 v2] musb: AM35x: Workaround for fifo read issue Ajay Kumar Gupta
[not found] ` <1274184586-28843-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-05-18 12:54 ` Sergei Shtylyov
2010-05-18 13:42 ` Gupta, Ajay Kumar
2010-05-20 9:27 ` Gupta, Ajay Kumar
[not found] ` <19F8576C6E063C45BE387C64729E7394044E535C95-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-05-20 9:32 ` Sergei Shtylyov
2010-05-20 9:48 ` Gupta, Ajay Kumar
2010-05-20 9:41 ` Gadiyar, Anand
2010-05-20 10:00 ` Gupta, Ajay Kumar
[not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB0322EAE899-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-05-20 10:06 ` Felipe Balbi
[not found] ` <20100520100630.GF9992-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-05-20 10:08 ` Felipe Balbi
2010-05-21 6:38 ` Gupta, Ajay Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTim78r8bwcKc4MAqEexam_NJbrEkqNrgoBIknisH@mail.gmail.com \
--to=svenkatr@ti.com \
--cc=ajay.gupta@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).