public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Lukasz Majewski <lukma@denx.de>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Sumit Garg <sumit.garg@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.denx.de, Caleb Connolly <caleb.connolly@linaro.org>
Subject: Re: [PATCH 2/2] disk: expose partition type flags
Date: Tue, 16 Apr 2024 11:49:54 +0200	[thread overview]
Message-ID: <87le5d4oxp.fsf@baylibre.com> (raw)
In-Reply-To: <20240409-b4-dfu-scsi-v1-2-3e1441a60376@linaro.org>

Hi Caleb,

Thank you for the patch.

On mar., avril 09, 2024 at 15:55, Caleb Connolly <caleb.connolly@linaro.org> wrote:

> GPT partition tables include two bytes worth of vendor defined
> attributes, per partition. ChromeOS and Qualcomm both use these (with
> different encoding!) to handle A/B slot switching with a retry counter.
>
> Expose these via the disk_partition struct so that they can be parsed by
> the relevant board code.
>
> This will be used on Qualcomm boards to determine which slot we're
> booting on so that we can flash capsule updates to the correct one.
>
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

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

> ---
>  disk/part_efi.c | 1 +
>  include/part.h  | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/disk/part_efi.c b/disk/part_efi.c
> index 4ce9243ef25c..d3ce4dd01dcd 100644
> --- a/disk/part_efi.c
> +++ b/disk/part_efi.c
> @@ -292,8 +292,9 @@ int part_get_info_efi(struct blk_desc *desc, int part,
>  	snprintf((char *)info->name, sizeof(info->name), "%s",
>  		 print_efiname(&gpt_pte[part - 1]));
>  	strcpy((char *)info->type, "U-Boot");
>  	info->bootable = get_bootable(&gpt_pte[part - 1]);
> +	info->type_flags = gpt_pte[part - 1].attributes.fields.type_guid_specific;
>  	if (CONFIG_IS_ENABLED(PARTITION_UUIDS)) {
>  		uuid_bin_to_str(gpt_pte[part - 1].unique_partition_guid.b,
>  				(char *)disk_partition_uuid(info),
>  				UUID_STR_FORMAT_GUID);
> diff --git a/include/part.h b/include/part.h
> index 32ee40488563..afae51f1b933 100644
> --- a/include/part.h
> +++ b/include/part.h
> @@ -68,8 +68,9 @@ struct disk_partition {
>  	 * PART_BOOTABLE		the MBR bootable flag is set
>  	 * PART_EFI_SYSTEM_PARTITION	the partition is an EFI system partition
>  	 */
>  	int	bootable;
> +	u16	type_flags;	/* top 16 bits of GPT partition attributes	*/
>  #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
>  	char	uuid[UUID_STR_LEN + 1];	/* filesystem UUID as string, if exists	*/
>  #endif
>  #ifdef CONFIG_PARTITION_TYPE_GUID
>
> -- 
> 2.44.0

      parent reply	other threads:[~2024-04-16  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 13:55 [PATCH 0/2] qcom: capsule update prep (DFU scsi + GPT part type flags) Caleb Connolly
2024-04-09 13:55 ` [PATCH 1/2] dfu: add scsi backend Caleb Connolly
2024-04-16  9:40   ` Mattijs Korpershoek
2024-04-09 13:55 ` [PATCH 2/2] disk: expose partition type flags Caleb Connolly
2024-04-10 10:34   ` Ilias Apalodimas
2024-04-16  9:49   ` Mattijs Korpershoek [this message]

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=87le5d4oxp.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=caleb.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=lukma@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --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