summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-06-23 19:51:27 -0600
committerTom Rini <[email protected]>2025-06-24 07:54:51 -0600
commit59e6462d7c08eeba744afa0f17846c398b8ef9e1 (patch)
treec2269fcfd6ad8622acaa53a4cf8d6f9958b18d4b /boot
parent184e7d0bb211b8885f6715fdd6149ce96a4d1037 (diff)
parent7f4af4c5509ab1bf605bf1af96c854b2c9c354e6 (diff)
Merge tag 'qcom-next-23Jun-1' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon into next
This PR introduces 3 new platforms, two from the new Dragonwing IQx series (QCS615 and QCS8300) as well as the IPQ5424. Additionally: * Support for booting downstream Android boot images on some phones is added * Capsule update support is expanded to be more generic, determining which partition U-Boot was flashed to automatically and supporting many more boards. * Minor capsule update bugs are fixed * A watchdog driver is added and gets timeout support * Autoboot now requires pressing "space" specifically to stop booting as a workaround for some boards getting rogue key presses which would cause autoboot to fail * Documentation is added for the Dragonwing boards * The RB1/2 now use USB gadget mode rather than host * A bug is fixed where GPIO reads could return incorrect values
Diffstat (limited to 'boot')
-rw-r--r--boot/Kconfig11
-rw-r--r--boot/image-android.c9
2 files changed, 17 insertions, 3 deletions
diff --git a/boot/Kconfig b/boot/Kconfig
index 1f5ecb60c77..a671d78e570 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -11,6 +11,17 @@ config ANDROID_BOOT_IMAGE
This enables support for booting images which use the Android
image format header.
+config ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR
+ bool "Android Boot Image ignore addr"
+ default n
+ help
+ This ignore kernel/ramdisk load addr specified in androidboot header.
+
+ There is a concern on exposing the whole memory to image loading is
+ dangerous. Also, since it's not always possible to change the load
+ addr by repacking the boot.img (mainly due to AVB signature mismatch),
+ we need a way to use kernel_addr_r and ramdisk_addr_r.
+
config TIMESTAMP
bool "Show image date and time when displaying image information"
default y if CMD_DATE
diff --git a/boot/image-android.c b/boot/image-android.c
index 459cdb8456c..14cf611cee5 100644
--- a/boot/image-android.c
+++ b/boot/image-android.c
@@ -268,7 +268,8 @@ static ulong android_image_get_kernel_addr(struct andr_image_data *img_data,
*
* Otherwise, we will return the actual value set by the user.
*/
- if (img_data->kernel_addr == ANDROID_IMAGE_DEFAULT_KERNEL_ADDR) {
+ if (img_data->kernel_addr == ANDROID_IMAGE_DEFAULT_KERNEL_ADDR ||
+ IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR)) {
if (comp == IH_COMP_NONE)
return img_data->kernel_ptr;
return env_get_ulong("kernel_addr_r", 16, 0);
@@ -464,7 +465,8 @@ int android_image_get_ramdisk(const void *hdr, const void *vendor_boot_img,
*/
if (img_data.header_version > 2) {
/* Ramdisk can't be used in-place, copy it to ramdisk_addr_r */
- if (img_data.ramdisk_addr == ANDROID_IMAGE_DEFAULT_RAMDISK_ADDR) {
+ if (img_data.ramdisk_addr == ANDROID_IMAGE_DEFAULT_RAMDISK_ADDR ||
+ IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR)) {
ramdisk_ptr = env_get_ulong("ramdisk_addr_r", 16, 0);
if (!ramdisk_ptr) {
printf("Invalid ramdisk_addr_r to copy ramdisk into\n");
@@ -489,7 +491,8 @@ int android_image_get_ramdisk(const void *hdr, const void *vendor_boot_img,
/* Ramdisk can be used in-place, use current ptr */
if (img_data.ramdisk_addr == 0 ||
img_data.ramdisk_addr == ANDROID_IMAGE_DEFAULT_RAMDISK_ADDR ||
- img_data.ramdisk_addr == img_data.kernel_addr) {
+ img_data.ramdisk_addr == img_data.kernel_addr ||
+ IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR)) {
*rd_data = img_data.ramdisk_ptr;
} else {
ramdisk_ptr = img_data.ramdisk_addr;