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.

3.12 on AM335X -- USB DMA problem

I am working on AM335X custom board. The kernel is v3.12 that released from SDK 7.0

If I use the use the EDMA mode of USB, I cannot get USB port working. (It works under PIO mode.)

root@arm:~# dmesg |grep -i usb
[ 0.312492] usbcore: registered new interface driver usbfs
[ 0.312744] usbcore: registered new interface driver hub
[ 0.313066] usbcore: registered new device driver usb
[ 1.433967] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 1.440533] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 1.446899] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 1.455545] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
[ 1.465874] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[ 1.472673] musb-hdrc musb-hdrc.1.auto: Falied to request rx1.
[ 1.478871] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with stat us -517
[ 1.487209] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferr al
[ 1.701464] usbcore: registered new interface driver usbhid
[ 1.707506] usbhid: USB HID core driver
[ 2.006879] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 2.013676] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 2.019875] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 2.028203] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
[ 2.036482] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[ 2.043316] musb-hdrc musb-hdrc.1.auto: Falied to request rx1.
[ 2.049515] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with stat us -517
[ 2.057790] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferr al
[ 2.079965] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 2.086697] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 2.092989] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 2.101225] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
[ 2.109539] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[ 2.116199] musb-hdrc musb-hdrc.1.auto: Falied to request rx1.
[ 2.122463] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with stat us -517
[ 2.130692] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferr al
[ 2.216605] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 2.223823] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 2.230049] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 2.275049] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
[ 2.285717] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[ 2.309500] musb-hdrc musb-hdrc.1.auto: Falied to request rx1.
[ 2.315870] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with stat us -517
[ 2.324637] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferr al
[ 2.334734] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 2.341663] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 2.349213] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 2.358083] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
[ 5.908160] musb-hdrc musb-hdrc.1.auto: Enabled SW babble control
[ 5.908289] musb-hdrc musb-hdrc.1.auto: Falied to request rx1.
[ 5.955785] musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with stat us -517
[ 6.057073] platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferr al
[ 6.057816] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
[ 6.057941] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
[ 6.128113] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with stat us -517
[ 6.205111] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferr al
root@arm:~#

===

Here is my device tree setting

musb: usb@47400000 {
status = "okay";

control@44e10620 {
status = "okay";
};

usb-phy@47401300 {
status = "okay";
};

usb@47401000 {
status = "okay";
};

usb-phy@47401b00 {
status = "okay";
};

usb@47401800 {
status = "okay";
dr_mode = "host";
};

dma-controller@07402000 {
status = "okay";
};
};

Any ideas?

