[PATCH 2/3] boot/bootmeth-android.c: Reuse fastboot memory block for unzip kernel
George Chan via B4 Relay
devnull+gchan9527.gmail.com at kernel.org
Sun Apr 27 13:25:21 CEST 2025
From: George Chan <gchan9527 at gmail.com>
Some androidboot images have gzipped kernel so we need to reuse
extra mem block for holding gzipped boot.img, and let loadaddr
to hold unzipped kernel data. Here we choose fastboot memory for
reuse and avoid dramatically increase memory footprint.
Signed-off-by: George Chan <gchan9527 at gmail.com>
---
boot/bootmeth_android.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
index 654ebfdf1fc..27ca2907052 100644
--- a/boot/bootmeth_android.c
+++ b/boot/bootmeth_android.c
@@ -518,6 +518,18 @@ static int boot_android_normal(struct bootflow *bflow)
int ret;
ulong loadaddr = env_get_hex("loadaddr", 0);
ulong vloadaddr = env_get_hex("vendor_boot_comp_addr_r", 0);
+ ulong fastboot_addr_r = env_get_hex("fastboot_addr_r", 0);
+
+ /*
+ * Since there are some soc with very constrain mem footprint
+ * so dont borther to allocate extra block for androidboot img
+ * instead, reuse fastboot mem block for androidboot img
+ *
+ * The idea is to let loadaddr as source boot.img for unzip,
+ * and the original loadaddr is for holding unzipped kernel.
+ */
+ if (fastboot_addr_r)
+ loadaddr = fastboot_addr_r;
ret = run_avb_verification(bflow);
if (ret < 0)
--
2.43.0
More information about the U-Boot
mailing list