public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* OMAP3530 USB host problems
@ 2009-02-20 18:15 Gary Thomas
  2009-02-20 18:29 ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-20 18:15 UTC (permalink / raw)
  To: Linux OMAP Mailing List

I have a 3530 board (similar to the OMAP3EVM) and I'm trying
to get the USB host working.  Sadly, this is failing, but I
don't quite see why.  From drivers/usb/host/echi-omap.c:
	/* Wait for TLL to be Active */
        timeout = 1000;
	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
        {
            if (--timeout <= 0) {
                printk(KERN_ERR "USB TLL is unavailable\n");
                return -ENODEV;
            }
		cpu_relax();
        }

Any clues on why this might be?  How do I solve it?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-20 18:15 OMAP3530 USB host problems Gary Thomas
@ 2009-02-20 18:29 ` Felipe Balbi
  2009-02-20 18:50   ` Gary Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-20 18:29 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Linux OMAP Mailing List

On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> to get the USB host working.  Sadly, this is failing, but I
> don't quite see why.  From drivers/usb/host/echi-omap.c:
> 	/* Wait for TLL to be Active */
>         timeout = 1000;
> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>         {
>             if (--timeout <= 0) {
>                 printk(KERN_ERR "USB TLL is unavailable\n");
>                 return -ENODEV;
>             }
> 		cpu_relax();
>         }
> 
> Any clues on why this might be?  How do I solve it?

could you enable CONFIG_DEBUG_LL and post the seria console output ?

