U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: George Chan via B4 Relay <devnull+gchan9527.gmail.com@kernel.org>
To: Tom Rini <trini@konsulko.com>,
	 Mattijs Korpershoek <mkorpershoek@kernel.org>,
	 Simon Glass <sjg@chromium.org>,
	Casey Connolly <casey.connolly@linaro.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	 Sumit Garg <sumit.garg@kernel.org>
Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io,
	 George Chan <gchan9527@gmail.com>
Subject: [PATCH 2/3] boot/bootmeth-android.c: Reuse fastboot memory block for unzip kernel
Date: Sun, 27 Apr 2025 19:25:21 +0800	[thread overview]
Message-ID: <20250427-android-boot-v1-2-bb6b37c9c9f1@gmail.com> (raw)
In-Reply-To: <20250427-android-boot-v1-0-bb6b37c9c9f1@gmail.com>

From: George Chan <gchan9527@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@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



  parent reply	other threads:[~2025-04-27 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27 11:25 [PATCH 0/3] u-boot chain-loading LineageOS bootimg George Chan via B4 Relay
2025-04-27 11:25 ` [PATCH 1/3] boot/image-android.c: Workaround androidboot kernel/ramdisk addr George Chan via B4 Relay
2025-04-27 11:25 ` George Chan via B4 Relay [this message]
2025-04-27 11:25 ` [PATCH 3/3] mach-snapdragon: Add support to append string to kernel cmdline George Chan via B4 Relay
2025-04-28 13:53 ` [PATCH 0/3] u-boot chain-loading LineageOS bootimg Casey Connolly
2025-04-29  4:04   ` george chan
2025-04-29  8:30   ` Mattijs Korpershoek
2025-04-30  3:58     ` george chan
2025-04-30 12:03       ` Mattijs Korpershoek
2025-04-30 15:13         ` george chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250427-android-boot-v1-2-bb6b37c9c9f1@gmail.com \
    --to=devnull+gchan9527.gmail.com@kernel.org \
    --cc=casey.connolly@linaro.org \
    --cc=gchan9527@gmail.com \
    --cc=mkorpershoek@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox