bootstd: Add a USB hunter

Add a hunter for USB which enumerates the bus to find new bootdevs.

Update the tests and speed up bootdev_test_prio() while we are here, by
dropping the USB delays.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-01-17 10:47:37 -07:00
committed by Tom Rini
parent 8b03187121
commit 04fb2b6e45
2 changed files with 33 additions and 5 deletions

View File

@@ -20,6 +20,11 @@ static int usb_bootdev_bind(struct udevice *dev)
return 0;
}
static int usb_bootdev_hunt(struct bootdev_hunter *info, bool show)
{
return usb_init();
}
struct bootdev_ops usb_bootdev_ops = {
};
@@ -35,3 +40,10 @@ U_BOOT_DRIVER(usb_bootdev) = {
.bind = usb_bootdev_bind,
.of_match = usb_bootdev_ids,
};
BOOTDEV_HUNTER(usb_bootdev_hunter) = {
.prio = BOOTDEVP_3_SCAN_SLOW,
.uclass = UCLASS_USB,
.hunt = usb_bootdev_hunt,
.drv = DM_DRIVER_REF(usb_bootdev),
};