do you really use TLL ?? I don't really know omap3evm, but I guess it
uses PHY mode (correct me if I'm wrong).

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-20 18:29 ` Felipe Balbi
@ 2009-02-20 18:50   ` Gary Thomas
  2009-02-20 18:54     ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-20 18:50 UTC (permalink / raw)
  To: me; +Cc: Linux OMAP Mailing List

Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
>> to get the USB host working.  Sadly, this is failing, but I
>> don't quite see why.  From drivers/usb/host/echi-omap.c:
>> 	/* Wait for TLL to be Active */
>>         timeout = 1000;
>> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>         {
>>             if (--timeout <= 0) {
>>                 printk(KERN_ERR "USB TLL is unavailable\n");
>>                 return -ENODEV;
>>             }
>> 		cpu_relax();
>>         }
>>
>> Any clues on why this might be?  How do I solve it?
> 
> could you enable CONFIG_DEBUG_LL and post the seria console output ?
> 
> do you really use TLL ?? I don't really know omap3evm, but I guess it
> uses PHY mode (correct me if I'm wrong).
> 

It's not that I _need_ TLL, the driver function omap_start_ehci()
tries to reset the part of the USB controller and fails.  I'm just
trying to understand why this part of the code falls over.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-20 18:50   ` Gary Thomas
@ 2009-02-20 18:54     ` Felipe Balbi
  2009-02-20 19:05       ` Gary Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-20 18:54 UTC (permalink / raw)
  To: Gary Thomas; +Cc: me, Linux OMAP Mailing List

On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
> Felipe Balbi wrote:
> > On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> >> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> >> to get the USB host working.  Sadly, this is failing, but I
> >> don't quite see why.  From drivers/usb/host/echi-omap.c:
> >> 	/* Wait for TLL to be Active */
> >>         timeout = 1000;
> >> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> >> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>         {
> >>             if (--timeout <= 0) {
> >>                 printk(KERN_ERR "USB TLL is unavailable\n");
> >>                 return -ENODEV;
> >>             }
> >> 		cpu_relax();
> >>         }
> >>
> >> Any clues on why this might be?  How do I solve it?
> > 
> > could you enable CONFIG_DEBUG_LL and post the seria console output ?
> > 
> > do you really use TLL ?? I don't really know omap3evm, but I guess it
> > uses PHY mode (correct me if I'm wrong).
> > 
> 
> It's not that I _need_ TLL, the driver function omap_start_ehci()
> tries to reset the part of the USB controller and fails.  I'm just
> trying to understand why this part of the code falls over.

you have OMAP_EHCI_TLL_MODE set, you should probably use
OMAP_EHCI_PHY_MODE instead.

You can fix it via "make menuconfig"

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-20 18:54     ` Felipe Balbi
@ 2009-02-20 19:05       ` Gary Thomas
  2009-02-20 19:23         ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-20 19:05 UTC (permalink / raw)
  To: me; +Cc: Linux OMAP Mailing List

Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
>> Felipe Balbi wrote:
>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
>>>> to get the USB host working.  Sadly, this is failing, but I
>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
>>>> 	/* Wait for TLL to be Active */
>>>>         timeout = 1000;
>>>> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>         {
>>>>             if (--timeout <= 0) {
>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
>>>>                 return -ENODEV;
>>>>             }
>>>> 		cpu_relax();
>>>>         }
>>>>
>>>> Any clues on why this might be?  How do I solve it?
>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
>>>
>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
>>> uses PHY mode (correct me if I'm wrong).
>>>
>> It's not that I _need_ TLL, the driver function omap_start_ehci()
>> tries to reset the part of the USB controller and fails.  I'm just
>> trying to understand why this part of the code falls over.
> 
> you have OMAP_EHCI_TLL_MODE set, you should probably use
> OMAP_EHCI_PHY_MODE instead.
> 
> You can fix it via "make menuconfig"
> 

I already have that; this code is still being used.
  # CONFIG_OMAP_EHCI_TLL_MODE is not set
  CONFIG_OMAP_EHCI_PHY_MODE=y

This is not used in the function above at all.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-20 19:05       ` Gary Thomas
@ 2009-02-20 19:23         ` Felipe Balbi
  2009-02-20 19:35           ` Gary Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-20 19:23 UTC (permalink / raw)
  To: Gary Thomas; +Cc: me, Linux OMAP Mailing List

On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
> Felipe Balbi wrote:
> > On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
> >> Felipe Balbi wrote:
> >>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> >>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> >>>> to get the USB host working.  Sadly, this is failing, but I
> >>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
> >>>> 	/* Wait for TLL to be Active */
> >>>>         timeout = 1000;
> >>>> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> >>>> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>>>         {
> >>>>             if (--timeout <= 0) {
> >>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
> >>>>                 return -ENODEV;
> >>>>             }
> >>>> 		cpu_relax();
> >>>>         }
> >>>>
> >>>> Any clues on why this might be?  How do I solve it?
> >>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
> >>>
> >>> do you really use TLL ?? I don't really know omap3evm, but I guess it
> >>> uses PHY mode (correct me if I'm wrong).
> >>>
> >> It's not that I _need_ TLL, the driver function omap_start_ehci()
> >> tries to reset the part of the USB controller and fails.  I'm just
> >> trying to understand why this part of the code falls over.
> > 
> > you have OMAP_EHCI_TLL_MODE set, you should probably use
> > OMAP_EHCI_PHY_MODE instead.
> > 
> > You can fix it via "make menuconfig"
> > 
> 
> I already have that; this code is still being used.
>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
>   CONFIG_OMAP_EHCI_PHY_MODE=y
> 
> This is not used in the function above at all.

hmm.. true, just checked the function.

Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
should access it when it's 0, try the following:

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 1b3266c..122e95b 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
 
        /* Wait for TLL to be Active */
        while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
-                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
+                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
                cpu_relax();
 
        /* perform TLL soft reset, and wait until reset is complete */

and tell us if it worked

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-20 19:23         ` Felipe Balbi
@ 2009-02-20 19:35           ` Gary Thomas
  2009-02-20 19:41             ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-20 19:35 UTC (permalink / raw)
  To: me; +Cc: Linux OMAP Mailing List

Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
>> Felipe Balbi wrote:
>>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
>>>> Felipe Balbi wrote:
>>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
>>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
>>>>>> to get the USB host working.  Sadly, this is failing, but I
>>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
>>>>>> 	/* Wait for TLL to be Active */
>>>>>>         timeout = 1000;
>>>>>> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>>>> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>>>         {
>>>>>>             if (--timeout <= 0) {
>>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
>>>>>>                 return -ENODEV;
>>>>>>             }
>>>>>> 		cpu_relax();
>>>>>>         }
>>>>>>
>>>>>> Any clues on why this might be?  How do I solve it?
>>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
>>>>>
>>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
>>>>> uses PHY mode (correct me if I'm wrong).
>>>>>
>>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
>>>> tries to reset the part of the USB controller and fails.  I'm just
>>>> trying to understand why this part of the code falls over.
>>> you have OMAP_EHCI_TLL_MODE set, you should probably use
>>> OMAP_EHCI_PHY_MODE instead.
>>>
>>> You can fix it via "make menuconfig"
>>>
>> I already have that; this code is still being used.
>>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
>>   CONFIG_OMAP_EHCI_PHY_MODE=y
>>
>> This is not used in the function above at all.
> 
> hmm.. true, just checked the function.
> 
> Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
> should access it when it's 0, try the following:
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 1b3266c..122e95b 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
>  
>         /* Wait for TLL to be Active */
>         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>                 cpu_relax();
>  
>         /* perform TLL soft reset, and wait until reset is complete */
> 
> and tell us if it worked
> 

Sadly, I've already tried this and things just continue to fall apart.

  Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
  Internal error: : 1008 [#1]
  Modules linked in:
  CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
  PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
  LR is at release_console_sem+0x1a8/0x1d8

Hence, my desired to figure out the TLL timeout...

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-20 19:35           ` Gary Thomas
@ 2009-02-20 19:41             ` Felipe Balbi
  2009-02-23 10:21               ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-20 19:41 UTC (permalink / raw)
  To: Gary Thomas; +Cc: me, Linux OMAP Mailing List

On Fri, Feb 20, 2009 at 12:35:29PM -0700, Gary Thomas wrote:
> Felipe Balbi wrote:
> > On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
> >> Felipe Balbi wrote:
> >>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
> >>>> Felipe Balbi wrote:
> >>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> >>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> >>>>>> to get the USB host working.  Sadly, this is failing, but I
> >>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
> >>>>>> 	/* Wait for TLL to be Active */
> >>>>>>         timeout = 1000;
> >>>>>> 	while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> >>>>>> 			& (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>>>>>         {
> >>>>>>             if (--timeout <= 0) {
> >>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
> >>>>>>                 return -ENODEV;
> >>>>>>             }
> >>>>>> 		cpu_relax();
> >>>>>>         }
> >>>>>>
> >>>>>> Any clues on why this might be?  How do I solve it?
> >>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
> >>>>>
> >>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
> >>>>> uses PHY mode (correct me if I'm wrong).
> >>>>>
> >>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
> >>>> tries to reset the part of the USB controller and fails.  I'm just
> >>>> trying to understand why this part of the code falls over.
> >>> you have OMAP_EHCI_TLL_MODE set, you should probably use
> >>> OMAP_EHCI_PHY_MODE instead.
> >>>
> >>> You can fix it via "make menuconfig"
> >>>
> >> I already have that; this code is still being used.
> >>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
> >>   CONFIG_OMAP_EHCI_PHY_MODE=y
> >>
> >> This is not used in the function above at all.
> > 
> > hmm.. true, just checked the function.
> > 
> > Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
> > should access it when it's 0, try the following:
> > 
> > diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> > index 1b3266c..122e95b 100644
> > --- a/drivers/usb/host/ehci-omap.c
> > +++ b/drivers/usb/host/ehci-omap.c
> > @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
> >  
> >         /* Wait for TLL to be Active */
> >         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> > -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> > +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >                 cpu_relax();
> >  
> >         /* perform TLL soft reset, and wait until reset is complete */
> > 
> > and tell us if it worked
> > 
> 
> Sadly, I've already tried this and things just continue to fall apart.
> 
>   Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
>   Internal error: : 1008 [#1]
>   Modules linked in:
>   CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
>   PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
>   LR is at release_console_sem+0x1a8/0x1d8
> 
> Hence, my desired to figure out the TLL timeout...

keep TLL as is, the problem now seems to be a clock that should be on
and is off. Try to figure (with printk() for example) at which line the
code stops, put printk() before and after register read/write operations
during probe and omap_start_ehc(), let's see where does it dies.

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-20 19:41             ` Felipe Balbi
@ 2009-02-23 10:21               ` Felipe Balbi
  2009-02-23 13:08                 ` Gary Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-23 10:21 UTC (permalink / raw)
  To: ext Felipe Balbi; +Cc: Gary Thomas, Linux OMAP Mailing List

On Fri, Feb 20, 2009 at 08:41:58PM +0100, ext Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 12:35:29PM -0700, Gary Thomas wrote:
> > Felipe Balbi wrote:
> > > On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
> > >> Felipe Balbi wrote:
> > >>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
> > >>>> Felipe Balbi wrote:
> > >>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> > >>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> > >>>>>> to get the USB host working.  Sadly, this is failing, but I
> > >>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
> > >>>>>>        /* Wait for TLL to be Active */
> > >>>>>>         timeout = 1000;
> > >>>>>>        while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> > >>>>>>                        & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> > >>>>>>         {
> > >>>>>>             if (--timeout <= 0) {
> > >>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
> > >>>>>>                 return -ENODEV;
> > >>>>>>             }
> > >>>>>>                cpu_relax();
> > >>>>>>         }
> > >>>>>>
> > >>>>>> Any clues on why this might be?  How do I solve it?
> > >>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
> > >>>>>
> > >>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
> > >>>>> uses PHY mode (correct me if I'm wrong).
> > >>>>>
> > >>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
> > >>>> tries to reset the part of the USB controller and fails.  I'm just
> > >>>> trying to understand why this part of the code falls over.
> > >>> you have OMAP_EHCI_TLL_MODE set, you should probably use
> > >>> OMAP_EHCI_PHY_MODE instead.
> > >>>
> > >>> You can fix it via "make menuconfig"
> > >>>
> > >> I already have that; this code is still being used.
> > >>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
> > >>   CONFIG_OMAP_EHCI_PHY_MODE=y
> > >>
> > >> This is not used in the function above at all.
> > >
> > > hmm.. true, just checked the function.
> > >
> > > Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
> > > should access it when it's 0, try the following:
> > >
> > > diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> > > index 1b3266c..122e95b 100644
> > > --- a/drivers/usb/host/ehci-omap.c
> > > +++ b/drivers/usb/host/ehci-omap.c
> > > @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
> > >
> > >         /* Wait for TLL to be Active */
> > >         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> > > -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> > > +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> > >                 cpu_relax();
> > >
> > >         /* perform TLL soft reset, and wait until reset is complete */
> > >
> > > and tell us if it worked
> > >
> >
> > Sadly, I've already tried this and things just continue to fall apart.
> >
> >   Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
> >   Internal error: : 1008 [#1]
> >   Modules linked in:
> >   CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
> >   PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
> >   LR is at release_console_sem+0x1a8/0x1d8
> >
> > Hence, my desired to figure out the TLL timeout...
> 
> keep TLL as is, the problem now seems to be a clock that should be on
> and is off. Try to figure (with printk() for example) at which line the
> code stops, put printk() before and after register read/write operations
> during probe and omap_start_ehc(), let's see where does it dies.

any news ??

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-23 10:21               ` Felipe Balbi
@ 2009-02-23 13:08                 ` Gary Thomas
  2009-02-23 13:27                   ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-23 13:08 UTC (permalink / raw)
  To: felipe.balbi; +Cc: ext Felipe Balbi, Linux OMAP Mailing List

Felipe Balbi wrote:
> On Fri, Feb 20, 2009 at 08:41:58PM +0100, ext Felipe Balbi wrote:
>> On Fri, Feb 20, 2009 at 12:35:29PM -0700, Gary Thomas wrote:
>>> Felipe Balbi wrote:
>>>> On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
>>>>> Felipe Balbi wrote:
>>>>>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
>>>>>>> Felipe Balbi wrote:
>>>>>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
>>>>>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
>>>>>>>>> to get the USB host working.  Sadly, this is failing, but I
>>>>>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
>>>>>>>>>        /* Wait for TLL to be Active */
>>>>>>>>>         timeout = 1000;
>>>>>>>>>        while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>>>>>>>                        & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>>>>>>         {
>>>>>>>>>             if (--timeout <= 0) {
>>>>>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
>>>>>>>>>                 return -ENODEV;
>>>>>>>>>             }
>>>>>>>>>                cpu_relax();
>>>>>>>>>         }
>>>>>>>>>
>>>>>>>>> Any clues on why this might be?  How do I solve it?
>>>>>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
>>>>>>>>
>>>>>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
>>>>>>>> uses PHY mode (correct me if I'm wrong).
>>>>>>>>
>>>>>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
>>>>>>> tries to reset the part of the USB controller and fails.  I'm just
>>>>>>> trying to understand why this part of the code falls over.
>>>>>> you have OMAP_EHCI_TLL_MODE set, you should probably use
>>>>>> OMAP_EHCI_PHY_MODE instead.
>>>>>>
>>>>>> You can fix it via "make menuconfig"
>>>>>>
>>>>> I already have that; this code is still being used.
>>>>>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
>>>>>   CONFIG_OMAP_EHCI_PHY_MODE=y
>>>>>
>>>>> This is not used in the function above at all.
>>>> hmm.. true, just checked the function.
>>>>
>>>> Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
>>>> should access it when it's 0, try the following:
>>>>
>>>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>>>> index 1b3266c..122e95b 100644
>>>> --- a/drivers/usb/host/ehci-omap.c
>>>> +++ b/drivers/usb/host/ehci-omap.c
>>>> @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
>>>>
>>>>         /* Wait for TLL to be Active */
>>>>         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>> -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>> +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>                 cpu_relax();
>>>>
>>>>         /* perform TLL soft reset, and wait until reset is complete */
>>>>
>>>> and tell us if it worked
>>>>
>>> Sadly, I've already tried this and things just continue to fall apart.
>>>
>>>   Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
>>>   Internal error: : 1008 [#1]
>>>   Modules linked in:
>>>   CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
>>>   PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
>>>   LR is at release_console_sem+0x1a8/0x1d8
>>>
>>> Hence, my desired to figure out the TLL timeout...
>> keep TLL as is, the problem now seems to be a clock that should be on
>> and is off. Try to figure (with printk() for example) at which line the
>> code stops, put printk() before and after register read/write operations
>> during probe and omap_start_ehc(), let's see where does it dies.
> 
> any news ??
> 

Not really;  I'd like to figure out *why* this part of the USB
device isn't working, not just find a way around it...


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-23 13:08                 ` Gary Thomas
@ 2009-02-23 13:27                   ` Felipe Balbi
  2009-02-23 17:21                     ` Gary Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2009-02-23 13:27 UTC (permalink / raw)
  To: ext Gary Thomas
  Cc: Balbi Felipe (Nokia-D/Helsinki), ext Felipe Balbi,
	Linux OMAP Mailing List

On Mon, Feb 23, 2009 at 02:08:12PM +0100, ext Gary Thomas wrote:
> Felipe Balbi wrote:
> > On Fri, Feb 20, 2009 at 08:41:58PM +0100, ext Felipe Balbi wrote:
> >> On Fri, Feb 20, 2009 at 12:35:29PM -0700, Gary Thomas wrote:
> >>> Felipe Balbi wrote:
> >>>> On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
> >>>>> Felipe Balbi wrote:
> >>>>>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
> >>>>>>> Felipe Balbi wrote:
> >>>>>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
> >>>>>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
> >>>>>>>>> to get the USB host working.  Sadly, this is failing, but I
> >>>>>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
> >>>>>>>>>        /* Wait for TLL to be Active */
> >>>>>>>>>         timeout = 1000;
> >>>>>>>>>        while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> >>>>>>>>>                        & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>>>>>>>>         {
> >>>>>>>>>             if (--timeout <= 0) {
> >>>>>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
> >>>>>>>>>                 return -ENODEV;
> >>>>>>>>>             }
> >>>>>>>>>                cpu_relax();
> >>>>>>>>>         }
> >>>>>>>>>
> >>>>>>>>> Any clues on why this might be?  How do I solve it?
> >>>>>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
> >>>>>>>>
> >>>>>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
> >>>>>>>> uses PHY mode (correct me if I'm wrong).
> >>>>>>>>
> >>>>>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
> >>>>>>> tries to reset the part of the USB controller and fails.  I'm just
> >>>>>>> trying to understand why this part of the code falls over.
> >>>>>> you have OMAP_EHCI_TLL_MODE set, you should probably use
> >>>>>> OMAP_EHCI_PHY_MODE instead.
> >>>>>>
> >>>>>> You can fix it via "make menuconfig"
> >>>>>>
> >>>>> I already have that; this code is still being used.
> >>>>>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
> >>>>>   CONFIG_OMAP_EHCI_PHY_MODE=y
> >>>>>
> >>>>> This is not used in the function above at all.
> >>>> hmm.. true, just checked the function.
> >>>>
> >>>> Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
> >>>> should access it when it's 0, try the following:
> >>>>
> >>>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> >>>> index 1b3266c..122e95b 100644
> >>>> --- a/drivers/usb/host/ehci-omap.c
> >>>> +++ b/drivers/usb/host/ehci-omap.c
> >>>> @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
> >>>>
> >>>>         /* Wait for TLL to be Active */
> >>>>         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
> >>>> -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>>> +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
> >>>>                 cpu_relax();
> >>>>
> >>>>         /* perform TLL soft reset, and wait until reset is complete */
> >>>>
> >>>> and tell us if it worked
> >>>>
> >>> Sadly, I've already tried this and things just continue to fall apart.
> >>>
> >>>   Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
> >>>   Internal error: : 1008 [#1]
> >>>   Modules linked in:
> >>>   CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
> >>>   PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
> >>>   LR is at release_console_sem+0x1a8/0x1d8
> >>>
> >>> Hence, my desired to figure out the TLL timeout...
> >> keep TLL as is, the problem now seems to be a clock that should be on
> >> and is off. Try to figure (with printk() for example) at which line the
> >> code stops, put printk() before and after register read/write operations
> >> during probe and omap_start_ehc(), let's see where does it dies.
> >
> > any news ??
> >
> 
> Not really;  I'd like to figure out *why* this part of the USB
> device isn't working, not just find a way around it...

It's not a way around it. That bit is wrong, one problem is fixed now
but we came to another issue which is a non-linefetch, which makes me
wonder that's a clock issue.

You should just try to fetch me for information and I might be able to
help you more.

-- 
balbi

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

* Re: OMAP3530 USB host problems
  2009-02-23 13:27                   ` Felipe Balbi
@ 2009-02-23 17:21                     ` Gary Thomas
  2009-02-23 18:00                       ` Felipe Balbi
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Thomas @ 2009-02-23 17:21 UTC (permalink / raw)
  To: felipe.balbi; +Cc: ext Felipe Balbi, Linux OMAP Mailing List

Felipe Balbi wrote:
> On Mon, Feb 23, 2009 at 02:08:12PM +0100, ext Gary Thomas wrote:
>> Felipe Balbi wrote:
>>> On Fri, Feb 20, 2009 at 08:41:58PM +0100, ext Felipe Balbi wrote:
>>>> On Fri, Feb 20, 2009 at 12:35:29PM -0700, Gary Thomas wrote:
>>>>> Felipe Balbi wrote:
>>>>>> On Fri, Feb 20, 2009 at 12:05:49PM -0700, Gary Thomas wrote:
>>>>>>> Felipe Balbi wrote:
>>>>>>>> On Fri, Feb 20, 2009 at 11:50:44AM -0700, Gary Thomas wrote:
>>>>>>>>> Felipe Balbi wrote:
>>>>>>>>>> On Fri, Feb 20, 2009 at 11:15:36AM -0700, Gary Thomas wrote:
>>>>>>>>>>> I have a 3530 board (similar to the OMAP3EVM) and I'm trying
>>>>>>>>>>> to get the USB host working.  Sadly, this is failing, but I
>>>>>>>>>>> don't quite see why.  From drivers/usb/host/echi-omap.c:
>>>>>>>>>>>        /* Wait for TLL to be Active */
>>>>>>>>>>>         timeout = 1000;
>>>>>>>>>>>        while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>>>>>>>>>                        & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>>>>>>>>         {
>>>>>>>>>>>             if (--timeout <= 0) {
>>>>>>>>>>>                 printk(KERN_ERR "USB TLL is unavailable\n");
>>>>>>>>>>>                 return -ENODEV;
>>>>>>>>>>>             }
>>>>>>>>>>>                cpu_relax();
>>>>>>>>>>>         }
>>>>>>>>>>>
>>>>>>>>>>> Any clues on why this might be?  How do I solve it?
>>>>>>>>>> could you enable CONFIG_DEBUG_LL and post the seria console output ?
>>>>>>>>>>
>>>>>>>>>> do you really use TLL ?? I don't really know omap3evm, but I guess it
>>>>>>>>>> uses PHY mode (correct me if I'm wrong).
>>>>>>>>>>
>>>>>>>>> It's not that I _need_ TLL, the driver function omap_start_ehci()
>>>>>>>>> tries to reset the part of the USB controller and fails.  I'm just
>>>>>>>>> trying to understand why this part of the code falls over.
>>>>>>>> you have OMAP_EHCI_TLL_MODE set, you should probably use
>>>>>>>> OMAP_EHCI_PHY_MODE instead.
>>>>>>>>
>>>>>>>> You can fix it via "make menuconfig"
>>>>>>>>
>>>>>>> I already have that; this code is still being used.
>>>>>>>   # CONFIG_OMAP_EHCI_TLL_MODE is not set
>>>>>>>   CONFIG_OMAP_EHCI_PHY_MODE=y
>>>>>>>
>>>>>>> This is not used in the function above at all.
>>>>>> hmm.. true, just checked the function.
>>>>>>
>>>>>> Weird, TRM says when that bit is 1, we cannot access ST_USBTLL, we
>>>>>> should access it when it's 0, try the following:
>>>>>>
>>>>>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>>>>>> index 1b3266c..122e95b 100644
>>>>>> --- a/drivers/usb/host/ehci-omap.c
>>>>>> +++ b/drivers/usb/host/ehci-omap.c
>>>>>> @@ -250,7 +250,7 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
>>>>>>
>>>>>>         /* Wait for TLL to be Active */
>>>>>>         while ((cm_read_mod_reg(CORE_MOD, OMAP2430_CM_IDLEST3)
>>>>>> -                       & (1 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>>> +                       & (0 << OMAP3430ES2_ST_USBTLL_SHIFT)))
>>>>>>                 cpu_relax();
>>>>>>
>>>>>>         /* perform TLL soft reset, and wait until reset is complete */
>>>>>>
>>>>>> and tell us if it worked
>>>>>>
>>>>> Sadly, I've already tried this and things just continue to fall apart.
>>>>>
>>>>>   Unhandled fault: external abort on non-linefetch (0x1008) at 0xd8062010
>>>>>   Internal error: : 1008 [#1]
>>>>>   Modules linked in:
>>>>>   CPU: 0    Not tainted  (2.6.27-omap1-svn4799-dirty14 #60)
>>>>>   PC is at ehci_hcd_omap_drv_probe+0x370/0x5e4
>>>>>   LR is at release_console_sem+0x1a8/0x1d8
>>>>>
>>>>> Hence, my desired to figure out the TLL timeout...
>>>> keep TLL as is, the problem now seems to be a clock that should be on
>>>> and is off. Try to figure (with printk() for example) at which line the
>>>> code stops, put printk() before and after register read/write operations
>>>> during probe and omap_start_ehc(), let's see where does it dies.
>>> any news ??
>>>
>> Not really;  I'd like to figure out *why* this part of the USB
>> device isn't working, not just find a way around it...
> 
> It's not a way around it. That bit is wrong, one problem is fixed now
> but we came to another issue which is a non-linefetch, which makes me
> wonder that's a clock issue.
> 
> You should just try to fetch me for information and I might be able to
> help you more.
> 

It turns out that the various USB clocks were not enabled (this is prototype
hardware, only roughly equivalent to the OMAP3EVM and I started with a
kernel snapshot more than a month ago, so much may have changed in the
meantime).  I can now get through this part of the USB host initialization
code (still doesn't work, but I think I can figure it out).

Thanks for the pointers


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: OMAP3530 USB host problems
  2009-02-23 17:21                     ` Gary Thomas
@ 2009-02-23 18:00                       ` Felipe Balbi
  0 siblings, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2009-02-23 18:00 UTC (permalink / raw)
  To: Gary Thomas; +Cc: felipe.balbi, ext Felipe Balbi, Linux OMAP Mailing List

On Mon, Feb 23, 2009 at 10:21:25AM -0700, Gary Thomas wrote:
> It turns out that the various USB clocks were not enabled (this is prototype
> hardware, only roughly equivalent to the OMAP3EVM and I started with a
> kernel snapshot more than a month ago, so much may have changed in the
> meantime).  I can now get through this part of the USB host initialization
> code (still doesn't work, but I think I can figure it out).

Yeah, as I suspected. Even in current linux-omap, I got report that vbus
goes on, but enumeration doesn't happen, so you're at the same stage.

> Thanks for the pointers

no problems

-- 
balbi

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

end of thread, other threads:[~2009-02-23 18:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-20 18:15 OMAP3530 USB host problems Gary Thomas
2009-02-20 18:29 ` Felipe Balbi
2009-02-20 18:50   ` Gary Thomas
2009-02-20 18:54     ` Felipe Balbi
2009-02-20 19:05       ` Gary Thomas
2009-02-20 19:23         ` Felipe Balbi
2009-02-20 19:35           ` Gary Thomas
2009-02-20 19:41             ` Felipe Balbi
2009-02-23 10:21               ` Felipe Balbi
2009-02-23 13:08                 ` Gary Thomas
2009-02-23 13:27                   ` Felipe Balbi
2009-02-23 17:21                     ` Gary Thomas
2009-02-23 18:00                       ` Felipe Balbi

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