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 <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
Simon Glass
2024-11-15 16:19:17 -07:00
parent 52227fac51
commit 114dd14e38
11 changed files with 37 additions and 20 deletions

View File

@@ -23,7 +23,7 @@
#include <pxe_utils.h>
static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path,
char *file_addr, ulong *sizep)
char *file_addr, ulong *sizep)
{
struct extlinux_info *info = ctx->userdata;
ulong addr;
@@ -34,7 +34,7 @@ static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path,
/* Allow up to 1GB */
*sizep = 1 << 30;
ret = bootmeth_read_file(info->dev, info->bflow, file_path, addr,
sizep);
IH_TYPE_INVALID, sizep);
if (ret)
return log_msg_ret("read", ret);
@@ -113,7 +113,7 @@ static int extlinux_pxe_read_bootflow(struct udevice *dev,
static int extlinux_pxe_read_file(struct udevice *dev, struct bootflow *bflow,
const char *file_path, ulong addr,
ulong *sizep)
enum bootflow_img_t type, ulong *sizep)
{
char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
struct pxe_context *ctx = dev_get_priv(dev);