From cd7c596e9f561dbbc17b717277438aee78cde14f Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Wed, 12 Mar 2008 10:33:00 +0100 Subject: [new uImage] Add new uImage format support to arch specific do_bootm_linux() routines This patch updates architecture specific implementations of do_bootm_linux() adding new uImage format handling for operations like get kernel entry point address, get kernel image data start address. Signed-off-by: Marian Balakowicz --- lib_i386/bootm.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'lib_i386') diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index b4a52fa21..107ebaaa6 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -40,11 +40,15 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong ep; image_header_t *hdr; int ret; +#if defined(CONFIG_FIT) + const void *data; + size_t len; +#endif ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386, &initrd_start, &initrd_end); if (ret) - do_reset (cmdtp, flag, argc, argv); + goto error; if (images->legacy_hdr_valid) { hdr = images->legacy_hdr_os; @@ -58,12 +62,18 @@ 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, @@ -71,7 +81,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (NULL == base_ptr) { printf ("## Kernel loading failed ...\n"); - do_reset(cmdtp, flag, argc, argv); + goto error; } @@ -87,5 +97,11 @@ 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 */ + return; +error: + if (images->autostart) + do_reset (cmdtp, flag, argc, argv); + return; } -- cgit v1.2.3