1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 09:12:08 +02:00

bootstd: Use hunters when scanning for bootflows

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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-01-17 10:48:06 -07:00
committed by Tom Rini
parent d9f48579dc
commit d73420e4fe
2 changed files with 20 additions and 6 deletions

View File

@@ -96,7 +96,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc,
struct udevice *dev; struct udevice *dev;
struct bootflow bflow; struct bootflow bflow;
bool all = false, boot = false, errors = false, no_global = false; bool all = false, boot = false, errors = false, no_global = false;
bool list = false; bool list = false, no_hunter = false;
int num_valid = 0; int num_valid = 0;
bool has_args; bool has_args;
int ret, i; 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'); errors = strchr(argv[1], 'e');
no_global = strchr(argv[1], 'G'); no_global = strchr(argv[1], 'G');
list = strchr(argv[1], 'l'); list = strchr(argv[1], 'l');
no_hunter = strchr(argv[1], 'H');
argc--; argc--;
argv++; argv++;
} }
@@ -141,6 +142,8 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc,
flags |= BOOTFLOWF_ALL; flags |= BOOTFLOWF_ALL;
if (no_global) if (no_global)
flags |= BOOTFLOWF_SKIP_GLOBAL; flags |= BOOTFLOWF_SKIP_GLOBAL;
if (!no_hunter)
flags |= BOOTFLOWF_HUNT;
/* /*
* If we have a device, just scan for bootflows attached to that device * If we have a device, just scan for bootflows attached to that device

View File

@@ -91,17 +91,28 @@ struct bootflow {
* enum bootflow_flags_t - flags for the bootflow iterator * enum bootflow_flags_t - flags for the bootflow iterator
* *
* @BOOTFLOWF_FIXED: Only used fixed/internal media * @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_ALL: Return bootflows with errors as well
* @BOOTFLOWF_SINGLE_DEV: Just scan one bootmeth * @BOOTFLOWF_HUNT: Hunt for new bootdevs using the bootdrv hunters
* @BOOTFLOWF_SKIP_GLOBAL: Don't scan global bootmeths *
* 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 { enum bootflow_flags_t {
BOOTFLOWF_FIXED = 1 << 0, BOOTFLOWF_FIXED = 1 << 0,
BOOTFLOWF_SHOW = 1 << 1, BOOTFLOWF_SHOW = 1 << 1,
BOOTFLOWF_ALL = 1 << 2, BOOTFLOWF_ALL = 1 << 2,
BOOTFLOWF_SINGLE_DEV = 1 << 3, BOOTFLOWF_HUNT = 1 << 3,
BOOTFLOWF_SKIP_GLOBAL = 1 << 4,
/*
* 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,
}; };
/** /**