Upda the SPL FIT code to use the spl_image parameter.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
debug("Found FIT\n");
load.bl_len = 1;
load.read = spl_ram_load_read;
- spl_load_simple_fit(&load, 0, header);
+ spl_load_simple_fit(spl_image, &load, 0, header);
} else {
debug("Legacy image\n");
/*
load.filename = (void *)filename;
load.priv = NULL;
- return spl_load_simple_fit(&load, 0, header);
+ return spl_load_simple_fit(spl_image, &load, 0, header);
} else {
err = spl_parse_image_header(spl_image, header);
if (err)
return (data_size + info->bl_len - 1) / info->bl_len;
}
-int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
+int spl_load_simple_fit(struct spl_image_info *spl_image,
+ struct spl_load_info *info, ulong sector, void *fit)
{
int sectors;
ulong size, load;
data_size = fdt_getprop_u32(fit, node, "data-size");
load = fdt_getprop_u32(fit, node, "load");
debug("data_offset=%x, data_size=%x\n", data_offset, data_size);
- spl_image.load_addr = load;
- spl_image.entry_point = load;
- spl_image.os = IH_OS_U_BOOT;
+ spl_image->load_addr = load;
+ spl_image->entry_point = load;
+ spl_image->os = IH_OS_U_BOOT;
/*
* Work out where to place the image. We read it so that the first
load.filename = NULL;
load.bl_len = mmc->read_bl_len;
load.read = h_spl_load_read;
- ret = spl_load_simple_fit(&load, sector, header);
+ ret = spl_load_simple_fit(spl_image, &load, sector, header);
} else {
ret = mmc_load_legacy(spl_image, mmc, sector, header);
}
load.filename = NULL;
load.bl_len = 1;
load.read = spl_nand_fit_read;
- return spl_load_simple_fit(&load, offset, header);
+ return spl_load_simple_fit(spl_image, &load, offset, header);
} else {
err = spl_parse_image_header(spl_image, header);
if (err)
load.filename = NULL;
load.bl_len = 1;
load.read = spl_spi_fit_read;
- err = spl_load_simple_fit(&load,
+ err = spl_load_simple_fit(spl_image, &load,
CONFIG_SYS_SPI_U_BOOT_OFFS,
header);
} else {
info.buf = buf;
info.image_read = BUF_SIZE;
load.read = ymodem_read_fit;
- ret = spl_load_simple_fit(&load, 0, (void *)buf);
+ ret = spl_load_simple_fit(spl_image, &load, 0, (void *)buf);
size = info.image_read;
while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
/**
* spl_load_simple_fit() - Loads a fit image from a device.
+ * @spl_image: Image description to set up
* @info: Structure containing the information required to load data.
* @sector: Sector number where FIT image is located in the device
* @fdt: Pointer to the copied FIT header.
* specified load address and copies the dtb to end of u-boot image.
* Returns 0 on success.
*/
-int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fdt);
+int spl_load_simple_fit(struct spl_image_info *spl_image,
+ struct spl_load_info *info, ulong sector, void *fdt);
#define SPL_COPY_PAYLOAD_ONLY 1