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.

AM6442: Accessing USB from u-boot

Part Number: AM6442

Hi,

My customer is asking how to access USB media from u-boot.
Software is SDK Linux v8.0.0.21.
Hardware is GPEVM.

Suppose u-boot is booted from SPI-Flash, access to eMMC or SD card can be done by below command.

=> fatload mmc 1 0x80000000 uEnv.txt

Customer tried similar way for USB media, but it did not work.

=> fatload usb 0 0x80000000 uEnv.txt
=> usb info
USB is stopped. Please issue 'usb start' first.
=> usb start
starting USB...
No working controllers found
=> usb storage
USB is stopped. Please issue 'usb start' first.

What is wrong with this method?

Thanks and regards,
Koichiro Tashiro



  • Hi Koichiro-san,
    I was out of office last few days.
    I'm looping in my colleague on accessing USB on AM64x EVM.
    Best,
    -Hong

  • Hi Tashiro-san,

    To support DFU function, the USB module in U-Boot by default works in device mode, so the U-Boot commands for USB host, such as "usb start", are not supported.

    To make the USB to work in host mode in U-Boot, please modify the U-Boot devicetree to change dr_mode to "host" in the USB node.

  • Hi Bin,

    Thanks for your reply.

    To make the USB to work in host mode in U-Boot, please modify the U-Boot devicetree to change dr_mode to "host" in the USB node.

    Customer changed "dr_mode" to "host" and it worked!

    Customer has additional question for the devicetree.
    The default "dr_mode" setting is "otg", so the USB can be work as host in Linux.
    But it must be changed to "host" for u-boot?
    Is there any way to use the USB as host with "dr_mode" = "otg" in u-boot?

    Customer is planning to use the USB as usb gadget in most cases, but the USB is used as host in case software update.

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san,

    The default "dr_mode" setting is "otg", so the USB can be work as host in Linux.
    But it must be changed to "host" for u-boot?
    Is there any way to use the USB as host with "dr_mode" = "otg" in u-boot?

    Let me review the U-boot USB drivers and do some experiment on the EVM then get back to you on this.