From patchwork Wed Dec 7 08:51:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1713150 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PEFW+89/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NRrz233Tlz23ns for ; Wed, 7 Dec 2022 20:07:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F3B4285730; Wed, 7 Dec 2022 09:57:17 +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="PEFW+89/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF9DF856B1; Wed, 7 Dec 2022 09:57:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 35FC2855D5 for ; Wed, 7 Dec 2022 09:57:09 +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-pj1-x102c.google.com with SMTP id b13-20020a17090a5a0d00b0021906102d05so934622pjd.5 for ; Wed, 07 Dec 2022 00:57:09 -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=zRSohTIoBP62O6a+ND9TmpaTRRVEy11AbB0bNqGb2Kc=; b=PEFW+89/oIKYx4CztQODSrrbSsyr7yD/YcKJ0wgloalf0+i1S5SGc88/T3qxRuUHiJ x1oHGXbOZq6rV4AfocDTvCuzlJ+YC+xCTNJXA1XPAHvziH1TaAxXlNvsOpyQTBCOWp8m EQjBQXM9cxAgrsotGCAfvCsmlqZypn0ZRi0+A= 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=zRSohTIoBP62O6a+ND9TmpaTRRVEy11AbB0bNqGb2Kc=; b=1r+vPX/QFQaDSO1N31Juj9jMR9yCNVrdD1WrfPzssHOaBRZ8L2vXeqsT2aLpkk158q neFatoR7FnsGmWPbCXcBrd9ynDQOMdgVZ8NgdcFsgigU+YXxV8HrBESuvKlGTdX+YJPJ RYBP/E/95GCjIKT5X6mizIhzD08hm5epmjss9UzUd94DhAp9UxIoeQM8LKJSvrxc09Dz Fcw2Vdjbe8LQI7sqGdbc1LHxmAbfU7cN4BVohMxjH3ShYzCPXAZiKsx0BkNrQORwa0rV YjMPjfLCq1aOXohyIO0npiOldXY+AfAsf2893qk0UYoQRQPWPq/bDoIoBJokH8cyZpKF waDA== X-Gm-Message-State: ANoB5pmH5K2TOrf+Vo/fq9g+PQDoLkYjIeBp4BxitEselNvSwqOi8alK 28e232Y9yIzjEYxFV96zg2WXnIMvxIcTMSB1 X-Google-Smtp-Source: AA0mqf59UdGa53LbkjazTcwTvA/ezknNU+J96qamz01EGIMqfEh8bRfDZsV8bwFBLC8R/EiqNvJT8w== X-Received: by 2002:a17:90a:6b4e:b0:219:6a07:c6d0 with SMTP id x14-20020a17090a6b4e00b002196a07c6d0mr34693068pjl.178.1670403428490; Wed, 07 Dec 2022 00:57:08 -0800 (PST) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b0018157b415dbsm14145514plh.63.2022.12.07.00.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:57:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass Subject: [PATCH 57/71] bootstd: Use hunters when scanning for bootflows Date: Wed, 7 Dec 2022 21:51:23 +1300 Message-Id: <20221207085137.445249-58-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <20221207085137.445249-1-sjg@chromium.org> References: <20221207085137.445249-1-sjg@chromium.org> MIME-Version: 1.0 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 --- 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 c4bb68196f2..fdccb775a15 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 70bed29355f..b3d7509a6d5 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -80,17 +80,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, }; /**