mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 11:55:03 +00:00
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>
This commit is contained in:
parent
985f9f7039
commit
ff4c9a4b6f
3 changed files with 9 additions and 4 deletions
|
@ -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,
|
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;
|
struct blk_desc *desc = NULL;
|
||||||
char path[200];
|
char path[200];
|
||||||
|
@ -388,6 +388,10 @@ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname,
|
||||||
if (ret)
|
if (ret)
|
||||||
return log_msg_ret("all", 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;
|
*bufp = buf;
|
||||||
*sizep = size;
|
*sizep = size;
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@ static int script_read_bootflow_file(struct udevice *bootstd,
|
||||||
if (ret)
|
if (ret)
|
||||||
return log_msg_ret("inf", ret);
|
return log_msg_ret("inf", ret);
|
||||||
|
|
||||||
ret = bootmeth_alloc_other(bflow, "boot.bmp", &bflow->logo,
|
ret = bootmeth_alloc_other(bflow, "boot.bmp", BFI_LOGO,
|
||||||
&bflow->logo_size);
|
&bflow->logo, &bflow->logo_size);
|
||||||
/* ignore error */
|
/* ignore error */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -384,12 +384,13 @@ int bootmeth_alloc_file(struct bootflow *bflow, uint size_limit, uint align,
|
||||||
*
|
*
|
||||||
* @bflow: Information about file to read
|
* @bflow: Information about file to read
|
||||||
* @fname: Filename to read from (within bootflow->subdir)
|
* @fname: Filename to read from (within bootflow->subdir)
|
||||||
|
* @type: File type (IH_TYPE_...)
|
||||||
* @bufp: Returns a pointer to the allocated buffer
|
* @bufp: Returns a pointer to the allocated buffer
|
||||||
* @sizep: Returns the size of the buffer
|
* @sizep: Returns the size of the buffer
|
||||||
* Return: 0 if OK, -ENOMEM if out of memory, other -ve on other error
|
* Return: 0 if OK, -ENOMEM if out of memory, other -ve on other error
|
||||||
*/
|
*/
|
||||||
int bootmeth_alloc_other(struct bootflow *bflow, const char *fname,
|
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
|
* bootmeth_common_read_file() - Common handler for reading a file
|
||||||
|
|
Loading…
Add table
Reference in a new issue