summaryrefslogtreecommitdiff
path: root/common/spl/spl_spi.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-07-23 12:14:27 +0300
committerStefan Roese <sr@denx.de>2021-07-31 10:49:32 +0300
commit5fce2875569d6e859443af7af3477c3aebfee383 (patch)
tree1586a3eabedebae1d5af6d03a474f9a9cef49037 /common/spl/spl_spi.c
parentabbf2179b251493b09c08d90e46ca0de950b3410 (diff)
downloadu-boot-5fce2875569d6e859443af7af3477c3aebfee383.tar.xz
SPL: Add support for specifying offset between header and image
Some image types (e.g. kwbimage v1) store the offset to SPL binary and offset to U-Boot proper binary in their headers. To avoid reading SPL binary when loading U-Boot proper, add support for specifying offset in struct spl_image_info, which defines the offset from the beginning of the header and the beginning of the executable data. Initial support is added only for SPI, MMC and SATA code. We can extend it later if needed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common/spl/spl_spi.c')
-rw-r--r--common/spl/spl_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 6a4e033287..9884e7c185 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -159,7 +159,7 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
err = spl_parse_image_header(spl_image, header);
if (err)
return err;
- err = spi_flash_read(flash, payload_offs,
+ err = spi_flash_read(flash, payload_offs + spl_image->offset,
spl_image->size,
(void *)spl_image->load_addr);
}