u-boot/test/boot
Jerome Forissier 1c0f6999b5 dm: usb: initialize and scan multiple buses simultaneously with uthread
Use the uthread framework to initialize and scan USB buses in parallel
for better performance. The console output is slightly modified with a
final per-bus report of the number of devices found, common to UTHREAD
and !UTHREAD. The USB tests are updated accordingly.

Tested on two platforms:

1. arm64 QEMU on a somewhat contrived example (4 USB buses, each with
one audio device, one keyboard, one mouse and one tablet)

 $ make qemu_arm64_defconfig
 $ make -j$(nproc) CROSS_COMPILE="ccache aarch64-linux-gnu-"
 $ qemu-system-aarch64 -M virt -nographic -cpu max -bios u-boot.bin \
     $(for i in {1..4}; do echo -device qemu-xhci,id=xhci$i \
         -device\ usb-{audio,kbd,mouse,tablet},bus=xhci$i.0; \
     done)

2. i.MX93 EVK (imx93_11x11_evk_defconfig) with two USB hubs, each with
one webcam and one ethernet adapter, resulting in the following device
tree:

 USB device tree:
   1  Hub (480 Mb/s, 0mA)
   |  u-boot EHCI Host Controller
   |
   +-2  Hub (480 Mb/s, 100mA)
     |  GenesysLogic USB2.1 Hub
     |
     +-3  Vendor specific (480 Mb/s, 350mA)
     |    Realtek USB 10/100/1000 LAN 001000001
     |
     +-4   (480 Mb/s, 500mA)
           HD Pro Webcam C920 8F7CD51F

   1  Hub (480 Mb/s, 0mA)
   |  u-boot EHCI Host Controller
   |
   +-2  Hub (480 Mb/s, 100mA)
     |   USB 2.0 Hub
     |
     +-3  Vendor specific (480 Mb/s, 200mA)
     |    Realtek USB 10/100/1000 LAN 000001
     |
     +-4   (480 Mb/s, 500mA)
          Generic OnLan-CS30 201801010008

Note that i.MX was tested on top of the downstream repository [1] since
USB doesn't work in the upstream master branch.

[1] https://github.com/nxp-imx/uboot-imx/tree/lf-6.6.52-2.2.0
    commit 6c4545203d12 ("LF-13928 update key for capsule")

The time spent in usb_init() ("usb start" command) is reported on
the console. Here are the results:

        | CONFIG_UTHREAD=n | CONFIG_UTHREAD=y
--------+------------------+-----------------
QEMU    |          5628 ms |          2212 ms
i.MX93  |          4591 ms |          2441 ms

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-04-23 13:19:44 -06:00
..
files expo: Support menu-item values in cedit 2024-10-18 14:10:22 -06:00
bootdev.c dm: usb: initialize and scan multiple buses simultaneously with uthread 2025-04-23 13:19:44 -06:00
bootflow.c dm: usb: initialize and scan multiple buses simultaneously with uthread 2025-04-23 13:19:44 -06:00
bootm.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
bootmeth.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
bootstd_common.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
bootstd_common.h test: Update bootstd to do init from tests 2025-02-11 20:10:59 -06:00
cedit.c expo: Support menu-item values in cedit 2024-10-18 14:10:22 -06:00
expo.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
image.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
Makefile Kbuild: Always use $(PHASE_) 2025-04-11 12:16:44 -06:00
measurement.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
upl.c test: Drop suites.h 2025-02-11 20:12:36 -06:00
vbe_fixup.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
vbe_simple.c test: Drop suites.h 2025-02-11 20:12:36 -06:00