X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_elf.c;h=22475dc3cbff63247609f9acdc5f802d6380f7bd;hb=4d2d2ae559c14dee59f1b4db29181945eb98f734;hp=ab9c7e332d97b200109e09e464b0fb786ac967c6;hpb=412665b46134f93464c09405e02f08ac9c62526d;p=karo-tx-uboot.git diff --git a/common/cmd_elf.c b/common/cmd_elf.c index ab9c7e332d..22475dc3cb 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -28,8 +29,7 @@ static unsigned long load_elf_image_phdr(unsigned long addr); static unsigned long load_elf_image_shdr(unsigned long addr); /* Allow ports to override the default behavior */ -__attribute__((weak)) -unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), +static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), int argc, char * const argv[]) { unsigned long ret; @@ -95,6 +95,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) unsigned long addr; /* Address of the ELF image */ unsigned long rc; /* Return value from user code */ char *sload, *saddr; + const char *ep = getenv("autostart"); /* -------------------------------------------------- */ int rcode = 0; @@ -123,6 +124,9 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) else addr = load_elf_image_shdr(addr); + if (ep && !strcmp(ep, "no")) + return rcode; + printf("## Starting application at 0x%08lx ...\n", addr); /* @@ -166,7 +170,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * Check to see if we need to tftp the image ourselves before starting */ if ((argc == 2) && (strcmp(argv[1], "tftp") == 0)) { - if (NetLoop(TFTPGET) <= 0) + if (net_loop(TFTPGET) <= 0) return 1; printf("Automatic boot of VxWorks image at address 0x%08lx ...\n", addr); @@ -210,9 +214,9 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ bootline = getenv("bootargs"); if (bootline) { - memcpy((void *) bootaddr, bootline, - max(strlen(bootline), 255)); - flush_cache(bootaddr, max(strlen(bootline), 255)); + memcpy((void *)bootaddr, bootline, + max(strlen(bootline), (size_t)255)); + flush_cache(bootaddr, max(strlen(bootline), (size_t)255)); } else { sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE); tmp = getenv("bootfile"); @@ -240,9 +244,9 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) CONFIG_SYS_VXWORKS_ADD_PARAMS); #endif - memcpy((void *) bootaddr, build_buf, - max(strlen(build_buf), 255)); - flush_cache(bootaddr, max(strlen(build_buf), 255)); + memcpy((void *)bootaddr, build_buf, + max(strlen(build_buf), (size_t)255)); + flush_cache(bootaddr, max(strlen(build_buf), (size_t)255)); } /*