Re: usb, davinci: usb 2.0 problem on an am1808 based board

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sergei,

added
Sekhar Nori <nsekhar@xxxxxx>
Kevin Hilman <khilman@xxxxxx>

to cc ...

Sergei Shtylyov wrote:
> Hello.
> 
> On 11.11.2011 11:19, Felipe Balbi wrote:
> 
>>> I try to bring up usb 2.0 support on an am1808 based
>>> board and Linux version 3.1.0-rc10 and I am facing
>>> some issues:
>>>
>>> - in arch/arm/mach-davinci/usb.c in
>>>    static struct musb_hdrc_platform_data usb_data
>>>    ".mode" var get only initialized if some of the
>>>    CONFIG_USB_MUSB_* config options are set, but your
>>>
>>>    commit 622859634a663c5e55d0e2a2cdbb55ac058d97b3
>>>      Author: Felipe Balbi<balbi@xxxxxx>
>>>      Date:   Wed Jun 22 17:28:09 2011 +0300
>>>
>>>          usb: musb: drop a gigantic amount of ifdeferry
>>>
>>>    dropped a lot of ifdefs, also the USB_MUSB_HOST,
>>>    USB_MUSB_PERIPHERAL and USB_MUSB_OTG defines, which
>>>    are used in arch/arm/mach-davinci/usb.c!
>>>
>>>    So I think, this ".mode" var is used uninitialized,
>>>    or miss I something?
> 
>    In that case it's initialized to 0 by default (as this is a static
> variable) -- which corresponds to MUSB_UNDEFINED. That's not a good
> value indeed.

Ok, so we must do here something ...

>>>    I made a patch, which sets this var to MUSB_OTG
>>>    which should be the right value ... should I post
>>>    it? (BTW: in arch/arm/mach-davinci/board-da830-evm.c
>>>    is also an CONFIG_USB_MUSB_HOST define, which
>>>    should be cleaned up)
>> sure, that needs to be applied.
> 
>    No, that's not a correct patch, I'm afraid...

... yes, I see, because the DM644x EVM board has OTG incapable
host only connector ...

>>
>>> - If I set ".mode = MUSB_OTG" and set in the syscfg2
>>>    soc register ~CFGCHIP2_OTGMODE a memstick is not
>>>    detected.
> 
>    Have you loaded the gadget driver? You have to in the OTG mode --
> else the USB host won't initialize.

Yes. It seems to work, if I made a timeout in the code (see
below) ... but have no idea why I need this timeout...

>>>   But if I add in drivers/usb/musb/da8xx.c
>>>    da8xx_musb_interrupt() a 10ms delay befor the
>>>    "if (status&  (DA8XX_INTR_DRVVBUS<<  DA8XX_INTR_USB_SHIFT)) {"
>>>    line usb works fine!
>>>    It also works without this timeout if I change the
>>>    "dev_dbg(musb->controller, "USB IRQ %08x\n", status);"
>>>    to
>>>    "printk(musb->controller, "USB IRQ %08x\n", status);"
>>>
>>>    ->  some timing issue, but I have no idea why!
>>>       (Maybe you have an idea?)
>> unfortunately I don't know any details about DaVinci.
> 
>    AM1808 is not exactly DaVinci, to be precise...
> 
>> Sergei, are you able to help on this question ?
> 
>    Maybe. :-)

I hope it ;-)

>>
>>> - We use on the board host only mode, so i tried the
>>>    following:
>>>
>>>    set syscfg2 |= CFGCHIP2_FORCE_HOST in board code,
>>>    and in arch/arm/mach-davinci/usb.c
>>>
>>> static struct musb_hdrc_platform_data usb_data = {
>>> -       .mode           = MUSB_OTG,
>>> +       .mode           = MUSB_HOST,
>>>
>>>     ->  USB works (without the above timeout) fine!
> 
>    Well, I'm not surprised...

... Oh, why?

>>> Do you have any idea?
>>>
>>> I think, the issue with the CONFIG_USB_MUSB_* and
>>> the not setup var ".mode" in musb_hdrc_platform_data
>>> must be fixed ... and I think MUSB_OTG should be the right
>>> value ... or?
>> yes, the MUSB IP is always OTG-capable and if that's not working on
>> DaVinci, the root cause needs to be found and fixed.
> 
>     IIRC, DaVinci DM644x EVM board has OTG incapable host only
> connector, hence that code.

Ok, so we need something like the

commit 622859634a663c5e55d0e2a2cdbb55ac058d97b3
Author: Felipe Balbi <balbi@xxxxxx>
Date:   Wed Jun 22 17:28:09 2011 +0300

    usb: musb: drop a gigantic amount of ifdeferry

deleted here?

Hmm... just tried this on the am1808 eval board TMDXEXP1808L...
same issue with kernel 3.1.0-rc10! I need this 10ms timeout and
force host mode to get my memstick working with 3.1.0-rc10 ...
tried the kernel from:

$ git clone git://arago-project.org/git/projects/linux-omapl1.git
$ cd linux-omapl1/
$ make da850_omapl138_defconfig
$ make -s uImage

->

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.33-rc4 (hs@xxxxxxxxxxxxxx) (gcc version 4.5.1 (GCC) ) #1 PREEMPT Mon Nov 14 12:00:50 CET 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18xx EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci da850/omap-l138 variant 0x0

and kernel from:
http://arago-project.org/git/projects/?p=linux-davinci.git;a=summary

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.37+ (hs@xxxxxxxxxxxxxx) (gcc version 4.5.1 (GCC) ) #1 PREEMPT Mon Oct 10 07:56:07 CEST 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18x EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci da850/omap-l138 variant 0x0

With both kernel images a memstick gets detected on the
am1808 eval board ... so I think, there is no hw problem.

I dig into this ... ideas are welcome!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux