From 84a07dbfd8e916788d685a4227f9a4e770375ffd Mon Sep 17 00:00:00 2001 From: Karl Apsite Date: Thu, 21 May 2015 09:52:48 -0400 Subject: add boot_get_loadables() to load listed images Added a trimmed down instance of boot_get_() to satisfy the minimum requierments of the added feature. The function follows the normal patterns set by other boot_get's, which should make it a bit easier to combine them all together into one boot_get_image() function in a later refactor. Documentation for the new function can be found in source: include/image.h Signed-off-by: Karl Apsite Reviewed-by: Simon Glass --- common/bootm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'common/bootm.c') diff --git a/common/bootm.c b/common/bootm.c index 6842029..07ae0f5 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -240,6 +240,23 @@ static int bootm_find_fdt(int flag, int argc, char * const argv[]) } #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; +} +#endif + int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[]) { if (bootm_find_ramdisk(flag, argc, argv)) @@ -250,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; } -- cgit v1.1