All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
@ 2021-05-12 22:43 Oleh Kravchenko
  2021-05-13  8:42 ` Roman Stratiienko
  2021-05-13 15:01 ` Sean Anderson
  0 siblings, 2 replies; 8+ messages in thread
From: Oleh Kravchenko @ 2021-05-12 22:43 UTC (permalink / raw)
  To: u-boot

The current U-Boot version has the next matches for boot partitions:
> mmc0boot0 to EMMC_BOOT1
> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
This patch fixes a typo for the boot partition number.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Marek Vasut <marex@denx.de>
---

 drivers/fastboot/fb_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index 8e74e50e91..1827ce5d12 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
-			fb_mmc_boot_ops(dev_desc, download_buffer, 1,
+			fb_mmc_boot_ops(dev_desc, download_buffer, 2,
 					download_bytes, response);
 		return;
 	}
@@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
 		/* erase EMMC boot2 */
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
-			fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
+			fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
 		return;
 	}
 #endif
-- 
2.26.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-12 22:43 [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot Oleh Kravchenko
@ 2021-05-13  8:42 ` Roman Stratiienko
  2021-05-13  8:58   ` Roman Stratiienko
  2021-05-13 15:01 ` Sean Anderson
  1 sibling, 1 reply; 8+ messages in thread
From: Roman Stratiienko @ 2021-05-13  8:42 UTC (permalink / raw)
  To: u-boot

Hi Oleh,

Thank you for the fix.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>

??, 13 ??? 2021 ?. ? 01:44, Oleh Kravchenko <oleg@kaa.org.ua>:
>
> The current U-Boot version has the next matches for boot partitions:
> > mmc0boot0 to EMMC_BOOT1
> > mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
> This patch fixes a typo for the boot partition number.
>
> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
>
>  drivers/fastboot/fb_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> index 8e74e50e91..1827ce5d12 100644
> --- a/drivers/fastboot/fb_mmc.c
> +++ b/drivers/fastboot/fb_mmc.c
> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
>         if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
>                 dev_desc = fastboot_mmc_get_dev(response);
>                 if (dev_desc)
> -                       fb_mmc_boot_ops(dev_desc, download_buffer, 1,
> +                       fb_mmc_boot_ops(dev_desc, download_buffer, 2,
>                                         download_bytes, response);
>                 return;
>         }
> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
>                 /* erase EMMC boot2 */
>                 dev_desc = fastboot_mmc_get_dev(response);
>                 if (dev_desc)
> -                       fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
> +                       fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
>                 return;
>         }
>  #endif
> --
> 2.26.3
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-13  8:42 ` Roman Stratiienko
@ 2021-05-13  8:58   ` Roman Stratiienko
  2021-05-13 10:29     ` Oleh Kravchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Roman Stratiienko @ 2021-05-13  8:58 UTC (permalink / raw)
  To: u-boot

Looks like there is another issue:
Erasing the USER partition (CONFIG_FASTBOOT_MMC_USER_SUPPORT), will
erase active selected hwpart, and in case it was called after
erasing/flashing BOOT1 & BOOT2 it will erase last selected boot
partition, instead of USER.

??, 13 ??? 2021 ?. ? 11:42, Roman Stratiienko <r.stratiienko@gmail.com>:
>
> Hi Oleh,
>
> Thank you for the fix.
>
> Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
>
> ??, 13 ??? 2021 ?. ? 01:44, Oleh Kravchenko <oleg@kaa.org.ua>:
> >
> > The current U-Boot version has the next matches for boot partitions:
> > > mmc0boot0 to EMMC_BOOT1
> > > mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
> > This patch fixes a typo for the boot partition number.
> >
> > Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
> > Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> > Cc: Marek Vasut <marex@denx.de>
> > ---
> >
> >  drivers/fastboot/fb_mmc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> > index 8e74e50e91..1827ce5d12 100644
> > --- a/drivers/fastboot/fb_mmc.c
> > +++ b/drivers/fastboot/fb_mmc.c
> > @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
> >         if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
> >                 dev_desc = fastboot_mmc_get_dev(response);
> >                 if (dev_desc)
> > -                       fb_mmc_boot_ops(dev_desc, download_buffer, 1,
> > +                       fb_mmc_boot_ops(dev_desc, download_buffer, 2,
> >                                         download_bytes, response);
> >                 return;
> >         }
> > @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
> >                 /* erase EMMC boot2 */
> >                 dev_desc = fastboot_mmc_get_dev(response);
> >                 if (dev_desc)
> > -                       fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
> > +                       fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
> >                 return;
> >         }
> >  #endif
> > --
> > 2.26.3
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-13  8:58   ` Roman Stratiienko
@ 2021-05-13 10:29     ` Oleh Kravchenko
  2021-05-13 10:48       ` Roman Stratiienko
  0 siblings, 1 reply; 8+ messages in thread
From: Oleh Kravchenko @ 2021-05-13 10:29 UTC (permalink / raw)
  To: u-boot

Hello Roman,
Thank you for your code-review!

I've checked how Fastboot works with eMMC's boot and user areas.
Erasing and flashing works just fine:

$ fastboot erase mmc0boot0
Erasing 'mmc0boot0'...
OKAY [  2.948s]
Finished. Total time: 2.983s

> ........ erased 16777216 bytes from mmc hwpart[1]

$ fastboot erase mmc0boot1
Erasing 'mmc0boot1'...
OKAY [  2.952s]
Finished. Total time: 2.989s

> ........ erased 16777216 bytes from mmc hwpart[2]

$ fastboot erase mmc0
Erasing 'mmc0'...
OKAY [ 38.037s]
Finished. Total time: 38.071s

> ........ erased 3850371072 bytes from mmc hwpart[0]

$ fastboot flash mmc0boot0 u-boot.bin
target reported max download size of 1048576 bytes
Sending 'mmc0boot0' (439 KB)...
OKAY [  0.022s]
Writing 'mmc0boot0'...
OKAY [  0.106s]
Finished. Total time: 0.217s

> Starting download of 450560 bytes
> ...
> downloading of 450560 bytes finished
> ........ wrote 450560 bytes to EMMC_BOOT1

$ fastboot flash mmc0boot1 u-boot.bin
target reported max download size of 1048576 bytes
Sending 'mmc0boot1' (439 KB)...
OKAY [  0.022s]
Writing 'mmc0boot1'...
OKAY [  0.107s]
Finished. Total time: 0.219s

> Starting download of 450560 bytes
> ...
> downloading of 450560 bytes finished
> ........ wrote 450560 bytes to EMMC_BOOT2

$ fastboot flash mmc0 /tmp/core-image-minimal.wic 
target reported max download size of 419430400 bytes
Sending 'mmc0' (402048 KB)...
OKAY [ 13.727s]
Writing 'mmc0'...
OKAY [  0.024s]
Finished. Total time: 13.834s

> Starting download of 411697152 bytes
> .................................
> downloading of 411697152 bytes finished

13.05.21 11:58, Roman Stratiienko ????:
> Looks like there is another issue:
> Erasing the USER partition (CONFIG_FASTBOOT_MMC_USER_SUPPORT), will
> erase active selected hwpart, and in case it was called after
> erasing/flashing BOOT1 & BOOT2 it will erase last selected boot
> partition, instead of USER.
> 
> ??, 13 ??? 2021 ?. ? 11:42, Roman Stratiienko <r.stratiienko@gmail.com>:
>>
>> Hi Oleh,
>>
>> Thank you for the fix.
>>
>> Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
>>
>> ??, 13 ??? 2021 ?. ? 01:44, Oleh Kravchenko <oleg@kaa.org.ua>:
>>>
>>> The current U-Boot version has the next matches for boot partitions:
>>>> mmc0boot0 to EMMC_BOOT1
>>>> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
>>> This patch fixes a typo for the boot partition number.
>>>
>>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>> Cc: Marek Vasut <marex@denx.de>
>>> ---
>>>
>>>  drivers/fastboot/fb_mmc.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
>>> index 8e74e50e91..1827ce5d12 100644
>>> --- a/drivers/fastboot/fb_mmc.c
>>> +++ b/drivers/fastboot/fb_mmc.c
>>> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
>>>         if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
>>>                 dev_desc = fastboot_mmc_get_dev(response);
>>>                 if (dev_desc)
>>> -                       fb_mmc_boot_ops(dev_desc, download_buffer, 1,
>>> +                       fb_mmc_boot_ops(dev_desc, download_buffer, 2,
>>>                                         download_bytes, response);
>>>                 return;
>>>         }
>>> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
>>>                 /* erase EMMC boot2 */
>>>                 dev_desc = fastboot_mmc_get_dev(response);
>>>                 if (dev_desc)
>>> -                       fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
>>> +                       fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
>>>                 return;
>>>         }
>>>  #endif
>>> --
>>> 2.26.3
>>>

-- 
Best regards,
Oleh Kravchenko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-13 10:29     ` Oleh Kravchenko
@ 2021-05-13 10:48       ` Roman Stratiienko
  0 siblings, 0 replies; 8+ messages in thread
From: Roman Stratiienko @ 2021-05-13 10:48 UTC (permalink / raw)
  To: u-boot

Oops, sorry, I was wrong, fastboot_mmc_get_dev() is always returning
struct blk_desc; with hwpart=0.

??, 13 ??? 2021 ?. ? 13:29, Oleh Kravchenko <oleg@kaa.org.ua>:
>
> Hello Roman,
> Thank you for your code-review!
>
> I've checked how Fastboot works with eMMC's boot and user areas.
> Erasing and flashing works just fine:
>
> $ fastboot erase mmc0boot0
> Erasing 'mmc0boot0'...
> OKAY [  2.948s]
> Finished. Total time: 2.983s
>
> > ........ erased 16777216 bytes from mmc hwpart[1]
>
> $ fastboot erase mmc0boot1
> Erasing 'mmc0boot1'...
> OKAY [  2.952s]
> Finished. Total time: 2.989s
>
> > ........ erased 16777216 bytes from mmc hwpart[2]
>
> $ fastboot erase mmc0
> Erasing 'mmc0'...
> OKAY [ 38.037s]
> Finished. Total time: 38.071s
>
> > ........ erased 3850371072 bytes from mmc hwpart[0]
>
> $ fastboot flash mmc0boot0 u-boot.bin
> target reported max download size of 1048576 bytes
> Sending 'mmc0boot0' (439 KB)...
> OKAY [  0.022s]
> Writing 'mmc0boot0'...
> OKAY [  0.106s]
> Finished. Total time: 0.217s
>
> > Starting download of 450560 bytes
> > ...
> > downloading of 450560 bytes finished
> > ........ wrote 450560 bytes to EMMC_BOOT1
>
> $ fastboot flash mmc0boot1 u-boot.bin
> target reported max download size of 1048576 bytes
> Sending 'mmc0boot1' (439 KB)...
> OKAY [  0.022s]
> Writing 'mmc0boot1'...
> OKAY [  0.107s]
> Finished. Total time: 0.219s
>
> > Starting download of 450560 bytes
> > ...
> > downloading of 450560 bytes finished
> > ........ wrote 450560 bytes to EMMC_BOOT2
>
> $ fastboot flash mmc0 /tmp/core-image-minimal.wic
> target reported max download size of 419430400 bytes
> Sending 'mmc0' (402048 KB)...
> OKAY [ 13.727s]
> Writing 'mmc0'...
> OKAY [  0.024s]
> Finished. Total time: 13.834s
>
> > Starting download of 411697152 bytes
> > .................................
> > downloading of 411697152 bytes finished
>
> 13.05.21 11:58, Roman Stratiienko ????:
> > Looks like there is another issue:
> > Erasing the USER partition (CONFIG_FASTBOOT_MMC_USER_SUPPORT), will
> > erase active selected hwpart, and in case it was called after
> > erasing/flashing BOOT1 & BOOT2 it will erase last selected boot
> > partition, instead of USER.
> >
> > ??, 13 ??? 2021 ?. ? 11:42, Roman Stratiienko <r.stratiienko@gmail.com>:
> >>
> >> Hi Oleh,
> >>
> >> Thank you for the fix.
> >>
> >> Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
> >>
> >> ??, 13 ??? 2021 ?. ? 01:44, Oleh Kravchenko <oleg@kaa.org.ua>:
> >>>
> >>> The current U-Boot version has the next matches for boot partitions:
> >>>> mmc0boot0 to EMMC_BOOT1
> >>>> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
> >>> This patch fixes a typo for the boot partition number.
> >>>
> >>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
> >>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> >>> Cc: Marek Vasut <marex@denx.de>
> >>> ---
> >>>
> >>>  drivers/fastboot/fb_mmc.c | 4 ++--
> >>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> >>> index 8e74e50e91..1827ce5d12 100644
> >>> --- a/drivers/fastboot/fb_mmc.c
> >>> +++ b/drivers/fastboot/fb_mmc.c
> >>> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
> >>>         if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
> >>>                 dev_desc = fastboot_mmc_get_dev(response);
> >>>                 if (dev_desc)
> >>> -                       fb_mmc_boot_ops(dev_desc, download_buffer, 1,
> >>> +                       fb_mmc_boot_ops(dev_desc, download_buffer, 2,
> >>>                                         download_bytes, response);
> >>>                 return;
> >>>         }
> >>> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
> >>>                 /* erase EMMC boot2 */
> >>>                 dev_desc = fastboot_mmc_get_dev(response);
> >>>                 if (dev_desc)
> >>> -                       fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
> >>> +                       fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
> >>>                 return;
> >>>         }
> >>>  #endif
> >>> --
> >>> 2.26.3
> >>>
>
> --
> Best regards,
> Oleh Kravchenko
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-12 22:43 [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot Oleh Kravchenko
  2021-05-13  8:42 ` Roman Stratiienko
