X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=common%2Fimage-android.c;h=5ad3a1fa38a7d32daec1bb967a403a6da96ac90f;hb=ed286bc80e9d237dd1732ced037427e7d9a277a0;hp=018c7594fe71026b9be0f9d446c98577392a348a;hpb=382bee57f19b4454e2015bc19a010bc2d0ab9337;p=people%2Fms%2Fu-boot.git diff --git a/common/image-android.c b/common/image-android.c index 018c7594fe..5ad3a1fa38 100644 --- a/common/image-android.c +++ b/common/image-android.c @@ -72,7 +72,7 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify, len += strlen(hdr->cmdline); } - char *bootargs = getenv("bootargs"); + char *bootargs = env_get("bootargs"); if (bootargs) len += strlen(bootargs); @@ -146,6 +146,25 @@ int android_image_get_ramdisk(const struct andr_img_hdr *hdr, return 0; } +int android_image_get_second(const struct andr_img_hdr *hdr, + ulong *second_data, ulong *second_len) +{ + if (!hdr->second_size) { + *second_data = *second_len = 0; + return -1; + } + + *second_data = (unsigned long)hdr; + *second_data += hdr->page_size; + *second_data += ALIGN(hdr->kernel_size, hdr->page_size); + *second_data += ALIGN(hdr->ramdisk_size, hdr->page_size); + + printf("second address is 0x%lx\n",*second_data); + + *second_len = hdr->second_size; + return 0; +} + #if !defined(CONFIG_SPL_BUILD) /** * android_print_contents - prints out the contents of the Android format image