-Eric

  • Hi Eric,

    I have asked the factory team USB experts to assist with your issue. I'll let you know when there is an answer.

    Best regards,
    Miroslav

  • Miroslav,

    Thanks. Just let you know that my previous post was based on ti-linux-3.12y branch. 

    -Eric

  • Eric,

    It seems you miss a kernel config. Can you please post /proc/config.gz for the non-working and working cases?

    Please also attach the whole kernel bootlog - dmesg.

    Eric Lee4 said:
    If I use the use the EDMA mode of USB,

    You meant CPPI DMA not EDMA, right? AM335x MUSB does not use EDMA.

  • Ben,

    Yes, it is a typo. I am talking about CPPI DMA. I used to suspect my kernel config file not setting well. If I roll back to 3.12.10 (Head commit 2325bb5680986b6914d8fd0b5d0bdc20081fe8d3) with same kernel config file. I can get my USB working under CPPI DMA mode (see attached dmesg.3.12.10.txt). When I use 3.12.y or 3.15y, I cannot get USB able to work. (See attached dmesg.3.12y.txt.)

    I also found that in arch/arm/boot/dts/am33xx.dtsi. The usb control mode register address changed from 3.12.10 to 3.12y or after. 

    In 3.12.10 ctrl_mod: control@44e10000

    In 3.12.y or after ctrl_mod: control@44e10620

    But no matter I use control@44e10620 or control@44e10000 in my dts file, I always got "musb_init_controller failed with status -517" error in 3.12y or after.

    -Eric

     

    config.gz
  • Here is my dmesg file that usb cannot work.

    -Eric

  • Here is my dmesg file for 3.12.10.

    -Eric

  • Eric,

    Ok, you are not using the default omap2plus_defconfig, but trying to build all the usb drivers into kernel which is known broken in the recent 3.12.xx kernel. Please try the patch in the following link, which should fix the issue.

    http://www.spinics.net/lists/linux-omap/msg105854.html

  • Ben,

    I do use omap2plus defconfig and just comment out some unwanted options.

    I think I tried that patch before, but no help. 

    -Eric

  • Ben,

    Just tried again. This patch does not work. 

    -Eric

  • Eric,

    No, you are not using omap2plus_defconfig from the SDK7.0 kernel. Please check the following difference.

    $ grep MUSB board-support-src-sdk70/linux-3.12.10-ti2013.12.01/arch/arm/configs/omap2plus_defconfig
    CONFIG_USB_MUSB_HDRC=m
    CONFIG_USB_MUSB_OMAP2PLUS=m
    CONFIG_USB_MUSB_DSPS=m
    
    $ grep MUSB /home/lb/Downloads/config | grep -v '^#'
    CONFIG_USB_MUSB_HDRC=y
    CONFIG_USB_MUSB_DUAL_ROLE=y
    CONFIG_USB_MUSB_DSPS=y
    CONFIG_USB_MUSB_AM335X_CHILD=y
    
  • Ben,

    The differences are only compiled as a module or build in kernel. Do you think this make differences?

    However, I follow your suggestion and uses exactly the same defconfig as that in SDK7.0 (See attached). I still got the same error.  

    [ 7.323537] musb-hdrc musb-hdrc.0.auto: Enabled SW babble control
    [ 7.323661] musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
    [ 7.371021] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517

    The USB CPPI DMA do work under 3.12.10, but not 3.12y or after. We are using the same defconfig file. 

    -Eric

    config.gz
  • Ben,

    I figure it out now. The USB register address in am33xx.dtsi for 3.12.10 and 3.12y are different. Thanks for your assistance.

    -Eric 

  • Ben,

    One last question. When I unplug my USB devices, it complains about "usb 1-1: device v046d pc019 is not supported". How to get rid of this?

    -Eric

  • Eric,

    Eric Lee4 said:
    I figure it out now. The USB register address in am33xx.dtsi for 3.12.10 and 3.12y are different.

    Does this mean that you did not update the dtb file on the board while updated the kernel image? I am just trying to figure out what exact the issue was.

    Eric Lee4 said:

    One last question. When I unplug my USB devices, it complains about "usb 1-1: device v046d pc019 is not supported". How to get rid of this?

    You have CONFIG_USB_OTG defined in your .config. If you undefine it, the message will go away.

  • Ben,

    This is correct. Do need this CONFIG_USB_OTG if I would like to have my usb0 works as otg?

    -Eric

  • I guess your usb0 works as 'dual role' - switching between host and device mode based on type-A or B cable plugged in, not a 'true otg' such as HNP and SRP... If so, you don't need CONFIG_USB_OTG.

  • Hi Eric,


    I'm having this problem with 3.15 with the beaglebone black. What exactly was the solution?


    thanks,

    Paul

  • Paul,

    I was using 3.12.10 device tree setting and found out they are slight different from the 3.12.y and 3.15.y. After correct my device tree setting, my USB works fine.

    -Eric

  • What exactly was different, I've looked through the 3.15 compared to the 3.12 from SDK 7, and nothing jumps out.

    thanks,

    Paul

  • Please, could you explain how did you fix the problem? I'm having the same troubles with USB and I'm also using 3.12 from SDK 7

    thanks in advance

    Carlo

  • Ok. maybe I got it! The problem is into am33xx_315.dtsi. A couple of USB addresses into kernel 3.12 are wrong:

    cppi41dma: dma-controller@07402000 should be cppi41dma: dma-controller@47402000

    ctrl_mod: control@44e10000 should be ctrl_mod: control@44e10620

    hope it helps

    Carlo

  • wrong copy&paste: am33xx.dtsi (into arch/arm/boot/dts), not am33xx_315.dtsi

    Carlo Nenna1 said:

    Ok. maybe I got it! The problem is into am33xx_315.dtsi. A couple of USB addresses into kernel 3.12 are wrong:

    cppi41dma: dma-controller@07402000 should be cppi41dma: dma-controller@47402000

    ctrl_mod: control@44e10000 should be ctrl_mod: control@44e10620

    hope it helps

    Carlo

  • Hello Eric-san,

     

    Could you teach me what should I modify.

    I've already modified the following points; however, the problem isn't solved.

    --- a/arch/arm/boot/dts/am33xx.dtsi

    +++ b/arch/arm/boot/dts/am33xx.dtsi

    @@ -122,7 +122,7 @@

                            compatible = "ti,edma3";

                            ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";

                            reg =   <0x49000000 0x10000>,

    -                               <0x44e10f90 0x10>;

    +                               <0x44e10f90 0x40>;

                            interrupts = <12 13 14>;

                            #dma-cells = <1>;

                            dma-channels = <64>; @@ -501,7 +501,7 @@

                            clocks = <&usbotg_fck>;

                            clock-names = "fck";

     

    -                       ctrl_mod: control@44e10000 {

    +                       ctrl_mod: control@44e10620 {

                                    compatible = "ti,am335x-usb-ctrl-module";

                                    reg = <0x44e10620 0x10

                                            0x44e10648 0x4>; @@ -604,7 +604,7 @@

                                            "tx14", "tx15";

                            };

     

    -                       cppi41dma: dma-controller@07402000 {

    +                       cppi41dma: dma-controller@47402000 {

                                    compatible = "ti,am3359-cppi41";

                                    reg =  <0x47400000 0x1000

                                            0x47402000 0x1000

     

    Best Regards,

    Nomoto