@ 2021-05-13 15:01 ` Sean Anderson
  2021-05-13 15:07   ` Oleh Kravchenko
  1 sibling, 1 reply; 8+ messages in thread
From: Sean Anderson @ 2021-05-13 15:01 UTC (permalink / raw)
  To: u-boot

Hi,

Have you considered trying to flash using e.g.

flashboot flash 0.1 foo.img

instead of

fastboot flash boot0

? I would like to remove these MMC_BOOT2 options but I haven't gotten around to it.

On 5/12/21 6:43 PM, Oleh Kravchenko wrote:
> The current U-Boot version has the next matches for boot partitions:
>> mmc0boot0 to EMMC_BOOT1
>> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
> This patch fixes a typo for the boot partition number.
> 
> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
> 
>   drivers/fastboot/fb_mmc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> index 8e74e50e91..1827ce5d12 100644
> --- a/drivers/fastboot/fb_mmc.c
> +++ b/drivers/fastboot/fb_mmc.c
> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
>   	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
>   		dev_desc = fastboot_mmc_get_dev(response);
>   		if (dev_desc)
> -			fb_mmc_boot_ops(dev_desc, download_buffer, 1,
> +			fb_mmc_boot_ops(dev_desc, download_buffer, 2,
>   					download_bytes, response);
>   		return;
>   	}
> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
>   		/* erase EMMC boot2 */
>   		dev_desc = fastboot_mmc_get_dev(response);
>   		if (dev_desc)
> -			fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
> +			fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
>   		return;
>   	}
>   #endif
> 

