]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstd: USB devtype detection for script boot
authorJohn Clark <inindev@gmail.com>
Fri, 30 Jun 2023 17:12:14 +0000 (13:12 -0400)
committerSimon Glass <sjg@chromium.org>
Thu, 20 Jul 2023 20:10:57 +0000 (14:10 -0600)
Change the device type from "usb_mass_storage" to "usb" when
booting a script.

Before this change:
   => printenv devtype
   devtype=usb_mass_storage

After this change:
   => printenv devtype
   devtype=usb

Signed-off-by: John Clark <inindev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/bootmeth_script.c

index 225eb18ee6ca7ddeec22ffaa08a7bad4d735f5de..a4050c384dfaf11cb79f9b3553209879e1396d43 100644 (file)
@@ -190,7 +190,10 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow)
        ulong addr;
        int ret;
 
-       ret = env_set("devtype", blk_get_devtype(bflow->blk));
+       if (desc->uclass_id == UCLASS_USB)
+               ret = env_set("devtype", "usb");
+       else
+               ret = env_set("devtype", blk_get_devtype(bflow->blk));
        if (!ret)
                ret = env_set_hex("devnum", desc->devnum);
        if (!ret)