All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3] Fix flashing of eMMC user area with Fastboot
Date: Tue, 18 May 2021 10:33:09 -0400	[thread overview]
Message-ID: <aaecb666-6354-5e92-6843-f8708a64ebf7@seco.com> (raw)
In-Reply-To: <fb3f1721-8092-921c-8d42-692f1c2a9636@kaa.org.ua>



On 5/14/21 5:26 PM, Oleh Kravchenko wrote:
 > Hello guys,
 > Could you please review and merge this patch?
 >
 > PR successfully passed CI:
 > https://github.com/u-boot/u-boot/pull/75
 >
 > 15.05.21 00:15, Oleh Kravchenko ????:
 >> 'gpt' and 'mmc0' fastboot partitions have been treated as the same device,
 >> but it is wrong.
 >>
 >> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
 >> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
 >> Cc: Marek Vasut <marex@denx.de>
 >> ---
 >> Changes for v2:
 >>     - code cleanup;
 >> Changes for v3:
 >>     - QA passed at https://github.com/u-boot/u-boot/pull/75;
 >>
 >>   drivers/fastboot/fb_mmc.c | 25 ++++++++++++++++++++-----
 >>   1 file changed, 20 insertions(+), 5 deletions(-)
 >>
 >> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
 >> index 2f3837e559..647d3f6c1b 100644
 >> --- a/drivers/fastboot/fb_mmc.c
 >> +++ b/drivers/fastboot/fb_mmc.c
 >> @@ -532,12 +532,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 >>   #endif
 >>
 >>   #if CONFIG_IS_ENABLED(EFI_PARTITION)
 >> -#ifndef CONFIG_FASTBOOT_MMC_USER_SUPPORT
 >>   	if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
 >> -#else
 >> -	if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0 ||
 >> -	    strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
 >> -#endif
 >>   		dev_desc = fastboot_mmc_get_dev(response);
 >>   		if (!dev_desc)
 >>   			return;
 >> @@ -599,9 +594,29 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 >>   	}
 >>   #endif
 >>
 >> +#if CONFIG_IS_ENABLED(FASTBOOT_MMC_USER_SUPPORT)
 >> +	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
 >> +		dev_desc = fastboot_mmc_get_dev(response);
 >> +		if (!dev_desc)
 >> +			return;
 >> +
 >> +		memset(&info, 0, sizeof(info));
 >> +		info.start	= 0;
 >> +		info.size	= dev_desc->lba;
 >> +		info.blksz	= dev_desc->blksz;
 >> +		strlcpy((char *)&info.name, cmd, sizeof(info.name));
 >> +
 >> +		goto write_image;
 >> +	}
 >> +#endif
 >> +
 >>   	if (fastboot_mmc_get_part_info(cmd, &dev_desc, &info, response) < 0)
 >>   		return;
 >>
 >> +#if CONFIG_IS_ENABLED(FASTBOOT_MMC_USER_SUPPORT)
 >> +write_image:
 >> +#endif
 >> +

This is still ugly; perhaps we can combine this with the above if statement. E.g.

	if (!info.size
  	    && fastboot_mmc_get_part_info(cmd, &dev_desc, &info, response) < 0)
  		return;

--Sean

 >>   	if (is_sparse_image(download_buffer)) {
 >>   		struct fb_mmc_sparse sparse_priv;
 >>   		struct sparse_storage sparse;
 >>
 >

      parent reply	other threads:[~2021-05-18 14:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 21:15 [PATCH v3] Fix flashing of eMMC user area with Fastboot Oleh Kravchenko
2021-05-14 21:26 ` Oleh Kravchenko
2021-05-14 21:45   ` Sean Anderson
2021-05-14 22:10     ` Oleh Kravchenko
2021-05-14 22:26       ` Sean Anderson
2021-05-14 22:34         ` Oleh Kravchenko
2021-05-14 22:43           ` Oleh Kravchenko
2021-05-14 22:27       ` Oleh Kravchenko
2021-05-18 10:41   ` Oleh Kravchenko
2021-05-18 12:21     ` Tom Rini
2021-05-18 13:24       ` Oleh Kravchenko
2021-05-18 13:40         ` Tom Rini
2021-05-18 14:32           ` Oleh Kravchenko
2021-05-18 14:33   ` Sean Anderson [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=aaecb666-6354-5e92-6843-f8708a64ebf7@seco.com \
    --to=sean.anderson@seco.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 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.