Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
[oweals/u-boot.git] / cmd / source.c
index 1a9a71aa3748b1da5788ece33ad55f57a8f89dd2..92f8f77ee6fcc60a1cc56f59d4e26db87f720758 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <image.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -40,8 +41,7 @@ static const char *get_default_image(const void *fit)
 }
 #endif
 
-int
-source (ulong addr, const char *fit_uname)
+int image_source_script(ulong addr, const char *fit_uname)
 {
        ulong           len;
 #if defined(CONFIG_LEGACY_IMAGE_FORMAT)
@@ -171,7 +171,8 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                addr = CONFIG_SYS_LOAD_ADDR;
                debug ("*  source: default load address = 0x%08lx\n", addr);
 #if defined(CONFIG_FIT)
-       } else if (fit_parse_subimage (argv[1], load_addr, &addr, &fit_uname)) {
+       } else if (fit_parse_subimage(argv[1], image_load_addr, &addr,
+                                     &fit_uname)) {
                debug ("*  source: subimage '%s' from FIT image at 0x%08lx\n",
                                fit_uname, addr);
 #endif
@@ -181,7 +182,7 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        printf ("## Executing script at %08lx\n", addr);
-       rcode = source (addr, fit_uname);
+       rcode = image_source_script(addr, fit_uname);
        return rcode;
 }