]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_elf.c
x86: Enable the queensbay cpu directory build
[u-boot] / common / cmd_elf.c
index 970426fb3fb69fa442aff89b76ff9e7b8215622b..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));
        }
 
        /*
@@ -284,7 +284,7 @@ static unsigned long load_elf_image_phdr(unsigned long addr)
 
        /* Load each program header */
        for (i = 0; i < ehdr->e_phnum; ++i) {
-               void *dst = (void *) phdr->p_paddr;
+               void *dst = (void *)(uintptr_t) phdr->p_paddr;
                void *src = (void *) addr + phdr->p_offset;
                debug("Loading phdr %i to 0x%p (%i bytes)\n",
                        i, dst, phdr->p_filesz);
@@ -339,10 +339,11 @@ static unsigned long load_elf_image_shdr(unsigned long addr)
                }
 
                if (shdr->sh_type == SHT_NOBITS) {
-                       memset((void *)shdr->sh_addr, 0, shdr->sh_size);
+                       memset((void *)(uintptr_t) shdr->sh_addr, 0,
+                               shdr->sh_size);
                } else {
                        image = (unsigned char *) addr + shdr->sh_offset;
-                       memcpy((void *) shdr->sh_addr,
+                       memcpy((void *)(uintptr_t) shdr->sh_addr,
                                (const void *) image,
                                shdr->sh_size);
                }