diff options
| author | Guillaume La Roque (TI.com) <[email protected]> | 2026-01-12 11:55:38 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2026-01-15 13:55:22 +0100 |
| commit | 8f6d43557056c73469c1e70d2949ebef6ce5ce44 (patch) | |
| tree | c608490acd2f7b46720ea4caf7e425be2a80b36a /cmd | |
| parent | 6b0f079ba260b37a5b3577e6429ba721070ee2bf (diff) | |
boot: android: Add sandbox memory mapping support
Use map_to_sysmem() to convert header pointers to physical addresses
in parse_hdr functions, and add proper map_sysmem()/unmap_sysmem()
calls in android_image_get_data() for sandbox compatibility.
Reviewed-by: Mattijs Korpershoek <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Guillaume La Roque (TI.com) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/abootimg.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/cmd/abootimg.c b/cmd/abootimg.c index 6fb52153786..c488609a8f4 100644 --- a/cmd/abootimg.c +++ b/cmd/abootimg.c @@ -92,26 +92,18 @@ static int abootimg_get_recovery_dtbo(int argc, char *const argv[]) static int abootimg_get_dtb_load_addr(int argc, char *const argv[]) { + struct andr_image_data img_data = {0}; + const void *vendor_boot_hdr = NULL; + if (argc > 1) return CMD_RET_USAGE; - struct andr_image_data img_data = {0}; - const struct andr_boot_img_hdr_v0 *hdr; - const struct andr_vnd_boot_img_hdr *vhdr = NULL; - hdr = map_sysmem(abootimg_addr(), sizeof(*hdr)); if (get_avendor_bootimg_addr() != -1) - vhdr = map_sysmem(get_avendor_bootimg_addr(), sizeof(*vhdr)); + vendor_boot_hdr = (const void *)get_avendor_bootimg_addr(); - if (!android_image_get_data(hdr, vhdr, &img_data)) { - if (get_avendor_bootimg_addr() != -1) - unmap_sysmem(vhdr); - unmap_sysmem(hdr); + if (!android_image_get_data((const void *)abootimg_addr(), + vendor_boot_hdr, &img_data)) return CMD_RET_FAILURE; - } - - if (get_avendor_bootimg_addr() != -1) - unmap_sysmem(vhdr); - unmap_sysmem(hdr); if (img_data.header_version < 2) { printf("Error: header_version must be >= 2 for this\n"); |
