mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
boot: android: Fix ramdisk loading for v2 header
Before
commit da3447d09fa0 ("android: Fix ramdisk loading for bootimage v3+"),
the ramdisk was loaded from img_data.ramdisk_ptr, ignoring offset
provided via mkbootimg.
commit da3447d09fa0 ("android: Fix ramdisk loading for bootimage v3+")
rightfully fixes this by switching to use img_data.ramdisk_addr instead.
However, it does not copy the ramdisk content to img_data.ramdisk_addr
in case we use boot image v2.
Because of this, we can no longer boot Android on Khadas vim3 board:
[ 3.940361] RAMDISK: Couldn't find valid RAM disk image starting at 0.
Add the missing memcpy() to fix the issue.
Fixes: da3447d09fa0 ("android: Fix ramdisk loading for bootimage v3+")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
0ec0207fe0
commit
1b1ffda420
@ -409,6 +409,10 @@ int android_image_get_ramdisk(const void *hdr, const void *vendor_boot_img,
|
||||
(ramdisk_ptr), (void *)img_data.bootconfig_addr,
|
||||
img_data.bootconfig_size);
|
||||
}
|
||||
} else {
|
||||
ramdisk_ptr = img_data.ramdisk_addr;
|
||||
memcpy((void *)(ramdisk_ptr), (void *)img_data.ramdisk_ptr,
|
||||
img_data.ramdisk_size);
|
||||
}
|
||||
|
||||
printf("RAM disk load addr 0x%08lx size %u KiB\n",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user