Skip to content
Snippets Groups Projects

android: support boot header version 3 and 4

Closed Safae Ouajih requested to merge souajih/v4_ti into integ/ti-u-boot-2021.01
1 unresolved thread
2 files
+ 49
45
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 13
17
@@ -66,33 +66,29 @@ static int abootimg_get_recovery_dtbo(int argc, char *const argv[])
static int abootimg_get_dtb_load_addr(int argc, char *const argv[])
{
const struct andr_boot_img_hdr_v0_v1_v2 *hdr;
int res = CMD_RET_SUCCESS;
if (argc > 1)
return CMD_RET_USAGE;
hdr = map_sysmem(abootimg_addr(), sizeof(*hdr));
if (!is_android_boot_image_header(hdr)) {
printf("Error: Boot Image header is incorrect\n");
res = CMD_RET_FAILURE;
goto exit;
}
struct andr_image_data img_data = {0};
if (!android_image_get_data((void *)abootimg_addr(), &img_data))
return CMD_RET_FAILURE;
if (hdr->header_version < 2) {
if (img_data.header_version < 2) {
printf("Error: header_version must be >= 2 for this\n");
res = CMD_RET_FAILURE;
goto exit;
return CMD_RET_FAILURE;
}
if (!img_data.dtb_load_addr) {
printf("Error: failed to read dtb_load_addr\n");
return CMD_RET_FAILURE;
}
if (argc == 0)
printf("%lx\n", (ulong)hdr->dtb_addr);
printf("%lx\n", (ulong)img_data.dtb_load_addr);
else
env_set_hex(argv[0], (ulong)hdr->dtb_addr);
env_set_hex(argv[0], (ulong)img_data.dtb_load_addr);
exit:
unmap_sysmem(hdr);
return res;
return CMD_RET_SUCCESS;
}
static int abootimg_get_dtb_by_index(int argc, char *const argv[])
Loading