public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: John Clark <inindev@gmail.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>, John Clark <inindev@gmail.com>
Subject: [PATCH] bootstd: USB devtype detection for script boot
Date: Fri, 30 Jun 2023 13:12:14 -0400	[thread overview]
Message-ID: <20230630171214.2554-1-inindev@gmail.com> (raw)

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>
---

 boot/bootmeth_script.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c
index 225eb18ee6..a4050c384d 100644
--- a/boot/bootmeth_script.c
+++ b/boot/bootmeth_script.c
@@ -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)
-- 
2.39.2


             reply	other threads:[~2023-06-30 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 17:12 John Clark [this message]
2023-07-01 19:10 ` [PATCH] bootstd: USB devtype detection for script boot Simon Glass
2023-07-01 19:12   ` Simon Glass
2023-07-23 13:22     ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2023-06-27 14:38 John Clark
2023-06-28  7:42 ` Simon Glass
     [not found]   ` <29e2bbad-b23c-4179-7e9f-dabdb92108e0@gmail.com>
2023-06-29 19:09     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230630171214.2554-1-inindev@gmail.com \
    --to=inindev@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox