diff options
| author | Sean Anderson <[email protected]> | 2023-11-08 11:48:52 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-11-16 13:49:14 -0500 |
| commit | 2e5476b5a7fe7255e58bd6b086c1c6c77350cadd (patch) | |
| tree | c9ad502bf19297fb82872169b515c01f1d26e6a3 /common | |
| parent | 11f834614e8577bffea04d39e7eb235ee1271b29 (diff) | |
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'common')
| -rw-r--r-- | common/spl/spl_net.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index 47994e28165..898f9df705a 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -11,8 +11,8 @@ #include <errno.h> #include <image.h> #include <log.h> -#include <mapmem.h> #include <spl.h> +#include <spl_load.h> #include <net.h> #include <linux/libfdt.h> @@ -29,8 +29,7 @@ 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 = map_sysmem(image_load_addr, - sizeof(*header)); + struct spl_load_info load; int rv; env_init(); @@ -49,27 +48,9 @@ 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"); - spl_set_bl_len(&load, 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(map_sysmem(spl_image->load_addr, spl_image->size), - map_sysmem(image_load_addr, spl_image->size), - spl_image->size); - } - - return rv; + spl_set_bl_len(&load, 1); + load.read = spl_net_load_read; + return spl_load(spl_image, bootdev, &load, 0, 0); } #endif |
