diff options
author | Simon Glass <sjg@chromium.org> | 2024-11-15 16:19:21 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-01-15 08:48:42 -0600 |
commit | ff4c9a4b6fac767f28f668c708e79f3d618061a8 (patch) | |
tree | be4cd3048e55ef967ea39ea2eac6a33542439652 | |
parent | 985f9f703914aa742062abb120c7b87e63410d26 (diff) |
Update bootmeth_alloc_other() to record images
Update this function to add the image to the list.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | boot/bootmeth-uclass.c | 6 | ||||
-rw-r--r-- | boot/bootmeth_script.c | 4 | ||||
-rw-r--r-- | include/bootmeth.h | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index 1f48d0c1f51..014b7588e8d 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -359,7 +359,7 @@ int bootmeth_alloc_file(struct bootflow *bflow, uint size_limit, uint align, } int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, - void **bufp, uint *sizep) + enum bootflow_img_t type, void **bufp, uint *sizep) { struct blk_desc *desc = NULL; char path[200]; @@ -388,6 +388,10 @@ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, if (ret) return log_msg_ret("all", ret); + if (!bootflow_img_add(bflow, bflow->fname, type, map_to_sysmem(buf), + size)) + return log_msg_ret("boi", -ENOMEM); + *bufp = buf; *sizep = size; diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c index a2fb2899885..020cb8a7aec 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -107,8 +107,8 @@ static int script_read_bootflow_file(struct udevice *bootstd, if (ret) return log_msg_ret("inf", ret); - ret = bootmeth_alloc_other(bflow, "boot.bmp", &bflow->logo, - &bflow->logo_size); + ret = bootmeth_alloc_other(bflow, "boot.bmp", BFI_LOGO, + &bflow->logo, &bflow->logo_size); /* ignore error */ return 0; diff --git a/include/bootmeth.h b/include/bootmeth.h index 788d4046ce9..26de593a9a4 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -384,12 +384,13 @@ int bootmeth_alloc_file(struct bootflow *bflow, uint size_limit, uint align, * * @bflow: Information about file to read * @fname: Filename to read from (within bootflow->subdir) + * @type: File type (IH_TYPE_...) * @bufp: Returns a pointer to the allocated buffer * @sizep: Returns the size of the buffer * Return: 0 if OK, -ENOMEM if out of memory, other -ve on other error */ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, - void **bufp, uint *sizep); + enum bootflow_img_t type, void **bufp, uint *sizep); /** * bootmeth_common_read_file() - Common handler for reading a file |