In any case,

Reviewed-by: Sean Anderson <sean.anderson@seco.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-13 15:01 ` Sean Anderson
@ 2021-05-13 15:07   ` Oleh Kravchenko
  2021-05-13 15:16     ` Sean Anderson
  0 siblings, 1 reply; 8+ messages in thread
From: Oleh Kravchenko @ 2021-05-13 15:07 UTC (permalink / raw)
  To: u-boot

Hello Sean,
I've used these commands:
> fastboot flash mmc0boot0 u-boot-o4-imx6ull-nano.bin
> fastboot flash mmc0boot1 u-boot-o4-imx6ull-nano.bin


But these ones, doesn't work:
> fastboot flash 0.0 u-boot-o4-imx6ull-nano.bin
> Couldn't find partition mmc 0.0

> fastboot flash 0.1 u-boot-o4-imx6ull-nano.bin
> Couldn't find partition mmc 0.1


13.05.21 18:01, Sean Anderson ????:
> Hi,
> 
> Have you considered trying to flash using e.g.
> 
> flashboot flash 0.1 foo.img
> 
> instead of
> 
> fastboot flash boot0
> 
> ? I would like to remove these MMC_BOOT2 options but I haven't gotten around to it.
> 
> On 5/12/21 6:43 PM, Oleh Kravchenko wrote:
>> The current U-Boot version has the next matches for boot partitions:
>>> mmc0boot0 to EMMC_BOOT1
>>> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
>> This patch fixes a typo for the boot partition number.
>>
>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>> Cc: Marek Vasut <marex@denx.de>
>> ---
>>
>> ? drivers/fastboot/fb_mmc.c | 4 ++--
>> ? 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
>> index 8e74e50e91..1827ce5d12 100644
>> --- a/drivers/fastboot/fb_mmc.c
>> +++ b/drivers/fastboot/fb_mmc.c
>> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
>> ????? if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
>> ????????? dev_desc = fastboot_mmc_get_dev(response);
>> ????????? if (dev_desc)
>> -??????????? fb_mmc_boot_ops(dev_desc, download_buffer, 1,
>> +??????????? fb_mmc_boot_ops(dev_desc, download_buffer, 2,
>> ????????????????????? download_bytes, response);
>> ????????? return;
>> ????? }
>> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
>> ????????? /* erase EMMC boot2 */
>> ????????? dev_desc = fastboot_mmc_get_dev(response);
>> ????????? if (dev_desc)
>> -??????????? fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
>> +??????????? fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
>> ????????? return;
>> ????? }
>> ? #endif
>>
> 
> In any case,
> 
> Reviewed-by: Sean Anderson <sean.anderson@seco.com>

-- 
Best regards,
Oleh Kravchenko
Phone: +380972763224 | oleg at kaa.org.ua | Skype: oleg_krava

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot
  2021-05-13 15:07   ` Oleh Kravchenko
