public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
@ 2008-09-04  7:23 Gadiyar, Anand
       [not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02C418D1B1-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Gadiyar, Anand @ 2008-09-04  7:23 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Gupta, Ajay Kumar

From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>

The Index register needs to be zero to access CONFIGDATA.
musb_ep_select()will not set the MUSB_INDEX register unless INDEXED
mode addressing is used. This change will set the register correctly
in INDEXED as well as FLAT mode.

Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
CC: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
---
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b398776..6c4da2f 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1334,7 +1334,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
 	int		i;
 
 	/* log core options (read using indexed model) */
-	musb_ep_select(mbase, 0);
+	musb_writeb(mbase, MUSB_INDEX, 0);
 	reg = musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
 
 	strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
       [not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02C418D1B1-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2008-09-07  5:04   ` David Brownell
  2008-09-08  3:12     ` Bryan Wu
  0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2008-09-07  5:04 UTC (permalink / raw)
  To: Gadiyar, Anand
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Gupta, Ajay Kumar, Bryan Wu

On Thursday 04 September 2008, Gadiyar, Anand wrote:
> From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
> 
> The Index register needs to be zero to access CONFIGDATA.
> musb_ep_select()will not set the MUSB_INDEX register unless INDEXED
> mode addressing is used. This change will set the register correctly
> in INDEXED as well as FLAT mode.
> 
> Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
> CC: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

ACK.  I *know* it was originally written that way.  I think
the change was one of the Blackfin patches ... I hope this
isn't one of those cases where the Blackfin version of this
core acts differently.  (Like clearing that DMA IRQ status...)


> ---
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index b398776..6c4da2f 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1334,7 +1334,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
>  	int		i;
>  
>  	/* log core options (read using indexed model) */
> -	musb_ep_select(mbase, 0);
> +	musb_writeb(mbase, MUSB_INDEX, 0);
>  	reg = musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
>  
>  	strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");--
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
  2008-09-07  5:04   ` David Brownell
@ 2008-09-08  3:12     ` Bryan Wu
       [not found]       ` <386072610809072012wcf053a6j37c238b82667c23a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2008-09-12 17:34       ` David Brownell
  0 siblings, 2 replies; 6+ messages in thread
From: Bryan Wu @ 2008-09-08  3:12 UTC (permalink / raw)
  To: David Brownell
  Cc: Gadiyar, Anand, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Gupta, Ajay Kumar

On Sun, Sep 7, 2008 at 1:04 PM, David Brownell <david-b@pacbell.net> wrote:
> On Thursday 04 September 2008, Gadiyar, Anand wrote:
>> From: Anand Gadiyar <gadiyar@ti.com>
>>
>> The Index register needs to be zero to access CONFIGDATA.
>> musb_ep_select()will not set the MUSB_INDEX register unless INDEXED
>> mode addressing is used. This change will set the register correctly
>> in INDEXED as well as FLAT mode.
>>
>> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
>> CC: Ajay Kumar Gupta <ajay.gupta@ti.com>
>
> ACK.  I *know* it was originally written that way.  I think
> the change was one of the Blackfin patches ... I hope this
> isn't one of those cases where the Blackfin version of this
> core acts differently.  (Like clearing that DMA IRQ status...)
>

For Blackfin, the register MUSB_CONFIGDATA is not exported out to software.
So in the musb driver, Blackfin code can not access the MUSB_CONFIGDATA.
The configuration is fixed in the software.

-Bryan

>
>> ---
>> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
>> index b398776..6c4da2f 100644
>> --- a/drivers/usb/musb/musb_core.c
>> +++ b/drivers/usb/musb/musb_core.c
>> @@ -1334,7 +1334,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
>>       int             i;
>>
>>       /* log core options (read using indexed model) */
>> -     musb_ep_select(mbase, 0);
>> +     musb_writeb(mbase, MUSB_INDEX, 0);
>>       reg = musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
>>
>>       strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");--
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
>

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

* Re: [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
       [not found]       ` <386072610809072012wcf053a6j37c238b82667c23a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-09-10 19:01         ` Felipe Balbi
  2008-09-11  3:35           ` Bryan Wu
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2008-09-10 19:01 UTC (permalink / raw)
  To: Bryan Wu
  Cc: David Brownell, Gadiyar, Anand,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Gupta, Ajay Kumar

On Mon, Sep 08, 2008 at 11:12:24AM +0800, Bryan Wu wrote:
> On Sun, Sep 7, 2008 at 1:04 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
> > On Thursday 04 September 2008, Gadiyar, Anand wrote:
> >> From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
> >>
> >> The Index register needs to be zero to access CONFIGDATA.
> >> musb_ep_select()will not set the MUSB_INDEX register unless INDEXED
> >> mode addressing is used. This change will set the register correctly
> >> in INDEXED as well as FLAT mode.
> >>
> >> Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
> >> CC: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
> >
> > ACK.  I *know* it was originally written that way.  I think
> > the change was one of the Blackfin patches ... I hope this
> > isn't one of those cases where the Blackfin version of this
> > core acts differently.  (Like clearing that DMA IRQ status...)
> >
> 
> For Blackfin, the register MUSB_CONFIGDATA is not exported out to software.
> So in the musb driver, Blackfin code can not access the MUSB_CONFIGDATA.
> The configuration is fixed in the software.

What happens if you try to read/write to the register ? Does it screw up
things somehow or just ignores ??

If it just ignores (and same for the other unexistent registers) we can
drop that patch adding ifdefs to te register accesses otherwise we're
gonna have to think about another solution to abstract that.

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
  2008-09-10 19:01         ` Felipe Balbi
@ 2008-09-11  3:35           ` Bryan Wu
  0 siblings, 0 replies; 6+ messages in thread
From: Bryan Wu @ 2008-09-11  3:35 UTC (permalink / raw)
  To: me-uiRdBs8odbtmTBlB0Cgj/Q
  Cc: David Brownell, Gadiyar, Anand,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Gupta, Ajay Kumar

On Thu, Sep 11, 2008 at 3:01 AM, Felipe Balbi <me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org> wrote:
> On Mon, Sep 08, 2008 at 11:12:24AM +0800, Bryan Wu wrote:
>> On Sun, Sep 7, 2008 at 1:04 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
>> > On Thursday 04 September 2008, Gadiyar, Anand wrote:
>> >> From: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
>> >>
>> >> The Index register needs to be zero to access CONFIGDATA.
>> >> musb_ep_select()will not set the MUSB_INDEX register unless INDEXED
>> >> mode addressing is used. This change will set the register correctly
>> >> in INDEXED as well as FLAT mode.
>> >>
>> >> Signed-off-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>
>> >> CC: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
>> >
>> > ACK.  I *know* it was originally written that way.  I think
>> > the change was one of the Blackfin patches ... I hope this
>> > isn't one of those cases where the Blackfin version of this
>> > core acts differently.  (Like clearing that DMA IRQ status...)
>> >
>>
>> For Blackfin, the register MUSB_CONFIGDATA is not exported out to software.
>> So in the musb driver, Blackfin code can not access the MUSB_CONFIGDATA.
>> The configuration is fixed in the software.
>
> What happens if you try to read/write to the register ? Does it screw up
> things somehow or just ignores ??
>

Since there is no such register MUSB_CONFIGDATA in Blackfin memory
space, we can not access to such address.
If we don't define this register, compiling will fail in Blackfin

> If it just ignores (and same for the other unexistent registers) we can
> drop that patch adding ifdefs to te register accesses otherwise we're
> gonna have to think about another solution to abstract that.
>

Currently, I just added ifdefs to those registers which does not exist
in Blackfin.
I also want to find an elegant way to solve this difference instead of
using ugly ifdefs here.

-Bryan


> balbi
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA
  2008-09-08  3:12     ` Bryan Wu
       [not found]       ` <386072610809072012wcf053a6j37c238b82667c23a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-09-12 17:34       ` David Brownell
  1 sibling, 0 replies; 6+ messages in thread
From: David Brownell @ 2008-09-12 17:34 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Gadiyar, Anand, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Gupta, Ajay Kumar

On Sunday 07 September 2008, Bryan Wu wrote:
> For Blackfin, the register MUSB_CONFIGDATA is not exported out to software.
> So in the musb driver, Blackfin code can not access the MUSB_CONFIGDATA.
> The configuration is fixed in the software.

So an musb_read_configdata() inline could normally read
that register, but on Blackfin could return the equivalent
constant data ...



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

end of thread, other threads:[~2008-09-12 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04  7:23 [PATCH] MUSB: Set INDEX register to 0 before accessing CONFIGDATA Gadiyar, Anand
     [not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02C418D1B1-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2008-09-07  5:04   ` David Brownell
2008-09-08  3:12     ` Bryan Wu
     [not found]       ` <386072610809072012wcf053a6j37c238b82667c23a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-10 19:01         ` Felipe Balbi
2008-09-11  3:35           ` Bryan Wu
2008-09-12 17:34       ` David Brownell

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