diff options
author | Simon Glass | 2022-04-24 23:31:09 -0600 |
---|---|---|
committer | Tom Rini | 2022-04-25 10:00:04 -0400 |
commit | a8f5be178db53f41338730e001b0f2ab459f7e31 (patch) | |
tree | 02cd04356491fa7bb7c036a0851a286550abd668 /include/bootflow.h | |
parent | a950d31abe980ba40a0a94fbf41136550187f8cd (diff) |
bootstd: Add support for bootflows
Add support for bootflows, including maintaining a list of them and
iterating to find them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootflow.h')
-rw-r--r-- | include/bootflow.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/bootflow.h b/include/bootflow.h index 6e9a729a9a3..c30ba042a48 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -152,6 +152,18 @@ void bootflow_iter_init(struct bootflow_iter *iter, int flags); void bootflow_iter_uninit(struct bootflow_iter *iter); /** + * bootflow_iter_drop_bootmeth() - Remove a bootmeth from an iterator + * + * Update the iterator so that the bootmeth will not be used again while this + * iterator is in use + * + * @iter: Iterator to update + * @bmeth: Boot method to remove + */ +int bootflow_iter_drop_bootmeth(struct bootflow_iter *iter, + const struct udevice *bmeth); + +/** * bootflow_scan_bootdev() - find the first bootflow in a bootdev * * If @flags includes BOOTFLOWF_ALL then bootflows with errors are returned too @@ -257,4 +269,42 @@ int bootflow_run_boot(struct bootflow_iter *iter, struct bootflow *bflow); */ const char *bootflow_state_get_name(enum bootflow_state_t state); +/** + * bootflow_remove() - Remove a bootflow and free its memory + * + * This updates the linked lists containing the bootflow then frees it. + * + * @bflow: Bootflow to remove + */ +void bootflow_remove(struct bootflow *bflow); + +/** + * bootflow_iter_uses_blk_dev() - Check that a bootflow uses a block device + * + * This checks the bootdev in the bootflow to make sure it uses a block device + * + * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. ethernet) + */ +int bootflow_iter_uses_blk_dev(const struct bootflow_iter *iter); + +/** + * bootflow_iter_uses_network() - Check that a bootflow uses a network device + * + * This checks the bootdev in the bootflow to make sure it uses a network + * device + * + * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC) + */ +int bootflow_iter_uses_network(const struct bootflow_iter *iter); + +/** + * bootflow_iter_uses_system() - Check that a bootflow uses the bootstd device + * + * This checks the bootdev in the bootflow to make sure it uses the bootstd + * device + * + * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC) + */ +int bootflow_iter_uses_system(const struct bootflow_iter *iter); + #endif |