]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_elf.c
fdt: fixup changes from commit 7a172ae7a3fc
[karo-tx-uboot.git] / common / cmd_elf.c
index a667a469b5684b9e7cbf6979e11add18e8660f5e..58b61c26403b9fe79fe041c7c6cf2b6123309759 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <bootm.h>
 #include <command.h>
 #include <linux/ctype.h>
 #include <net.h>
@@ -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;
@@ -198,7 +198,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         * defaults to 0x4200
         */
        tmp = getenv("bootaddr");
-       if (tmp)
+       if (!tmp)
                bootaddr = CONFIG_SYS_VXWORKS_BOOT_ADDR;
        else
                bootaddr = simple_strtoul(tmp, NULL, 16);
@@ -210,9 +210,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 +240,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));
        }
 
        /*