summaryrefslogtreecommitdiff
path: root/boot/bootstd-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-11-15 16:19:08 -0700
committerTom Rini <[email protected]>2025-01-15 08:48:42 -0600
commit47903aacc520c96bafae1225484e5df740a233e6 (patch)
treefe9254137a999ee7bc3fb6d46c31e480a22eee92 /boot/bootstd-uclass.c
parent5907c81647055a03580dae850f82d85f7d810f7e (diff)
bootstd: Move bootflow-adding to bootstd
This relates to more than just the bootdev, since there is a global list of bootflows. Move the function to the bootstd file and rename it. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot/bootstd-uclass.c')
-rw-r--r--boot/bootstd-uclass.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c
index fdb8d69e320..bf6e49ad97a 100644
--- a/boot/bootstd-uclass.c
+++ b/boot/bootstd-uclass.c
@@ -61,6 +61,31 @@ void bootstd_clear_glob(void)
bootstd_clear_glob_(std);
}
+int bootstd_add_bootflow(struct bootflow *bflow)
+{
+ struct bootstd_priv *std;
+ struct bootflow *new;
+ int ret;
+
+ ret = bootstd_get_priv(&std);
+ if (ret)
+ return ret;
+
+ new = malloc(sizeof(*bflow));
+ if (!new)
+ return log_msg_ret("bflow", -ENOMEM);
+ memcpy(new, bflow, sizeof(*bflow));
+
+ list_add_tail(&new->glob_node, &std->glob_head);
+ if (bflow->dev) {
+ struct bootdev_uc_plat *ucp = dev_get_uclass_plat(bflow->dev);
+
+ list_add_tail(&new->bm_node, &ucp->bootflow_head);
+ }
+
+ return 0;
+}
+
static int bootstd_remove(struct udevice *dev)
{
struct bootstd_priv *priv = dev_get_priv(dev);