diff mbox series

[1/3] image: android: use ulong for kernel address

Message ID 20241016-topic-fastboot-fixes-mkbootimg-v1-1-94fd9340722b@linaro.org
State Superseded
Headers show
Series image: android: misc fixes when using on Qualcomm platforms | expand

Commit Message

Neil Armstrong Oct. 16, 2024, 3:46 p.m. UTC
When booting with platforms having > 4GiB of memory,
the kernel physical address can be more than 32bits.

Use ulong like all the other addresses, and fix the
print to show the > 32bits address numbers.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 boot/image-android.c    | 4 ++--
 include/android_image.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/boot/image-android.c b/boot/image-android.c
index e74dd498a30..bb5f4f84487 100644
--- a/boot/image-android.c
+++ b/boot/image-android.c
@@ -256,7 +256,7 @@  int android_image_get_kernel(const void *hdr,
 			     ulong *os_data, ulong *os_len)
 {
 	struct andr_image_data img_data = {0};
-	u32 kernel_addr;
+	ulong kernel_addr;
 	const struct legacy_img_hdr *ihdr;
 
 	if (!android_image_get_data(hdr, vendor_boot_img, &img_data))
@@ -275,7 +275,7 @@  int android_image_get_kernel(const void *hdr,
 	if (strlen(andr_tmp_str))
 		printf("Android's image name: %s\n", andr_tmp_str);
 
-	printf("Kernel load addr 0x%08x size %u KiB\n",
+	printf("Kernel load addr 0x%08lx size %u KiB\n",
 	       kernel_addr, DIV_ROUND_UP(img_data.kernel_size, 1024));
 
 	int len = 0;
diff --git a/include/android_image.h b/include/android_image.h
index d503c980b23..96820709b42 100644
--- a/include/android_image.h
+++ b/include/android_image.h
@@ -348,7 +348,7 @@  struct andr_image_data {
 	ulong bootconfig_addr;  /* bootconfig image address */
 	ulong bootconfig_size;  /* bootconfig image size */
 
-	u32 kernel_addr;  /* physical load addr */
+	ulong kernel_addr;  /* physical load addr */
 	ulong ramdisk_addr;  /* physical load addr */
 	ulong ramdisk_ptr;  /* ramdisk address */
 	ulong dtb_load_addr;  /* physical load address for DTB image */