From: Simon Glass <sjg@chromium.org>
Date: Sun, 30 Jul 2023 17:16:56 +0000 (-0600)
Subject: bootstd: Add private bootmeth data to the bootflow
X-Git-Tag: v2025.01-rc5-pxa1908~847^2~37^2~6
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/%7B%7B?a=commitdiff_plain;h=76bd6844dcfeb1a7d2f529c2f715b34f4e574229;p=u-boot.git

bootstd: Add private bootmeth data to the bootflow

Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/boot/bootflow.c b/boot/bootflow.c
index 81b5829d5b..daf862fac7 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -432,6 +432,7 @@ void bootflow_free(struct bootflow *bflow)
 	free(bflow->buf);
 	free(bflow->os_name);
 	free(bflow->fdt_fname);
+	free(bflow->bootmeth_priv);
 }
 
 void bootflow_remove(struct bootflow *bflow)
diff --git a/include/bootflow.h b/include/bootflow.h
index 4152577afb..ff2bddb515 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -83,6 +83,7 @@ enum bootflow_flags_t {
  * @flags: Flags for the bootflow (see enum bootflow_flags_t)
  * @cmdline: OS command line, or NULL if not known (allocated)
  * @x86_setup: Pointer to x86 setup block inside @buf, NULL if not present
+ * @bootmeth_priv: Private data for the bootmeth
  */
 struct bootflow {
 	struct list_head bm_node;
@@ -108,6 +109,7 @@ struct bootflow {
 	int flags;
 	char *cmdline;
 	char *x86_setup;
+	void *bootmeth_priv;
 };
 
 /**