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 4B11AC46467 for ; Sun, 8 Jan 2023 03:03:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FB92856FF; Sun, 8 Jan 2023 03:57:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ncskM5Q6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E45485603; Sun, 8 Jan 2023 03:57:05 +0100 (CET) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 AF20085563 for ; Sun, 8 Jan 2023 03:51:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id g2so3301220ila.4 for ; Sat, 07 Jan 2023 18:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vto8et55VsUj6+KWNfr8n/C4gkvcSZvk0dDrP5BBxAo=; b=ncskM5Q68jeo96s5vdfhzYHr9voNGtsNxF4/q9T5SaaIZ0ySR63XvRkXQ6GNSnmoox DaWk6QXIur2mYb2fSlMPvz0LlVr49aKtMQN4dZ44maBOy2tNybZrPTLTVOJo8h6+oyOy M0TgwzEmurhNOEumBmGyKpy/LRqkTxZkE+U3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vto8et55VsUj6+KWNfr8n/C4gkvcSZvk0dDrP5BBxAo=; b=tw4Xa6nLjSZx1T1zoaW/FdYDhm+n2Ob1dz6+Gi4DanLwbOj9+Ju1Kjh7NSg8NOxICI tGZ8iPMcYGF6UOLgO8qEST1TxOr/kEIZFQqB48aY42R9/ixa/SXFZ4QXVkdF30OmSUTK O1ELeCERLxRMdKlQ6bVm2GOgfnwqwflQMgsO4xrlXg11gGkS7G35joJXsL3GlSdLfL5e fCWYSd5nCmkW/nfg2VqGGxGK6U4ScxHgEJADDPpLHwROML4XZc7dxLXwVfLy+n9w4P/b MNd/hElSiigeHYsoGJvnyrTrMTRSX4VAVXHX5MVy5+NpLjfSZ7stgRagXa8u/lyxLTwn aZLA== X-Gm-Message-State: AFqh2kqvo3jmfIonMjMKTL7IbFYnbT8EhcQ6hCaa35dSTqEIHLVKwc0A mYj0IjSt6UisAViNYynb4AXhq2IqcgJ/G5J3 X-Google-Smtp-Source: AMrXdXsDzm1HUdZ7KsUUXPthcUOedTyblza/rXW6lfIlE93u3TULREEsZx0SAjpRHYmILXtuUNSBYQ== X-Received: by 2002:a05:6e02:58a:b0:303:8c18:1283 with SMTP id c10-20020a056e02058a00b003038c181283mr40133161ils.31.1673146295111; Sat, 07 Jan 2023 18:51:35 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id c17-20020a92bd11000000b00302a00aaefasm1622174ile.26.2023.01.07.18.51.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:51:34 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass Subject: [PATCH v2 57/71] bootstd: Use hunters when scanning for bootflows Date: Sat, 7 Jan 2023 19:50:33 -0700 Message-Id: <20230108025047.522240-58-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230108025047.522240-1-sjg@chromium.org> References: <20230108025047.522240-1-sjg@chromium.org> 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.6 at phobos.denx.de X-Virus-Status: Clean Add a flag to control whether hunters are used when scanning for bootflows. Enable it by default and tidy up the flag comments a little. Fow now this has no effect, until a future patch enables this feature. Signed-off-by: Simon Glass --- (no changes since v1) cmd/bootflow.c | 5 ++++- include/bootflow.h | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cmd/bootflow.c b/cmd/bootflow.c index c8b2f5efdeb..fe58de5fa59 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -96,7 +96,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, struct udevice *dev; struct bootflow bflow; bool all = false, boot = false, errors = false, no_global = false; - bool list = false; + bool list = false, no_hunter = false; int num_valid = 0; bool has_args; int ret, i; @@ -115,6 +115,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, errors = strchr(argv[1], 'e'); no_global = strchr(argv[1], 'G'); list = strchr(argv[1], 'l'); + no_hunter = strchr(argv[1], 'H'); argc--; argv++; } @@ -141,6 +142,8 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, flags |= BOOTFLOWF_ALL; if (no_global) flags |= BOOTFLOWF_SKIP_GLOBAL; + if (!no_hunter) + flags |= BOOTFLOWF_HUNT; /* * If we have a device, just scan for bootflows attached to that device diff --git a/include/bootflow.h b/include/bootflow.h index 9c6610bb922..4012f4b8a82 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -91,17 +91,28 @@ struct bootflow { * enum bootflow_flags_t - flags for the bootflow iterator * * @BOOTFLOWF_FIXED: Only used fixed/internal media - * @BOOTFLOWF_SHOW: Show each bootdev before scanning it + * @BOOTFLOWF_SHOW: Show each bootdev before scanning it; show each hunter + * before using it * @BOOTFLOWF_ALL: Return bootflows with errors as well - * @BOOTFLOWF_SINGLE_DEV: Just scan one bootmeth - * @BOOTFLOWF_SKIP_GLOBAL: Don't scan global bootmeths + * @BOOTFLOWF_HUNT: Hunt for new bootdevs using the bootdrv hunters + * + * Internal flags: + * @BOOTFLOWF_SINGLE_DEV: (internal) Just scan one bootdev + * @BOOTFLOWF_SKIP_GLOBAL: (internal) Don't scan global bootmeths + * this uclass */ enum bootflow_flags_t { BOOTFLOWF_FIXED = 1 << 0, BOOTFLOWF_SHOW = 1 << 1, BOOTFLOWF_ALL = 1 << 2, - BOOTFLOWF_SINGLE_DEV = 1 << 3, - BOOTFLOWF_SKIP_GLOBAL = 1 << 4, + BOOTFLOWF_HUNT = 1 << 3, + + /* + * flags used internally by standard boot - do not set these when + * calling bootflow_scan_bootdev() etc. + */ + BOOTFLOWF_SINGLE_DEV = 1 << 16, + BOOTFLOWF_SKIP_GLOBAL = 1 << 17, }; /** -- 2.39.0.314.g84b9a713c41-goog