This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

musb on OMAP L138 / A1808

Other Parts Discussed in Thread: AM1808, DA8XX

Hello,

I want to integrate the current 2.6.36 Linux Kernel with the older DaVinci TI_AM1808_SDK/DaVinci-PSP-SDK-03.20.00.12 of May 2010. While looking at the source, there are some things in the current 2.6.36 Kernel, like drivers/net/davinci.c interrupt coalescing, and other are in the DaVinci branch (2.6.32).

Can someone shed some light into the roadmap for the L138/AM1808 kernel sources? Will the USB2.0 / SPI / McBSP things be merged into the mainstream kernel, or at least into the davinci branch on kernel.org?

Thanks,

heibox

 

 

  • From musb driver perspective you can port patches from DaVinci-PSP-SDK-03.20.00.12 to 2.6.36 kernel one by one. Some of them may not get applied directly which you can do manually. drivers/net/davinci.c is not related to musb driver. I think you are looking at it for network driver porting.

    Musb patches for davinci AM18x would be getting submitted starting from next month onward.

    Ajay

  • Hello Ajay,

    I've done a big step with my patches to 2.6.36: USB storage, a wifi card and an FTDI adapter work well on the bus. My only problem is a Qualcomm WAN card, that registers 7 ttyUSB devices. I can open the device for read and write, but I cannot write a single character to the device. The following happens in an endless loop, after writing a single char: (The CDC patches are applied as well).

     

    [  949.450000] Pushing value c3a4ffca to queue @ fee06000

    [  949.450000] Channel global configuration @ fee01820, value written: 1d, value read: 0

    [  949.450000] Enable channel @ fee01820, value written: 8000001d, value read: 80000000

    [  949.450000] Pushing value c3a4ff8a to queue @ fee06120

    [  949.470000] Popping value c3a4ff81 from queue @ fee06180

    [  949.470000] Pushing value c3a4ff8a to queue @ fee06120

    [  949.470000] Popping value c3a4ff81 from queue @ fee06180

    [  949.470000] Pushing value c3a4ff8a to queue @ fee06120

    [  949.470000] Popping value 0 from queue @ fee06180

    [  949.500000] Popping value c3a4ff81 from queue @ fee06180

    [  949.500000] Pushing value c3a4ff8a to queue @ fee06120

    [  949.500000] Popping value c3a4ff81 from queue @ fee06180

    [  949.500000] Pushing value c3a4ff8a to queue @ fee06120

    [  949.500000] Popping value 0 from queue @ fee06180

    ... and so on. The system freezes.

    Do you have any idea?

     

    P.S.: A bit more debug output:

    [  571.750000] musb_ep_program 694: --> hw2 urb c3b05680 spd3 dev2 ep4out h_addr00 h_port00 bytes 1

    [  571.750000] Channel global configuration @ fee01820, value written: 1d, value read: 0

    [  571.750000] Enable channel @ fee01820, value written: 8000001d, value read: 80000000

    [  571.750000] cppi41_channel_alloc 453: Allocated DMA Tx channel 1 for EP2

    [  571.750000] cppi41_next_tx_segment 559: TX DMA1, accelerated, maxpkt 1, 1 PDs, addr 0xc3968800, len 1

    [  571.750000] cppi41_next_tx_segment 594: TX PD ff00bf40: buf c3968800, len 00000001, pkt info 14000018

    [  571.750000] Pushing value c39e7f4a to queue @ fee06120

    [  571.750000] musb_start_urb 289: Start TX2 dma

    [  571.820000] da8xx_interrupt 418: CPPI 4.1 IRQ: Tx 1, Rx 0

    [  571.820000]  in usb_process_tx_queue

    [  571.820000] Popping value c39e7f41 from queue @ fee06180

    [  571.820000]  in usb_process_tx_queue loop

    [  571.820000] cppi41_next_tx_segment 559: TX DMA1, accelerated, maxpkt 0, 1 PDs, addr 0xc3968801, len 0

    [  571.820000] cppi41_next_tx_segment 594: TX PD ff00bf40: buf c3968801, len 00000000, pkt info 14000018

    [  571.820000] Pushing value c39e7f4a to queue @ fee06120

    [  571.820000] Popping value 0 from queue @ fee06180

    [  571.870000] da8xx_interrupt 418: CPPI 4.1 IRQ: Tx 1, Rx 0

    [  571.870000]  in usb_process_tx_queue

    [  571.870000] Popping value c39e7f41 from queue @ fee06180

    [  571.870000]  in usb_process_tx_queue loop

    [  571.870000] cppi41_next_tx_segment 559: TX DMA1, accelerated, maxpkt 0, 1 PDs, addr 0xc3968801, len 0

    [  571.870000] cppi41_next_tx_segment 594: TX PD ff00bf40: buf c3968801, len 00000000, pkt info 14000018

    [  571.870000] Pushing value c39e7f4a to queue @ fee06120

    [  571.870000] Popping value c39e7f41 from queue @ fee06180

    [  571.870000]  in usb_process_tx_queue loop

    [  571.870000] cppi41_next_tx_segment 559: TX DMA1, accelerated, maxpkt 0, 1 PDs, addr 0xc3968801, len 0

    [  571.870000] cppi41_next_tx_segment 594: TX PD ff00bf40: buf c3968801, len 00000000, pkt info 14000018

    [  571.870000] Pushing value c39e7f4a to queue @ fee06120

    [  571.870000] Popping value 0 from queue @ fee06180

    [  571.950000] da8xx_interrupt 418: CPPI 4.1 IRQ: Tx 1, Rx 0

     

     

  • Heibox,

    Can you send me the output of "cat /proc/bus/usb/devices" ? You would require to enable CONFIG_USB_DEVICEFS for this to work. This would help us to know if L138 has enough resources to service all the requests. Additionally please use the attached patch which has helped other in CDC host classes.http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/354</p> <p>/0216.0001_2D002D00_MUSB_2D00_Fix_2D00_for_2D00_CDC_2D00_Host_2D00_issue_2D00_when_2D00_streaming_2D00_more.patch.log

    Regards,

    Ajay

  • Hello Ajay,

    the patch has been applied already.

    This is /proc/bus/usb/devices:

    T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
    B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1d6b ProdID=0002 Rev= 2.06
    S:  Manufacturer=Linux 2.6.36.2 musb-hcd
    S:  Product=MUSB HDRC host driver
    S:  SerialNumber=musb_hdrc
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
    
    T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1199 ProdID=683c Rev= 0.05
    S:  Manufacturer=Sierra Wireless, Incorporated
    S:  Product=Mini Card
    C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=  0mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=sierra
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
    
    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 1
    B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1d6b ProdID=0001 Rev= 2.06
    S:  Manufacturer=Linux 2.6.36.2 ohci_hcd
    S:  Product=DA8xx OHCI
    S:  SerialNumber=ohci.0
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
    
  • Heibox,

    Resources wise the setup looks fine to me. Now I think the cppi dma is having issue. Can you test in non-DMA mode to confirm this? You can enable it at Drivers->USB support->Inventra -> Disable DMA.

    Regards,
    Ajay

  • Hi,

    that works fine, but DMA is needed in this application.

    Regards,

    Heiko

  • Heiko,

    Thanks for confirming it. Now we would need to have Qualcomm WAN card to further work on this issue and debug it. Let me check if we have this card with us.

    Regards,
    ajay

  • Thanks for the help!

    I think I have found a problem in the zero-length packet handling code of cppi41_dma.c,  and the device works now. I'll need a bit more time to check all other devices and the performance, and if it works with the one I have, I'll post the patch.

    Heiko