summaryrefslogtreecommitdiff
path: root/include/bootstd.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 20:47:15 +0300
committerTom Rini <trini@konsulko.com>2023-01-24 02:11:39 +0300
commit6a6638f0939dca65c7d1cd0d766957d3d3adc519 (patch)
tree7eb2cae66d5f768a0e57322600f3bc604016df3b /include/bootstd.h
parent3e96ed44e8c5b63bd0cef1e263e7991ac16c21e3 (diff)
downloadu-boot-6a6638f0939dca65c7d1cd0d766957d3d3adc519.tar.xz
bootstd: Remove special-case code for boot_targets
Rather than implement this as its own case in build_order(), process the boot_targets environment variable in the bootstd_get_bootdev_order() function. This allows build_order() to be simplified. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootstd.h')
-rw-r--r--include/bootstd.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/bootstd.h b/include/bootstd.h
index 4fa0d53100..bd305094fd 100644
--- a/include/bootstd.h
+++ b/include/bootstd.h
@@ -22,7 +22,10 @@ struct udevice;
* @prefixes: NULL-terminated list of prefixes to use for bootflow filenames,
* e.g. "/", "/boot/"; NULL if none
* @bootdev_order: Order to use for bootdevs (or NULL if none), with each item
- * being a bootdev label, e.g. "mmc2", "mmc1";
+ * being a bootdev label, e.g. "mmc2", "mmc1" (NULL terminated)
+ * @env_order: Order as specified by the boot_targets env var (or NULL if none),
+ * with each item being a bootdev label, e.g. "mmc2", "mmc1" (NULL
+ * terminated)
* @cur_bootdev: Currently selected bootdev (for commands)
* @cur_bootflow: Currently selected bootflow (for commands)
* @glob_head: Head for the global list of all bootflows across all bootdevs
@@ -34,6 +37,7 @@ struct udevice;
struct bootstd_priv {
const char **prefixes;
const char **bootdev_order;
+ const char **env_order;
struct udevice *cur_bootdev;
struct bootflow *cur_bootflow;
struct list_head glob_head;
@@ -51,9 +55,13 @@ struct bootstd_priv {
* The list is alloced by the bootstd driver so should not be freed. That is the
* reason for all the const stuff in the function signature
*
- * Return: list of string points, terminated by NULL; or NULL if no boot order
+ * @dev: bootstd device
+ * @okp: returns true if OK, false if out of memory
+ * Return: list of string pointers, terminated by NULL; or NULL if no boot
+ * order. Note that this returns NULL in the case of an empty list
*/
-const char *const *const bootstd_get_bootdev_order(struct udevice *dev);
+const char *const *const bootstd_get_bootdev_order(struct udevice *dev,
+ bool *okp);
/**
* bootstd_get_prefixes() - Get the filename-prefixes list