@ 2021-05-13 15:16     ` Sean Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Sean Anderson @ 2021-05-13 15:16 UTC (permalink / raw)
  To: u-boot



On 5/13/21 11:07 AM, Oleh Kravchenko wrote:
 > Hello Sean,
 > I've used these commands:
 >> fastboot flash mmc0boot0 u-boot-o4-imx6ull-nano.bin
 >> fastboot flash mmc0boot1 u-boot-o4-imx6ull-nano.bin
 >
 >
 > But these ones, doesn't work:
 >> fastboot flash 0.0 u-boot-o4-imx6ull-nano.bin
 >> Couldn't find partition mmc 0.0
 >
 >> fastboot flash 0.1 u-boot-o4-imx6ull-nano.bin
 >> Couldn't find partition mmc 0.1

Hm, can you send me the U-Boot output?

Can you also try adding :0? I noticed it in my partition aliases:

	"fastboot_aliases=setenv fastboot_partition_alias_user ${mmcdev}.0:0; " \
		"setenv fastboot_partition_alias_boot0 ${mmcdev}.1:0; " \
		"setenv fastboot_partition_alias_boot1 ${mmcdev}.2:0;\0" \

--Sean

 >
 >
 > 13.05.21 18:01, Sean Anderson ????:
 >> Hi,
 >>
 >> Have you considered trying to flash using e.g.
 >>
 >> flashboot flash 0.1 foo.img
 >>
 >> instead of
 >>
 >> fastboot flash boot0
 >>
 >> ? I would like to remove these MMC_BOOT2 options but I haven't gotten around to it.
 >>
 >> On 5/12/21 6:43 PM, Oleh Kravchenko wrote:
 >>> The current U-Boot version has the next matches for boot partitions:
 >>>> mmc0boot0 to EMMC_BOOT1
 >>>> mmc0boot1 to EMMC_BOOT1 (should be EMMC_BOOT2)
 >>> This patch fixes a typo for the boot partition number.
 >>>
 >>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
 >>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
 >>> Cc: Marek Vasut <marex@denx.de>
 >>> ---
 >>>
 >>>    drivers/fastboot/fb_mmc.c | 4 ++--
 >>>    1 file changed, 2 insertions(+), 2 deletions(-)
 >>>
 >>> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
 >>> index 8e74e50e91..1827ce5d12 100644
 >>> --- a/drivers/fastboot/fb_mmc.c
 >>> +++ b/drivers/fastboot/fb_mmc.c
 >>> @@ -525,7 +525,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 >>>        if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
 >>>            dev_desc = fastboot_mmc_get_dev(response);
 >>>            if (dev_desc)
 >>> -            fb_mmc_boot_ops(dev_desc, download_buffer, 1,
 >>> +            fb_mmc_boot_ops(dev_desc, download_buffer, 2,
 >>>                        download_bytes, response);
 >>>            return;
 >>>        }
 >>> @@ -655,7 +655,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
 >>>            /* erase EMMC boot2 */
 >>>            dev_desc = fastboot_mmc_get_dev(response);
 >>>            if (dev_desc)
 >>> -            fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
 >>> +            fb_mmc_boot_ops(dev_desc, NULL, 2, 0, response);
 >>>            return;
 >>>        }
 >>>    #endif
 >>>
 >>
 >> In any case,
 >>
 >> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
 >

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-13 15:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 22:43 [PATCH] Fix flash and erase of EMMC_BOOT2 with fastboot Oleh Kravchenko
2021-05-13  8:42 ` Roman Stratiienko
2021-05-13  8:58   ` Roman Stratiienko
2021-05-13 10:29     ` Oleh Kravchenko
2021-05-13 10:48       ` Roman Stratiienko
2021-05-13 15:01 ` Sean Anderson
2021-05-13 15:07   ` Oleh Kravchenko
2021-05-13 15:16     ` Sean Anderson

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.