Commit 7e5f90fa3ff32ea31548666d57a78005555ecf34

Authored by aliguori
1 parent 5a9154e0

uImage: only try to load 'kernel' images (Hollis Blanchard)

Loading other image types (e.g. IH_TYPE_MULTI, IH_TYPE_FLATDT) is not
implemented.

IH_TYPE_STANDALONE images could be loaded, but would unexpectedly fail if they
tried to use any uboot services.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5765 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 4 deletions
loader.c
@@ -479,9 +479,9 @@ int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr, @@ -479,9 +479,9 @@ int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr,
479 if (hdr->ih_magic != IH_MAGIC) 479 if (hdr->ih_magic != IH_MAGIC)
480 goto out; 480 goto out;
481 481
482 - /* TODO: Implement Multi-File images. */  
483 - if (hdr->ih_type == IH_TYPE_MULTI) {  
484 - fprintf(stderr, "Unable to load multi-file u-boot images\n"); 482 + /* TODO: Implement other image types. */
  483 + if (hdr->ih_type != IH_TYPE_KERNEL) {
  484 + fprintf(stderr, "Can only load u-boot image type \"kernel\"\n");
485 goto out; 485 goto out;
486 } 486 }
487 487
@@ -498,7 +498,7 @@ int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr, @@ -498,7 +498,7 @@ int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr,
498 498
499 /* TODO: Check CPU type. */ 499 /* TODO: Check CPU type. */
500 if (is_linux) { 500 if (is_linux) {
501 - if (hdr->ih_type == IH_TYPE_KERNEL && hdr->ih_os == IH_OS_LINUX) 501 + if (hdr->ih_os == IH_OS_LINUX)
502 *is_linux = 1; 502 *is_linux = 1;
503 else 503 else
504 *is_linux = 0; 504 *is_linux = 0;