aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-08-27 15:42:41 -0400
committerRob Herring <robh@kernel.org>2015-10-05 14:13:31 -0500
commit9992fbcb82a341dd15c9edfb646ae5a41c6bc484 (patch)
treec48985b7807946f717c993ccedadb16d540c8bd1
parent54e3c386117c8ef4b80870308e8f0e6d658688fd (diff)
common/image.c: Make boot_get_ramdisk() perform a check for Android images
In 2dd4632 the check for where a ramdisk is found on an Android image was got moved into the "normal" loop here, causing people to have to pass the kernel address in the ramdisk address location in order to have Android boot still. This changed previous behavior so perform a check early in the function to see if we have an Android image and if so use that as where to look for the ramdisk (which is what the rest of the code here expects). Cc: Rob Herring <robh@kernel.org> Reported-by: Paul Kocialkowski <contact@paulk.fr> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--common/image.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/image.c b/common/image.c
index 73fc28821e..3875946268 100644
--- a/common/image.c
+++ b/common/image.c
@@ -897,6 +897,15 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
if (argc >= 2)
select = argv[1];
+#ifdef CONFIG_ANDROID_BOOT_IMAGE
+ /*
+ * Look for an Android boot image.
+ */
+ buf = map_sysmem(images->os.start, 0);
+ if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID)
+ select = argv[0];
+#endif
+
/*
* Look for a '-' which indicates to ignore the
* ramdisk argument