diff options
| author | Simon Glass <[email protected]> | 2025-10-15 16:44:11 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-22 14:16:56 -0600 |
| commit | 4ce78089b2a615eab466347e8996fbd54a876234 (patch) | |
| tree | 461733d23c1e8ec07e6158ec7d7c52a37e102fae /boot | |
| parent | e52053c93c128284ccfae11001d7b211bb081aeb (diff) | |
boot: Implement a priority for global bootmeths
Allow bootmeths to select when they want to run, using the bootdev
priority. Provide a new bootmeth_glob_allowed() function which checks if
a bootmeth is ready to use.
Fix a comment in bootflow_system() which is a test for global bootmeths.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/bootflow.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c index ca1fe741bab..1a4cd0e28e8 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -191,17 +191,24 @@ static void scan_next_in_uclass(struct udevice **devp) * bootmeth_glob_allowed() - Check if a global bootmeth is usable at this point * * @iter: Bootflow iterator being used - * Return: true if the global bootmeth has not already been used + * Return: true if the global bootmeth has a suitable priority and has not + * already been used */ static bool bootmeth_glob_allowed(struct bootflow_iter *iter, int meth_seq) { struct udevice *meth = iter->method_order[meth_seq]; bool done = iter->methods_done & BIT(meth_seq); + struct bootmeth_uc_plat *ucp; - log_debug("considering glob '%s': done %d\n", meth->name, done); + ucp = dev_get_uclass_plat(meth); + log_debug("considering glob '%s': done %d glob_prio %d\n", meth->name, + done, ucp->glob_prio); - /* if this one has already been used, try the next */ - if (done) + /* + * if this one has already been used, or its priority is too low, try + * the next + */ + if (done || ucp->glob_prio > iter->cur_prio) return false; return true; |
