All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Guillaume La Roque <glaroque@baylibre.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Neil Armstrong <neil.armstrong@linaro.org>
Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io,
	Guillaume La Roque <glaroque@baylibre.com>,
	20241017-android_ab_master-v5-0-43bfcc096d95@salutedevices.com,
	20241017-topic-fastboot-fixes-mkbootimg-v2-0-c3927102d931@linaro.org
Subject: Re: [PATCH 1/6] bootstd: android: add support of bootimage v2
Date: Tue, 22 Oct 2024 15:24:14 +0200	[thread overview]
Message-ID: <87sesouv7l.fsf@baylibre.com> (raw)
In-Reply-To: <20241017-adnroidv2-v1-1-781c939902c9@baylibre.com>

Hi Guillaume,

Thank you for the patch.

On jeu., oct. 17, 2024 at 18:10, Guillaume La Roque <glaroque@baylibre.com> wrote:

> Android bootmeth only support boot image v3/4.
>
> Add support of Android Boot Image version 2 [1].
> Vendor boot image is only supported in version 3 and 4 so don't try to
> read it when header version if version is less than 3.

Remove: "if version":
don't try to read it when header is less than 3.

>
> 1: https://source.android.com/docs/core/architecture/bootloader/boot-image-header#header-v2

Please use standard link notation (using [1] instead of 1:).
See some examples:

https://source.denx.de/u-boot/u-boot/-/commit/9214627f5ecede8610e33abf2de5a0083f3f80ce
https://source.denx.de/u-boot/u-boot/-/commit/608a31bdec6284ad6f821226e4c62c9cd3052874

With that fixed:

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

>
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> ---
>  boot/bootmeth_android.c | 27 ++++++++++++---------------
>  1 file changed, 12 insertions(+), 15 deletions(-)
>
> diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
> index 19b1f2c377b9..2e7f85e4a708 100644
> --- a/boot/bootmeth_android.c
> +++ b/boot/bootmeth_android.c
> @@ -259,16 +259,12 @@ static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow)
>  		goto free_priv;
>  	}
>  
> -	if (priv->header_version != 4) {
> -		log_debug("only boot.img v4 is supported %u\n", priv->header_version);
> -		ret = -EINVAL;
> -		goto free_priv;
> -	}
> -
> -	ret = scan_vendor_boot_part(bflow->blk, priv);
> -	if (ret < 0) {
> -		log_debug("scan vendor_boot failed: err=%d\n", ret);
> -		goto free_priv;
> +	if (priv->header_version >= 3) {
> +		ret = scan_vendor_boot_part(bflow->blk, priv);
> +		if (ret < 0) {
> +			log_debug("scan vendor_boot failed: err=%d\n", ret);
> +			goto free_priv;
> +		}
>  	}
>  
>  	/*
> @@ -476,12 +472,13 @@ static int boot_android_normal(struct bootflow *bflow)
>  	if (ret < 0)
>  		return log_msg_ret("read boot", ret);
>  
> -	ret = read_slotted_partition(desc, "vendor_boot", priv->slot, vloadaddr);
> -	if (ret < 0)
> -		return log_msg_ret("read vendor_boot", ret);
> -
> +	if (priv->header_version >= 3) {
> +		ret = read_slotted_partition(desc, "vendor_boot", priv->slot, vloadaddr);
> +		if (ret < 0)
> +			return log_msg_ret("read vendor_boot", ret);
> +		set_avendor_bootimg_addr(vloadaddr);
> +	}
>  	set_abootimg_addr(loadaddr);
> -	set_avendor_bootimg_addr(vloadaddr);
>  
>  	ret = bootm_boot_start(loadaddr, bflow->cmdline);
>  
>
> -- 
> 2.34.1


  reply	other threads:[~2024-10-22 13:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:10 [PATCH 0/6] Add support of Android Boot Image version 2 and non-AB image Guillaume La Roque
2024-10-17 16:10 ` [PATCH 1/6] bootstd: android: add support of bootimage v2 Guillaume La Roque
2024-10-22 13:24   ` Mattijs Korpershoek [this message]
2024-11-08 10:08   ` Julien Masson
2024-10-17 16:10 ` [PATCH 2/6] bootstd: android: add non-A/B image support Guillaume La Roque
2024-10-22 13:42   ` Mattijs Korpershoek
2024-10-17 16:10 ` [PATCH 3/6] configs: khadas-vim3{l}: fix userdata size Guillaume La Roque
2024-10-22 12:25   ` Mattijs Korpershoek
2024-11-08 10:05   ` Mattijs Korpershoek
2024-11-08 10:10     ` Neil Armstrong
2024-10-17 16:10 ` [PATCH 4/6] configs: khadas-vim3l_android{_ab}: move on bootmeth android Guillaume La Roque
2024-10-22 12:43   ` Mattijs Korpershoek
2024-10-17 16:10 ` [PATCH 5/6] configs: khadas-vim3_android{_ab}: " Guillaume La Roque
2024-10-22 12:46   ` Mattijs Korpershoek
2024-10-17 16:10 ` [PATCH 6/6] bootstd: Add test for Android boot image v2 Guillaume La Roque
2024-10-22 12:56   ` Mattijs Korpershoek
2024-11-08 10:11 ` (subset) [PATCH 0/6] Add support of Android Boot Image version 2 and non-AB image Neil Armstrong
2024-11-08 10:38   ` Mattijs Korpershoek

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=87sesouv7l.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=20241017-android_ab_master-v5-0-43bfcc096d95@salutedevices.com \
    --cc=20241017-topic-fastboot-fixes-mkbootimg-v2-0-c3927102d931@linaro.org \
    --cc=glaroque@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-amlogic@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.