diff options
author | Simon Glass | 2022-04-24 23:31:23 -0600 |
---|---|---|
committer | Tom Rini | 2022-04-25 10:00:04 -0400 |
commit | 0ccb0ac5d8fa8e03ba57b364133b7f033c2d52c1 (patch) | |
tree | 4486092416d85c711292e665290b8b0d05517faa /common | |
parent | d9409244b309959ac8dd79fc88d2c42f23c62f8c (diff) |
bootstd: usb: Add a bootdev driver
Add a bootdev driver for USB host. It can use the distro boot mechanism to
locate a file, or any other available bootmeth.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_storage.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c index 291728f37e0..eaa31374ef7 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -34,6 +34,7 @@ #include <common.h> #include <blk.h> +#include <bootdev.h> #include <command.h> #include <dm.h> #include <errno.h> @@ -243,6 +244,16 @@ static int usb_stor_probe_device(struct usb_device *udev) ret = blk_probe_or_unbind(dev); if (ret) return ret; + + ret = bootdev_setup_sibling_blk(dev, "usb_bootdev"); + if (ret) { + int ret2; + + ret2 = device_unbind(dev); + if (ret2) + return log_msg_ret("bootdev", ret2); + return log_msg_ret("bootdev", ret); + } } #else /* We don't have space to even probe if we hit the maximum */ |