summaryrefslogtreecommitdiff
path: root/drivers/usb/host/usb_bootdev.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 10:47:37 -0700
committerTom Rini <trini@konsulko.com>2023-01-23 18:11:40 -0500
commit04fb2b6e45893df45a7d6bed61614fce97c279e4 (patch)
tree259017d9a61483a7ec3aa0e9b16c48fe5bcabb2d /drivers/usb/host/usb_bootdev.c
parent8b031871218689e72ecf517ad6d584ae4c659aad (diff)
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>
Diffstat (limited to 'drivers/usb/host/usb_bootdev.c')
-rw-r--r--drivers/usb/host/usb_bootdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/host/usb_bootdev.c b/drivers/usb/host/usb_bootdev.c
index b2d157faf33..66d0b6ae8f5 100644
--- a/drivers/usb/host/usb_bootdev.c
+++ b/drivers/usb/host/usb_bootdev.c
@@ -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),
+};