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.

Linux/AM3352: USB HS mode in U-boot

Part Number: AM3352

Tool/software: Linux

Hi expert,

My customer has a requirement that enabling AM3352 USB U-disk read/write functionality in U-boot, after modification of the U-boot code in Linux SDK, the U-disk read/write functionality can be implemented in U-boot, but it just works in full speed mode(1.3Mbps).

Customer has enabled the cache in U-boot and could you please help to give some recommendation? Thanks a lot!

  • Jian,

    Please clarify

    - Which USB port does the customer use, USB0 or USB1?
    - Please share the uboot patch the customer used to modify uboot.
    - What SDK version does the customer use?
    - What do you mean by full speed - 1.3Mbps? USB full-speed is 12Mbps. Do you mean bus clock speed, or USB transfer speed? If latter how did the customer measure it?
    - Please share the details how the cache is enabled.
  • One more question - is this on customer's board or TI EVM? If former, have you tested the same on TI EVM?
  • Hi Bin,
    Thanks for your reply, customer use USB1 for host, and SDK 08.
    Customer enable the cache in U-boot by "#define CONFIG_CMD_CACHE", and test on their board which the USB can work on high speed in kernel.
    I will get more information after Chinese Spring festival, thanks!
  • Hi Bin,

    Clarify as follows,

    - USB1 for usb host
    - I didn't make any changes for the usb module code
    - U-boot version 2015.07 (Not SDK 08), clone from TI git server
    - USB MAX speed only can be 1.3MB/s (not bps), enve if I have set mode as HIGH-SPEED
    - Enable the cache by "#define CONFIG_CMD_CACHE", and use "dcache, icache"command
  • Jian,

    user3814859 said:
    - USB MAX speed only can be 1.3MB/s (not bps), enve if I have set mode as HIGH-SPEED

    It seems like the customer is talking about the USB throughput, not bus link speed. 1.3MB/s throughput is about the right number we can get in U-Boot. What throughput is the customer looking for? With all other implementation in the current U-Boot, 1.3~1.5MB/s is the maximum throughput we can get in U-Boot.

  • Hi Bin,
    Thanks for your reply.
    Customer has two more questions as follows:
    1.Why the USB speed can reach high speed (480Mbps) in the kernel for the same HW? What is the reason of USB speed limit in U-boot?
    2.Is there any method to improve the USB throughput in U-boot?
  • Jian,

    Jian Zhou said:
    1.Why the USB speed can reach high speed (480Mbps) in the kernel for the same HW?

    U-boot and kernel are two different software packages, they operate any hardware module in many different ways. So if kernel has better performance doesn't mean Uboot will do the same.

    Jian Zhou said:
    What is the reason of USB speed limit in U-boot?

    There are implementation differences in the system level and usb drivers comparing to kernel. For example, Kernel uses CPPI DMA for USB transfers, but CPPI DMA is not implemented in Uboot.

    Jian Zhou said:
    2.Is there any method to improve the USB throughput in U-boot?

    I am not aware of any magic "flag" which can immediately improve the USB throughput. So the USB drivers have to be patched to get better performance. Because high USB performance in Uboot is not demanded, so I am not aware of any such development activity in the Uboot community or TI. 

  • Hi Bin,

    Thanks for your reply.

    Higher reading speed is required in my project.
    Since the existing usb driver in U-boot does not meet the requirement of reading speed, can I use the driver in starerware to achieve higher reading speed?
  • Sheng,

    What is the USB throughput required in your project?

    Do yo mean using starterware instead of Uboot in your project? Or taking the usb driver from starterware and port it to Uboot?
  • Bin,

    I want to upgrade the whole system from U-disk in the uboot phase. The upgrade package size is more than 80MB, the faster reading speed the better.

    By contrast, another project, which use ZYNQ processor, only need less than 1min to upgrade system including read from U-disk, check and write to nand flash.

    I mean taking the usb driver from starterware and port it to Uboot.

  • Bin,

    Customer want to update the product system by U-disk in U-boot.

  • Sheng,

    To directly compare with AM335x, what is the USB throughput on the project using ZYNQ processor?

    It would be a huge effort to port the starterware USB driver to uboot, because the two project have completely different software architecture.

    Also the bottleneck might not be in the USB drivers, it also could be a system level problem, then only changing USB drivers might not fix the issue.
  • Sheng,

    Please check the patch in the thread patchwork.ozlabs.org/.../, which just submitted yesterday. I just tested this patch, it gives me 15% improvement in usb read throughput.
  • Bin,

    Thanks for your support!

    I see the patch is modifying the watchdog driver? It has relationship with USB read throughput?

  • Jian,

    Yes, this is discussed in the link I referred for the patch.
  • Bin,

    Thanks for your help. The patch gave me 7% improvement in usb read throughput and the reading speed is 1.4MB/s now. Can reading speed be faster?

  • Sheng,

    Glad you see the speed improved with the patch. But this is all we can get with the current Uboot, I don't have any other patch to further improve the throughput.
  • I got it. Thank you!