• Resolved

Linux/AM3352: gpio0 wake-up disturbed by usb1 connection

Part Number: AM3352

Tool/software: Linux

Dear Specialists:

   Strange issue.   Signals from gpio0 bank cannot wake-up the system when usb1 connected to a module using Host mode.

 

I'm using Linux(kernel 4.14.71) based on ROCESSOR-SDK-AM335X( kernel 4.14.y branch) to run on a custom board , Processor  is AM3352, and the usb1 is designed to connect to an Am Telecom (amm570)LTE module,  everything goes well except the gpio0 to wake-up system from standby mode.

  1,  when  comment out the usb1 section in arch/arm/boot/dts/my_board,dts,  that is meaning not use usb1 connection.  gpio0 (number 23)from a button can wakeup the system( using command as follow) immediately

          rtcwake -d rtc0 -m standby -s 10

 2, but when add the usb1 section to the board's devicestree file, the gpio0(number 23 ,  also number 22) signals can not wake up the system)

     &usb1_phy {

status = "okay";
};

&usb1 {

status = "okay";
dr_mode = "host";
};

3,  When using another version Linux kernel . ROCESSOR-SDK-AM335X( kernel 3.14.y ) ,  everything is OK no matter using usb1 or not.

I think there is no problem in hardware design, according to   the checklist ( http://processors.wiki.ti.com/index.php/AM335x_Schematic_Checklist#USB

and the success use case in version ROCESSOR-SDK-AM335X( kernel 3.14.y )

Boot logs:

[ 3.612483] remoteproc remoteproc0: powering up wkup_m3
[ 3.623828] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[ 3.629824] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
[ 3.630140] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.630155] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.630165] usb usb1: Product: MUSB HDRC host driver
[ 3.630176] usb usb1: Manufacturer: Linux 4.14.71 musb-hcd
[ 3.630185] usb usb1: SerialNumber: musb-hdrc.0
[ 3.631056] hub 1-0:1.0: USB hub found
[ 3.631116] hub 1-0:1.0: 1 port detected
[ 3.649802] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[ 3.657315] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
[ 3.657575] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 3.657590] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.657600] usb usb2: Product: MUSB HDRC host driver
[ 3.657610] usb usb2: Manufacturer: Linux 4.14.71 musb-hcd
[ 3.657620] usb usb2: SerialNumber: musb-hdrc.1
[ 3.658441] hub 2-0:1.0: USB hub found
[ 3.658502] hub 2-0:1.0: 1 port detected
[ 3.673888] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 500000 KHz
[ 3.753106] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 216864
[ 3.761800] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 600000 KHz
[ 3.771436] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
[ 3.778739] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 3.790167] ubi0: attaching mtd0
[ 4.100361] usb 2-1: new high-speed USB device number 2 using musb-hdrc
[ 4.260516] usb 2-1: New USB device found, idVendor=0424, idProduct=2514
[ 4.272344] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.288921] hub 2-1:1.0: USB hub found
[ 4.296405] hub 2-1:1.0: 4 ports detected
[ 4.596355] usb 2-1.1: new full-speed USB device number 3 using musb-hdrc
[ 4.716418] usb 2-1.1: New USB device found, idVendor=08bb, idProduct=29c6
[ 4.728344] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4.744340] usb 2-1.1: Product: USB AUDIO CODEC
[ 4.756339] usb 2-1.1: Manufacturer: BurrBrown from Texas Instruments
[ 4.776559] input: BurrBrown from Texas Instruments USB AUDIO CODEC as /devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1/usb2/2-1/2-1.1/2-1.1:1.3/0003:08BB:29C6.0001/input/input0
[ 4.872587] hid-generic 0003:08BB:29C6.0001: input,hidraw0: USB HID v1.00 Device [BurrBrown from Texas Instruments USB AUDIO CODEC] on usb-musb-hdrc.1-1.1/input3
[ 4.984358] usb 2-1.3: new high-speed USB device number 4 using musb-hdrc
[ 5.100909] usb 2-1.3: New USB device found, idVendor=0451, idProduct=926b
[ 5.112345] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5.128340] usb 2-1.3: Product: TUSB9260 Boot Loader
[ 5.140340] usb 2-1.3: Manufacturer: Texas Instruments
[ 5.152341] usb 2-1.3: SerialNumber: TUSB9260BL01
[ 5.164470] hid-generic 0003:0451:926B.0002: hiddev0,hidraw1: USB HID v1.10 Device [Texas Instruments TUSB9260 Boot Loader] on usb-musb-hdrc.1-1.3/input0

root@/home/user1# lsusb

