diff options
author | Alex Deymo <deymo@google.com> | 2017-04-02 01:49:47 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-05-11 22:03:37 -0400 |
commit | 210a7176ee11b6af6746ba7ca025f5b9afbcb003 (patch) | |
tree | 331934d551e69736cd6c95cae473bb75e7fccdef /common/image-android.c | |
parent | b1f2a17c780ce9b1d7666bcc6eef82ce9bb4b27f (diff) |
image: Update include/android_image.h
Update the Android image header format to the latest version published
in AOSP. The original code moved to a new repository, so this patch also
updates the reference to that path.
Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image-android.c')
-rw-r--r-- | common/image-android.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/image-android.c b/common/image-android.c index ee03b96aaa..c668407817 100644 --- a/common/image-android.c +++ b/common/image-android.c @@ -161,6 +161,9 @@ int android_image_get_ramdisk(const struct andr_img_hdr *hdr, void android_print_contents(const struct andr_img_hdr *hdr) { const char * const p = IMAGE_INDENT_STRING; + /* os_version = ver << 11 | lvl */ + u32 os_ver = hdr->os_version >> 11; + u32 os_lvl = hdr->os_version & ((1U << 11) - 1); printf("%skernel size: %x\n", p, hdr->kernel_size); printf("%skernel address: %x\n", p, hdr->kernel_addr); @@ -170,6 +173,12 @@ void android_print_contents(const struct andr_img_hdr *hdr) 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); + /* ver = A << 14 | B << 7 | C (7 bits for each of A, B, C) + * lvl = ((Y - 2000) & 127) << 4 | M (7 bits for Y, 4 bits for M) */ + printf("%sos_version: %x (ver: %u.%u.%u, level: %u.%u)\n", + p, hdr->os_version, + (os_ver >> 7) & 0x7F, (os_ver >> 14) & 0x7F, os_ver & 0x7F, + (os_lvl >> 4) + 2000, os_lvl & 0x0F); printf("%sname: %s\n", p, hdr->name); printf("%scmdline: %s\n", p, hdr->cmdline); } |