X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib_avr32%2Fbootm.c;h=6a3172a9a0c11efda750ebe77d91ba03a1b61dd0;hb=0a87dd90a75d034301496285026fbd8106c7c6d5;hp=b1c651ab2cdd15ab22e147032d2fb0c484071aba;hpb=7e492d8258182e31c988bbf9917d4a3d41949d56;p=u-boot diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c index b1c651ab2c..6a3172a9a0 100644 --- a/lib_avr32/bootm.c +++ b/lib_avr32/bootm.c @@ -22,9 +22,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -34,8 +34,6 @@ DECLARE_GLOBAL_DATA_PTR; /* CPU-specific hook to allow flushing of caches, etc. */ extern void prepare_to_boot(void); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - static struct tag *setup_start_tag(struct tag *params) { params->hdr.tag = ATAG_CORE; @@ -173,57 +171,32 @@ static void setup_end_tag(struct tag *params) params->hdr.size = 0; } -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) { - ulong initrd_start, initrd_end; - ulong ep = 0; void (*theKernel)(int magic, void *tagtable); struct tag *params, *params_start; char *commandline = getenv("bootargs"); - int ret; - - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (images->legacy_hdr_os); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - theKernel = (void *)ep; - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32, - &initrd_start, &initrd_end); - if (ret) - goto error; + if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) + return 1; + + theKernel = (void *)images->ep; show_boot_progress (15); params = params_start = (struct tag *)gd->bd->bi_boot_params; params = setup_start_tag(params); params = setup_memory_tags(params); - if (initrd_start) { + if (images->rd_start) { params = setup_ramdisk_tag(params, - PHYSADDR(initrd_start), - PHYSADDR(initrd_end)); + PHYSADDR(images->rd_start), + PHYSADDR(images->rd_end)); } params = setup_commandline_tag(params, commandline); params = setup_clock_tags(params); params = setup_ethernet_tags(params); setup_end_tag(params); - if (!images->autostart) - return ; - printf("\nStarting kernel at %p (params at %p)...\n\n", theKernel, params_start); @@ -231,10 +204,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], theKernel(ATAG_MAGIC, params_start); /* does not return */ - return; -error: - if (images->autostart) - do_reset (cmdtp, flag, argc, argv); - return; + return 1; }