From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F167C001B1 for ; Tue, 27 Jun 2023 14:39:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5069784728; Tue, 27 Jun 2023 16:39:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="opS9kkRH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ACFDD865E4; Tue, 27 Jun 2023 16:39:13 +0200 (CEST) Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AB02A84728 for ; Tue, 27 Jun 2023 16:39:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=inindev@gmail.com Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-57012b2973eso51329137b3.2 for ; Tue, 27 Jun 2023 07:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687876745; x=1690468745; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Q5ZIdwOCOou6yh4e/tGXkM9mopDD7pj0Uq9aUQftGvY=; b=opS9kkRH7xdp+R0k/rPhm9nc+0OGioLaRyhje0/eux3PSdqXf9XjAa1cpPvcGSk7fA pNy4+Bpz/GYsvjk3iqUrk44ZC9axeNkKIomAae+ALIIqqVesFsHcE5n0Jr4Es4JLuDtk klm3u31V0FZloXFQY/JXeGrLOTkMeQ9qzR6sAhEYT7MvoH+1pnBmwXuKxG1Ybgd0RYjU 0/YUTKmu1Yi/nKUtNCL1/6sVLx7PVKlX69F4YXYXSyf/uxK71/4NW7kxq/PC7bYU/Y86 8GbY6aF3Xg2MYPsTTv78pj8rMXfCc7MwkcJxAMTe5JdxPAhHwUeYNjnuOVEr8uXBXEWm Ou/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687876745; x=1690468745; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Q5ZIdwOCOou6yh4e/tGXkM9mopDD7pj0Uq9aUQftGvY=; b=UTyiM/DK1ABqcMRw4WTceVLxwoJNxyvmUIPGSPlq6F3cmrO1rUSebh8TebxJJvuhQz fSWEgyr2bv773ZSdjavRyJJU7pZBs+No7YI1VHuQzJM+rkBAFmuLXtIwraBfkfQ1BHtu O0QlXLkhSkHLW6wmeH697iAq0vi0XSiOPpwf+1wixcO3pYNZAJqj7JML4y/2T8OJotn/ Mdy23IUM0IsSLQ2eW9JKFVPzM//xYtSjywie2mXwZ3xQCC9UtL0kP0QcQ95Nx8zll9Vm UPipDOGUjN2B7LSjZWnbVg3bWG5G4wRAEeh1HYiRXuF3PtJF34Ra4Zqqzldq6dghwpW2 5EVg== X-Gm-Message-State: AC+VfDwEYwP1QkvdJuwYkh3aPbqXZiTo7xJjJXF8EUSJrkw31QjXSd+X u5N7T3CQIFUdzea43/bJ4lxaiTTraJk= X-Google-Smtp-Source: ACHHUZ46rOsSJPHvWfz3aSRho9yU9jb07ErlVabel5iCKVFt/N3aDA7rEc7OnAnULKRIP0vpf6B7Zg== X-Received: by 2002:a81:6942:0:b0:568:f2c:ee43 with SMTP id e63-20020a816942000000b005680f2cee43mr36916365ywc.2.1687876745123; Tue, 27 Jun 2023 07:39:05 -0700 (PDT) Received: from localhost.localdomain ([192.34.165.40]) by smtp.gmail.com with ESMTPSA id y62-20020a81a141000000b0057048db0898sm1855671ywg.138.2023.06.27.07.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 07:39:04 -0700 (PDT) From: John Clark To: u-boot@lists.denx.de Cc: Simon Glass , John Clark Subject: [PATCH] bootstd: USB devtype detection for script boot Date: Tue, 27 Jun 2023 10:38:58 -0400 Message-Id: <20230627143859.18688-1-inindev@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 --- boot/bootmeth_script.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c index 225eb18ee6..9fdadb3005 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -187,10 +187,14 @@ static int script_set_bootflow(struct udevice *dev, struct bootflow *bflow, static int script_boot(struct udevice *dev, struct bootflow *bflow) { struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); + const char *devtype = blk_get_devtype(bflow->blk); ulong addr; int ret; - ret = env_set("devtype", blk_get_devtype(bflow->blk)); + if (!strcmp("usb_mass_storage", devtype)) + ret = env_set("devtype", "usb"); + else + ret = env_set("devtype", devtype); if (!ret) ret = env_set_hex("devnum", desc->devnum); if (!ret) @@ -198,7 +202,7 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow) if (!ret) ret = env_set("prefix", bflow->subdir); if (!ret && IS_ENABLED(CONFIG_ARCH_SUNXI) && - !strcmp("mmc", blk_get_devtype(bflow->blk))) + !strcmp("mmc", devtype)) ret = env_set_hex("mmc_bootdev", desc->devnum); if (ret) return log_msg_ret("env", ret); -- 2.39.2