common: image: minimal android image iminfo support
authorMichael Trimarchi <michael@amarulasolutions.com>
Fri, 10 Jun 2016 17:54:37 +0000 (19:54 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Jun 2016 21:23:07 +0000 (17:23 -0400)
We already support iminfo for other images. The idea
of this patch is start to have a minimal support for
android image format. We still need to print id[] array

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/bootm.c
common/image-android.c
include/image.h

index f5e91f40a9bf0a2a167d52ab7a215fbbd6b7ab23..16fdea5507be7786299cedf9ac27a2751323add2 100644 (file)
@@ -275,6 +275,12 @@ static int image_info(ulong addr)
                puts("OK\n");
                return 0;
 #endif
+#if defined(CONFIG_ANDROID_BOOT_IMAGE)
+       case IMAGE_FORMAT_ANDROID:
+               puts("   Android image found\n");
+               android_print_contents(hdr);
+               return 0;
+#endif
 #if defined(CONFIG_FIT)
        case IMAGE_FORMAT_FIT:
                puts("   FIT image found\n");
index b6a94b3a30b89ce00e582da1ba81e869d5b4b0d5..ee03b96aaa83d55df3292ce5407850a62e82d1c5 100644 (file)
@@ -145,3 +145,32 @@ int android_image_get_ramdisk(const struct andr_img_hdr *hdr,
        *rd_len = hdr->ramdisk_size;
        return 0;
 }
+
+#if !defined(CONFIG_SPL_BUILD)
+/**
+ * android_print_contents - prints out the contents of the Android format image
+ * @hdr: pointer to the Android format image header
+ *
+ * android_print_contents() formats a multi line Android image contents
+ * description.
+ * The routine prints out Android image properties
+ *
+ * returns:
+ *     no returned results
+ */
+void android_print_contents(const struct andr_img_hdr *hdr)
+{
+       const char * const p = IMAGE_INDENT_STRING;
+
+       printf("%skernel size:      %x\n", p, hdr->kernel_size);
+       printf("%skernel address:   %x\n", p, hdr->kernel_addr);
+       printf("%sramdisk size:     %x\n", p, hdr->ramdisk_size);
+       printf("%sramdisk addrress: %x\n", p, hdr->ramdisk_addr);
+       printf("%ssecond size:      %x\n", p, hdr->second_size);
+       printf("%ssecond address:   %x\n", p, hdr->second_addr);
+       printf("%stags address:     %x\n", p, hdr->tags_addr);
+       printf("%spage size:        %x\n", p, hdr->page_size);
+       printf("%sname:             %s\n", p, hdr->name);
+       printf("%scmdline:          %s\n", p, hdr->cmdline);
+}
+#endif
index a8f6bd16f69c62548ebc293cf426e15d01773435..d788c260e30aeebd345bd65fb7144d1cf5c8cdb8 100644 (file)
@@ -1156,6 +1156,7 @@ int android_image_get_ramdisk(const struct andr_img_hdr *hdr,
                              ulong *rd_data, ulong *rd_len);
 ulong android_image_get_end(const struct andr_img_hdr *hdr);
 ulong android_image_get_kload(const struct andr_img_hdr *hdr);
+void android_print_contents(const struct andr_img_hdr *hdr);
 
 #endif /* CONFIG_ANDROID_BOOT_IMAGE */