diff options
| author | Simon Glass <[email protected]> | 2024-11-15 16:19:17 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-15 08:48:42 -0600 |
| commit | aa0ba7fbda4121fa9f3f11161fb4ebdd7e227299 (patch) | |
| tree | f64a29a7ab63bf98ae8a4c30ba95e23d26ec911b /include | |
| parent | d4c60aa91b8a3a7b880c2a6ec24664108cd67730 (diff) | |
bootmeth: Update the read_file() method to include a type
We want to record the type of each file which is loaded. Add an new
parameter for this, to the read_file() method. Update all users.
Make bootmeth_common_read_file() store information about the image that
is read.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/bootmeth.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/bootmeth.h b/include/bootmeth.h index e812974ec4d..788d4046ce9 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -8,7 +8,6 @@ #define __bootmeth_h #include <bootflow.h> -#include <image.h> #include <linux/bitops.h> struct blk_desc; @@ -117,13 +116,15 @@ struct bootmeth_ops { * @bflow: Bootflow providing info on where to read from * @file_path: Path to file (may be absolute or relative) * @addr: Address to load file + * @type: File type (IH_TYPE_...) * @sizep: On entry provides the maximum permitted size; on exit * returns the size of the file * Return: 0 if OK, -ENOSPC if the file is too large for @sizep, other * -ve value if something else goes wrong */ int (*read_file)(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep); + const char *file_path, ulong addr, + enum bootflow_img_t type, ulong *sizep); #if CONFIG_IS_ENABLED(BOOTSTD_FULL) /** * readall() - read all files for a bootflow @@ -245,13 +246,15 @@ int bootmeth_set_bootflow(struct udevice *dev, struct bootflow *bflow, * @bflow: Bootflow providing info on where to read from * @file_path: Path to file (may be absolute or relative) * @addr: Address to load file + * @type: File type (IH_TYPE_...) * @sizep: On entry provides the maximum permitted size; on exit * returns the size of the file * Return: 0 if OK, -ENOSPC if the file is too large for @sizep, other * -ve value if something else goes wrong */ int bootmeth_read_file(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep); + const char *file_path, ulong addr, + enum bootflow_img_t type, ulong *sizep); /** * bootmeth_read_all() - read all bootflow files @@ -397,11 +400,13 @@ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, * @bflow: Bootflow information * @file_path: Path to file * @addr: Address to load file to + * @type: File type (IH_TYPE_...) * @sizep: On entry, the maximum file size to accept, on exit the actual file * size read */ int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep); + const char *file_path, ulong addr, + enum bootflow_img_t type, ulong *sizep); /** * bootmeth_get_bootflow() - Get a bootflow from a global bootmeth |
