X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib_i386%2Fbootm.c;h=f96d7bd6daa329fb9fe8f9d663306f60ba3d97e9;hb=d91803826985bfdf151eed66543ce3b1a301682f;hp=76bcf6cd85e3999d818ee060abce57f6ff46eb2e;hpb=9a4daad0a35eb5143037eea9f786a3e9d672bdd6;p=u-boot diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index 76bcf6cd85..f96d7bd6da 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -24,24 +24,24 @@ #include #include #include -#include +#include #include #include /*cmd_boot.c*/ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { void *base_ptr; ulong os_data, os_len; - ulong initrd_start, initrd_end; - ulong ep; image_header_t *hdr; - boot_get_ramdisk (cmdtp, flag, argc, argv, images, - IH_ARCH_I386, &initrd_start, &initrd_end); +#if defined(CONFIG_FIT) + const void *data; + size_t len; +#endif + + if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) + return 1; if (images->legacy_hdr_valid) { hdr = images->legacy_hdr_os; @@ -55,26 +55,29 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], } #if defined(CONFIG_FIT) } else if (images->fit_uname_os) { - fit_unsupported_reset ("I386 linux bootm"); - do_reset (cmdtp, flag, argc, argv); + ret = fit_image_get_data (images->fit_hdr_os, + images->fit_noffset_os, &data, &len); + if (ret) { + puts ("Can't get image data/size!\n"); + goto error; + } + os_data = (ulong)data; + os_len = (ulong)len; #endif } else { puts ("Could not find kernel image!\n"); - do_reset (cmdtp, flag, argc, argv); + goto error; } base_ptr = load_zimage ((void*)os_data, os_len, - initrd_start, initrd_end - initrd_start, 0); + images->rd_start, images->rd_end - images->rd_start, 0); if (NULL == base_ptr) { printf ("## Kernel loading failed ...\n"); - do_reset(cmdtp, flag, argc, argv); + goto error; } - if (!images->autostart) - return ; - #ifdef DEBUG printf ("## Transferring control to Linux (at address %08x) ...\n", (u32)base_ptr); @@ -84,5 +87,8 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], printf("\nStarting kernel ...\n\n"); boot_zimage(base_ptr); + /* does not return */ +error: + return 1; }