Detecting USB from U-Boot

Hi Team,

Processor used: RZG2N

I need to check USB from Uboot, for that I used this command

"usb start"

the output is 

starting USB...
Bus usb@ee000000:

After some time reset happens.

I don't know if I am missing something.

Please help.

Thanks and regards,

Kartha

Parents
  • Hi Kartha,
    Could you please provide more details? What branch are you using (v2021.10/rz)? 
    You should do more debugging by yourself to assist you further.
    Kind Regards.

  • Hi PT_Renesas,

    This is the current branch i am using in uboot

    vishnu@vishnu-Latitude-3520:~/BUILD_SCRIPTS/rzg2_bsp_scripts/build_scripts/renesas-u-boot-cip$ git branch
    master
    * v2021.10/rz

    We took both USB 3.0 and USB 2.0. 

    And USB 2.0 is connected to a HUB (USB3503-ML).

    USB 3.0 is direct to the connector.

    Thanks and regards,

    Kartha.

  • Hi Kartha,
    Have you included the ehci0 and ehci1 interfaces in your dtb?
    You can have a look on this file <uboot-dir>/arch/arm/dts/r8a774b1.dtsi for your reference.
    Kind Regards.

  • Hi PT_Renesas,

    Thanks for your reply.

    I have some progress in this area. But not fully solved the issue.

    Initially none of my USB device were working, when I give the USB start command in uboot the entire system was stuck. 

    I found why this happened - This is because the clock for USB 3.0 is given from a clock generator IC and unfortunately the Enable pin of this IC was not asserted. After correcting this in the hardware the problem solved.

    And I could see the following output when run usb start command

    starting USB...
    Bus usb@ee000000: Pin already used as gpio
    Register 2000120 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    Bus usb@ee080100: Pin already used as gpio
    USB EHCI 1.10
    Bus usb@ee0a0100: USB EHCI 1.10
    scanning bus usb@ee000000 for devices... Pin already used as gpio
    1 USB Device(s) found
    scanning bus usb@ee080100 for devices... 2 USB Device(s) found
    scanning bus usb@ee0a0100 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 1 Storage Device(s) found

    And when usb tree command is given this was the output

    USB device tree:
    1 Hub (5 Gb/s, 0mA)
    U-Boot XHCI Host Controller

    1 Hub (480 Mb/s, 0mA)
    | u-boot EHCI Host Controller
    |
    +-2 Mass Storage (480 Mb/s, 224mA)
    USB SanDisk 3.2Gen1 0401a2f93e752dd3618b8de83a664a7

    1 Hub (480 Mb/s, 0mA)
    u-boot EHCI Host Controller

    The above message come because I have connected a usb thumb (usb 3.2) drive in my USB2-0 port which is directly terminating to a USB port.

    When the thumb (usb 3.2) drive is connected to USB 3 port following this the output for usb start command

    starting USB...
    Bus usb@ee000000: Pin already used as gpio
    Register 2000120 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    Bus usb@ee080100: USB EHCI 1.10
    Bus usb@ee0a0100: USB EHCI 1.10
    scanning bus usb@ee000000 for devices... Pin already used as gpio
    2 USB Device(s) found
    scanning bus usb@ee080100 for devices... 1 USB Device(s) found
    scanning bus usb@ee0a0100 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 1 Storage Device(s) found

    and usb tree gives the follwing message

    USB device tree:
    1 Hub (5 Gb/s, 0mA)
    | U-Boot XHCI Host Controller
    |
    +-2 Mass Storage (5 Gb/s, 224mA)
    USB SanDisk 3.2Gen1 0401a2f93e752dd3618b8de83a664a7

    1 Hub (480 Mb/s, 0mA)
    u-boot EHCI Host Controller

    1 Hub (480 Mb/s, 0mA)
    u-boot EHCI Host Controller

    Following modification I have done in the device tree of uboot and Kernel

    Added below section:

    &gpio6 {


    usb1-reset-hog {
    gpio-hog;
    gpios = <10 GPIO_ACTIVE_LOW>;
    output-low;
    line-name = "usb1-reset";
    };

    usb0-power-enable {
    gpio-hog;
    gpios = <24 GPIO_ACTIVE_HIGH>;
    output-high;
    line-name = "usb0-power-enable";
    };

    usb30-power-enable {
    gpio-hog;
    gpios = <28 GPIO_ACTIVE_HIGH>;
    output-high;
    line-name = "usb30-power-enable";
    };


    };

    There is a power enable mosfet in both VBUS of USB 3 and USB 2, which need to be turned on to supply voltage to the VUSB pins, The above section always turn on those pins and enable the mosfet to give power to the USB 

    Problem I am facing now:

    In u-boot both USB 3 and USB 2-0 is detecting the mass storage, which u can see from the usb tree command.

    But when coming to kernel, after logging in USB 3 is only detecting mass storage USB 2-0 is not detecting any thing and does not give any trace in dmesg command.

    Following is the message coming after connecting the thumb drive to USB 3.0 

    root@hihope-rzg2n:~# [ 28.175607] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-renesas-hcd
    [ 28.222329] usb-storage 2-1:1.0: USB Mass Storage device detected
    [ 28.231423] scsi host0: usb-storage 2-1:1.0
    [ 29.248951] scsi 0:0:0:0: Direct-Access USB SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
    [ 29.258260] sd 0:0:0:0: [sda] 60125184 512-byte logical blocks: (30.8 GB/28.7 GiB)
    [ 29.269039] sd 0:0:0:0: [sda] Write Protect is off
    [ 29.274640] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
    [ 29.298930] sda: sda1
    [ 29.308277] sd 0:0:0:0: [sda] Attached SCSI removable disk

    and the demesg is 

    root@hihope-rzg2n:~# dmesg | grep -i usb
    [ 0.066508] usbcore: registered new interface driver usbfs
    [ 0.066540] usbcore: registered new interface driver hub
    [ 0.066567] usbcore: registered new device driver usb
    [ 0.119281] gpio-370 (usb1-reset): hogged as output/low
    [ 0.119307] gpio-384 (usb0-power-enable): hogged as output/high
    [ 0.119327] gpio-388 (usb30-power-enable): hogged as output/high
    [ 1.490056] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.506855] ehci-platform ee0a0100.usb: EHCI Host Controller
    [ 1.512540] ehci-platform ee0a0100.usb: new USB bus registered, assigned bus number 1
    [ 1.520482] ehci-platform ee0a0100.usb: irq 214, io mem 0xee0a0100
    [ 1.538832] ehci-platform ee0a0100.usb: USB 2.0 started, EHCI 1.10
    [ 1.545443] hub 1-0:1.0: USB hub found
    [ 1.553628] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 1.569990] ohci-platform ee0a0000.usb: Generic Platform OHCI controller
    [ 1.576729] ohci-platform ee0a0000.usb: new USB bus registered, assigned bus number 2
    [ 1.584634] ohci-platform ee0a0000.usb: irq 214, io mem 0xee0a0000
    [ 1.681259] hub 2-0:1.0: USB hub found
    [ 1.697955] xhci-renesas-hcd ee000000.usb: xHCI Host Controller
    [ 1.703896] xhci-renesas-hcd ee000000.usb: new USB bus registered, assigned bus number 3
    [ 1.727862] xhci-renesas-hcd ee000000.usb: hcc params 0x014051ce hci version 0x100 quirks 0x0000000000830410
    [ 1.737734] xhci-renesas-hcd ee000000.usb: irq 211, io mem 0xee000000
    [ 1.744299] xhci-renesas-hcd ee000000.usb: xHCI Host Controller
    [ 1.750233] xhci-renesas-hcd ee000000.usb: new USB bus registered, assigned bus number 4
    [ 1.758340] xhci-renesas-hcd ee000000.usb: Host supports USB 3.0 SuperSpeed
    [ 1.765674] hub 3-0:1.0: USB hub found
    [ 1.773566] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
    [ 1.781936] hub 4-0:1.0: USB hub found
    [ 1.790159] usbcore: registered new interface driver usb-storage
    [ 1.796728] renesas_usbhs e6590000.usb: host probed
    [ 1.801636] renesas_usbhs e6590000.usb: no transceiver found
    [ 1.807375] renesas_usbhs e6590000.usb: gadget probed
    [ 1.812615] renesas_usbhs e6590000.usb: probed
    [ 1.818037] renesas_usb3 ee020000.usb: probed with phy
    [ 1.823829] usbcore: registered new interface driver usbtouchscreen
    [ 1.979986] usbcore: registered new interface driver usbhid
    [ 1.985582] usbhid: USB HID core driver
    [ 2.159264] phy_rcar_gen3_usb2 ee080200.usb-phy: Error applying setting, reverse things back
    [ 2.238849] ehci-platform ee080100.usb: EHCI Host Controller
    [ 2.244556] ehci-platform ee080100.usb: new USB bus registered, assigned bus number 5
    [ 2.252451] ehci-platform ee080100.usb: irq 213, io mem 0xee080100
    [ 2.678941] ehci-platform ee080100.usb: USB 2.0 started, EHCI 1.10
    [ 2.685762] hub 5-0:1.0: USB hub found
    [ 2.694213] ohci-platform ee080000.usb: Generic Platform OHCI controller
    [ 2.700974] ohci-platform ee080000.usb: new USB bus registered, assigned bus number 6
    [ 2.708903] ohci-platform ee080000.usb: irq 213, io mem 0xee080000
    [ 2.791418] usb 4-1: new SuperSpeed Gen 1 USB device number 2 using xhci-renesas-hcd
    [ 2.805463] hub 6-0:1.0: USB hub found
    [ 2.851191] usb-storage 4-1:1.0: USB Mass Storage device detected
    [ 2.857646] scsi host0: usb-storage 4-1:1.0
    [ 3.872030] scsi 0:0:0:0: Direct-Access USB SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6

    Following is the dmesg after connecting thumb drive to usb 2-0

    dmesg | grep -i usb
    [ 0.066508] usbcore: registered new interface driver usbfs
    [ 0.066540] usbcore: registered new interface driver hub
    [ 0.066567] usbcore: registered new device driver usb
    [ 0.119281] gpio-370 (usb1-reset): hogged as output/low
    [ 0.119307] gpio-384 (usb0-power-enable): hogged as output/high
    [ 0.119327] gpio-388 (usb30-power-enable): hogged as output/high
    [ 1.490056] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.506855] ehci-platform ee0a0100.usb: EHCI Host Controller
    [ 1.512540] ehci-platform ee0a0100.usb: new USB bus registered, assigned bus number 1
    [ 1.520482] ehci-platform ee0a0100.usb: irq 214, io mem 0xee0a0100
    [ 1.538832] ehci-platform ee0a0100.usb: USB 2.0 started, EHCI 1.10
    [ 1.545443] hub 1-0:1.0: USB hub found
    [ 1.553628] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 1.569990] ohci-platform ee0a0000.usb: Generic Platform OHCI controller
    [ 1.576729] ohci-platform ee0a0000.usb: new USB bus registered, assigned bus number 2
    [ 1.584634] ohci-platform ee0a0000.usb: irq 214, io mem 0xee0a0000
    [ 1.681259] hub 2-0:1.0: USB hub found
    [ 1.697955] xhci-renesas-hcd ee000000.usb: xHCI Host Controller
    [ 1.703896] xhci-renesas-hcd ee000000.usb: new USB bus registered, assigned bus number 3
    [ 1.727862] xhci-renesas-hcd ee000000.usb: hcc params 0x014051ce hci version 0x100 quirks 0x0000000000830410
    [ 1.737734] xhci-renesas-hcd ee000000.usb: irq 211, io mem 0xee000000
    [ 1.744299] xhci-renesas-hcd ee000000.usb: xHCI Host Controller
    [ 1.750233] xhci-renesas-hcd ee000000.usb: new USB bus registered, assigned bus number 4
    [ 1.758340] xhci-renesas-hcd ee000000.usb: Host supports USB 3.0 SuperSpeed
    [ 1.765674] hub 3-0:1.0: USB hub found
    [ 1.773566] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
    [ 1.781936] hub 4-0:1.0: USB hub found
    [ 1.790159] usbcore: registered new interface driver usb-storage
    [ 1.796728] renesas_usbhs e6590000.usb: host probed
    [ 1.801636] renesas_usbhs e6590000.usb: no transceiver found
    [ 1.807375] renesas_usbhs e6590000.usb: gadget probed
    [ 1.812615] renesas_usbhs e6590000.usb: probed
    [ 1.818037] renesas_usb3 ee020000.usb: probed with phy
    [ 1.823829] usbcore: registered new interface driver usbtouchscreen
    [ 1.979986] usbcore: registered new interface driver usbhid
    [ 1.985582] usbhid: USB HID core driver
    [ 2.159264] phy_rcar_gen3_usb2 ee080200.usb-phy: Error applying setting, reverse things back
    [ 2.238849] ehci-platform ee080100.usb: EHCI Host Controller
    [ 2.244556] ehci-platform ee080100.usb: new USB bus registered, assigned bus number 5
    [ 2.252451] ehci-platform ee080100.usb: irq 213, io mem 0xee080100
    [ 2.678941] ehci-platform ee080100.usb: USB 2.0 started, EHCI 1.10
    [ 2.685762] hub 5-0:1.0: USB hub found
    [ 2.694213] ohci-platform ee080000.usb: Generic Platform OHCI controller
    [ 2.700974] ohci-platform ee080000.usb: new USB bus registered, assigned bus number 6
    [ 2.708903] ohci-platform ee080000.usb: irq 213, io mem 0xee080000
    [ 2.791418] usb 4-1: new SuperSpeed Gen 1 USB device number 2 using xhci-renesas-hcd
    [ 2.805463] hub 6-0:1.0: USB hub found
    [ 2.851191] usb-storage 4-1:1.0: USB Mass Storage device detected
    [ 2.857646] scsi host0: usb-storage 4-1:1.0
    [ 3.872030] scsi 0:0:0:0: Direct-Access USB SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
    [ 87.722891] usb 4-1: USB disconnect, device number 2

    When connecting USB thumb to USB 3.0 following is the out put of lsusb

    root@hihope-rzg2n:~# lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 002: ID 0781:5567 SanDisk Corp. Cruzer Blade
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    When thumb drive is connected to USB2-0 the out put of lsusb is 

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Conclusion: USB 3.0 is working fine, but USB2-0 is detecting a mass storage device in uboot only when comes to kernel its not working.

    Can you please let me know any debugging method or possible reason for this behaviour.

    For your knowledge, the usb 2-0 is terminating to a usb port and USB 2-1 is connected to a usb HUB.

    Thanks and regards,

    Kartha.

  • Try: 

    echo host > /sys/devices/platform/soc/ee080200.usb-phy/role

  • Hi MicBis,

    Thanks a lot for your suggestion.

    Now USB 2-0 is working fine.

    Thanks and regards,

    Kartha.

Reply Children
No Data