Bus 002 Device 004: ID 0451:926b Texas Instruments, Inc. TUSB9260 Boot Loader
Bus 002 Device 003: ID 08bb:29c6 Texas Instruments PCM2906C Audio CODEC
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  • wake-up information:
    1, using RTC to wake-up system, after 10 seconds
    root@/home/user1# rtcwake -d rtc1 -m standby -s 10
    rtcwake: wakeup from "standby" using rtc1 at Mon Feb 5 16:08:58 2018
    Feb 6 01:09:04 plum kernel: [ 555.984729] PM: suspend entry (shallow)
    Feb 6 01:09:04 plum kernel: [ 555.984743] PM: Syncing filesystems ... done.
    Feb 6 01:09:04 plum kernel: [ 555.985711] Freezing user space processes ... (elapsed 0.001 seconds) done.
    Feb 6 01:09:04 plum kernel: [ 555.987620] OOM killer disabled.
    Feb 6 01:09:04 plum kernel: [ 555.987624] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    Feb 6 01:09:04 plum kernel: [ 555.989039] Suspending console(s) (use no_console_suspend to debug)
    Feb 6 01:09:04 plum kernel: [ 556.019930] pm33xx pm33xx: PM: Successfully put all powerdomains to target state
    Feb 6 01:09:04 plum kernel: [ 556.019930] PM: Wakeup source MPU_WAKE
    Feb 6 01:09:04 plum kernel: [ 556.044644] net eth0: initializing cpsw version 1.12 (0)
    Feb 6 01:09:04 plum kernel: [ 556.130921] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:02: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:02, irq=55)
    Feb 6 01:09:04 plum kernel: [ 556.133689] net eth1: initializing cpsw version 1.12 (0)
    Feb 6 01:09:04 plum kernel: [ 556.218939] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:03: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:03, irq=56)
    Feb 6 01:09:04 plum kernel: [ 561.968330] usb 2-1: reset high-speed USB device number 2 using musb-hdrc
    Feb 6 01:09:04 plum kernel: [ 562.412221] usb 2-1.1: reset full-speed USB device number 3 using musb-hdrc
    Feb 6 01:09:04 plum kernel: [ 562.596221] usb 2-1.3: reset high-speed USB device number 4 using musb-hdrc
    Feb 6 01:09:04 plum kernel: [ 562.699061] OOM killer enabled.
    root@plum:/home/user1# Feb 6 01:09:04 plum kernel: [ 562.699106] Restarting tasks ... done.
    Feb 6 01:09:04 plum kernel: [ 562.724897] PM: suspend exit
    Feb 6 01:09:45 plum kernel: [ 604.007854] cpsw 4a100000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    Feb 6 01:09:45 plum kernel: [ 604.016661] NOHZ: local_softirq_pending 08
    Feb 6 01:09:46 plum kernel: [ 604.416671] NOHZ: local_softirq_pending 08

    note: PM: Wakeup source MPU_WAKE

    2, using gpio0(number 23) button ( with usb1 connnected to a LTE module)
    the system cannot wake-up immediately when push the button(gpio0-23) , resumed after 10 seconds.

    root@/user1# rtcwake -d rtc1 -m standby -s 10
    rtcwake: wakeup from "standby" using rtc1 at Mon Feb 5 16:03:24 2018
    Feb 6 01:03:13 plum kernel: [ 226.444037] PM: suspend entry (shallow)
    Feb 6 01:03:13 plum kernel: [ 226.444052] PM: Syncing filesystems ... done.
    Feb 6 01:03:24 plum kernel: [ 226.458717] Freezing user space processes ... (elapsed 0.001 seconds) done.
    Feb 6 01:03:24 plum kernel: [ 226.460502] OOM killer disabled.
    Feb 6 01:03:24 plum kernel: [ 226.460506] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    Feb 6 01:03:24 plum kernel: [ 226.462001] Suspending console(s) (use no_console_suspend to debug)
    Feb 6 01:03:24 plum kernel: [ 226.492004] pm33xx pm33xx: PM: Successfully put all powerdomains to target state
    Feb 6 01:03:24 plum kernel: [ 226.492004] PM: Wakeup source GPIO0
    Feb 6 01:03:24 plum kernel: [ 226.517135] net eth0: initializing cpsw version 1.12 (0)
    Feb 6 01:03:24 plum kernel: [ 226.602983] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:02: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:02, irq=55)
    Feb 6 01:03:24 plum kernel: [ 226.606124] net eth1: initializing cpsw version 1.12 (0)
    Feb 6 01:03:24 plum kernel: [ 226.690963] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:03: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:03, irq=56)
    Feb 6 01:03:24 plum kernel: [ 232.240434] usb 2-1: reset high-speed USB device number 2 using musb-hdrc
    Feb 6 01:03:24 plum kernel: [ 232.684326] usb 2-1.1: reset full-speed USB device number 3 using musb-hdrc
    Feb 6 01:03:24 plum kernel: [ 232.868329] usb 2-1.3: reset high-speed USB device number 4 using musb-hdrc
    Feb 6 01:03:24 plum kernel: [ 232.971188] OOM killer enabled.
    root@plum:/home/user1# Feb 6 01:03:24 plum kernel: [ 232.971234] Restarting tasks ... done.
    Feb 6 01:03:24 plum kernel: [ 232.996924] PM: suspend exit
    Feb 6 01:03:29 plum kernel: [ 238.114287] cpsw 4a100000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    Feb 6 01:03:29 plum kernel: [ 238.208596] NOHZ: local_softirq_pending 08

    note: PM: Wakeup source GPIO0

  • Hi,

    I am trying to understand the usb topology on your board. You mentioned AM335x USB1 is connected to a LTE module, but

    user5102395
    [ 3.649802] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [ 3.657315] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
    [ 3.657575] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    ...
    [ 4.100361] usb 2-1: new high-speed USB device number 2 using musb-hdrc
    [ 4.260516] usb 2-1: New USB device found, idVendor=0424, idProduct=2514
    [ 4.272344] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [ 4.288921] hub 2-1:1.0: USB hub found
    [ 4.296405] hub 2-1:1.0: 4 ports detected

    USB1 is enumerated as USB bus2, which is connected to a 4-port USB hub. Can you please explain?

    By the way, is the LTE module permanently mounted on the board or connected to a USB connector?

    Can you reproduce the same problem on any AM335x EVM, such as the GP EVM, Starter Kit, or Beaglebone Black?

  • In reply to Bin Liu:

    Dear Bin Liu

       Yes, just as you mentioned, the LTE module is permanently mounted on  an expand board which connect to main board through an XIO connection. 

       Exactly as the log showed,  USB1 is connect to a 4 ports hub, and one of the port is connect to the LTE module. 

     

    I have no any AM335x EVM, test board or Starter Kit,  

  • In reply to user5102395:

    Hi,

    You are disabling AM335x USB module through devicetree, so I am trying to understand is the am335x usb module or the LTE modem which affects the GPIO wakeup. Please answer my following questions.

    What is the 'XIO' connection? I am not familiar with the term.
    Where is the hub located? on the main board or the expansion board with the LTE module?
    Your kernel log shows two devices connected to the hub, TUSB9260 and PCM2906C. Which one is the LTE modem? Or the modem is not connected in that test?

    If you use command 'echo standby > /sys/power/state' instead of 'rtcwake -d rtc1 -m standby -s 10' to put the system into standby mode, can you use the GPIO button to wake up the system?

    By the way, it shouldn't be related to this issue, but the resister R189 is too high, please replace it with a 0-ohm resister.
  • In reply to Bin Liu:

    Hi, Bin Liu:

       Sorry to not explain clearly about the XIO connection and the expansion board. the XIO is as follows

    which connect with an expansion board.  

    On the test environment,  AD[15:0] on the expansion board is used for I/O and not connect to anything.

    SPI1 is used for the bus of the expansion board. and the USB1 is connected to a hub which located in the expansion board.

    TUSB9260 is a bridge which change data form USB to Serial ATA, but not connected with any Serial ATA devices.

     PCM2906C is refer to  audio device. 

    After confirmed the hardware expansion board, Actually, the LTE modem does not connect to the USB1 hub in the test environment.

    I also use command 'echo standby > /sys/power/state' , the GPIO button can wake up the system if not use USB1 connection. 

    thanks for the attention about the R189, I will tell the hardware team to consider it.

      

  • In reply to user5102395:

    Hi,

    Thanks for the clarification.

    user5102395
    I also use command 'echo standby > /sys/power/state' , the GPIO button can wake up the system if not use USB1 connection. 

    but gpio button doesn' wake up if use USB1 in this test, correct?

    If you enable USB1 in devicetree as mentioned in your first post, but don't connect the expansion board to the main board, (basically the hub and its down stream devices are not attached to USB1), can you use the gpio button to wake up?

  • In reply to Bin Liu:

    Dear Bin Liu:

       gpio(bank0)  button can not wake up the system in the conditions as follows:

           1, use USB1 in the devicetrees 

           2, the expansion board connected to the main board

           3,  Linux(kernel 4.14.71) based on ROCESSOR-SDK-AM335X( kernel 4.14.y branch)

        1 and 2  and 3

    gpio(bank0) button can wake up the system in every one of the following conditions is satisfied

        1,  not use USB1 in the devicetrees

        2,  the expansion board not connected to the main board

       3,   Linux kernel(3.14.79) based on ROCESSOR-SDK-AM335X( kernel 3.14.y )

      1 or  2 or 3

  • In reply to user5102395:

    Hi,

    Please just confirm - does the issue happen in the following condition?
    - usb1 is enabled in devicetree;
    - the expansion board is NOT connected to the main board;
    - using kernel v4.14.71.

    If I can use Beaglebone Black to test the use case with gpio0_26 or gpio0_27.
  • In reply to Bin Liu:

    Dear Bin Liu:

      The issue did not happen in the condition you mentioned,  because the expansion board is NOT connected to the main board.(that is means, usb1 pin is not connected with any devices in the test environment).

     of course, you can use Beaglebone Black board to test it.   According to its PCB, there are two USB1 connectors.

     

  • In reply to user5102395:

    Hi,

    Yes, the BBB has USB1 port in host mode, and gpio0_26 and gpio0_27 on the expansion header. I can use them to run the test case.
    Do you think if I connect any usb device (for example, a thumb drive) to the BBB USB1 host port, and use gpio0_26/27 to wake up from system standby, this issue should happen?
    If not, how should I make the BBB setup to close to your use case?