diff options
author | Sean Anderson <sean.anderson@seco.com> | 2023-07-31 18:42:58 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-02 12:46:04 -0400 |
commit | 63de0f7850e6d492aa06939005906831719fafc8 (patch) | |
tree | c9f7a414c4df6798de1028844fc7c61b82a4cde1 | |
parent | 9721c9a1224e0a94eae8992ca5e5777fea308aa5 (diff) | |
download | u-boot-63de0f7850e6d492aa06939005906831719fafc8.zip u-boot-63de0f7850e6d492aa06939005906831719fafc8.tar.gz u-boot-63de0f7850e6d492aa06939005906831719fafc8.tar.bz2 |
spl: Convert net to spl_load
This converts the net load method to use spl_load. As a result, it also
adds support for LOAD_FIT_FULL and IMX images.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
-rw-r--r-- | common/spl/spl_net.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index b2c901b..29e72bc 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -28,7 +28,10 @@ static ulong spl_net_load_read(struct spl_load_info *load, ulong sector, static int spl_net_load_image(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { - struct legacy_img_hdr *header = (struct legacy_img_hdr *)image_load_addr; + struct spl_load_info load = { + .bl_len = 1, + .read = spl_net_load_read, + }; int rv; env_init(); @@ -47,25 +50,7 @@ static int spl_net_load_image(struct spl_image_info *spl_image, return rv; } - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && - image_get_magic(header) == FDT_MAGIC) { - struct spl_load_info load; - - debug("Found FIT\n"); - load.bl_len = 1; - load.read = spl_net_load_read; - rv = spl_load_simple_fit(spl_image, &load, 0, header); - } else { - debug("Legacy image\n"); - - rv = spl_parse_image_header(spl_image, bootdev, header); - if (rv) - return rv; - - memcpy((void *)spl_image->load_addr, header, spl_image->size); - } - - return rv; + return spl_load(spl_image, bootdev, &load, 0, 0); } #endif |