]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/bootm.c
add boot_get_loadables() to load listed images
[karo-tx-uboot.git] / common / bootm.c
index e2dc16486b3bf0dba90c736bba3cd3a7a0a762ee..07ae0f56ee68054f0f36f1c7f1c7ec3a3e5abc31 100644 (file)
@@ -13,6 +13,7 @@
 #include <fdt_support.h>
 #include <lmb.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/io.h>
 #include <linux/lzo.h>
 #include <lzma/LzmaTypes.h>
@@ -233,7 +234,24 @@ static int bootm_find_fdt(int flag, int argc, char * const argv[])
                return 1;
        }
 
-       set_working_fdt_addr(images.ft_addr);
+       set_working_fdt_addr((ulong)images.ft_addr);
+
+       return 0;
+}
+#endif
+
+#if defined(CONFIG_FIT)
+static int bootm_find_loadables(int flag, int argc, char * const argv[])
+{
+       int ret;
+
+       /* find all of the loadables */
+       ret = boot_get_loadable(argc, argv, &images, IH_ARCH_DEFAULT,
+                              NULL, NULL);
+       if (ret) {
+               printf("Loadable(s) is corrupt or invalid\n");
+               return 1;
+       }
 
        return 0;
 }
@@ -249,6 +267,11 @@ int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[])
                return 1;
 #endif
 
+#if defined(CONFIG_FIT)
+       if (bootm_find_loadables(flag, argc, argv))
+               return 1;
+#endif
+
        return 0;
 }