diff mbox series

[4/4] fastboot: Enable flashing by default on sunxi

Message ID d0aaa5ee4d33eda37ca2791e9f9365fb2350bb85.1511865262.git-series.maxime.ripard@free-electrons.com
State Superseded
Headers show
Series sunxi: Ease eMMC usage and flashing | expand

Commit Message

Maxime Ripard Nov. 28, 2017, 10:34 a.m. UTC
Now that more and more devices are built using eMMC, providing a way to
easily flash the system without too much hassle seems like a right thing to
do.

Since fastboot is the most deployed tool to do that these days, we can just
rely on it to provide a way to flash the various components in the system
(SPL, U-Boot and the system itself) easily, especially since you can upload
the U-Boot hosting the fastboot "server" through FEL.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 cmd/fastboot/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Andre Przywara Nov. 30, 2017, 12:23 a.m. UTC | #1
On 28/11/17 10:34, Maxime Ripard wrote:
> Now that more and more devices are built using eMMC, providing a way to
> easily flash the system without too much hassle seems like a right thing to
> do.
> 
> Since fastboot is the most deployed tool to do that these days, we can just
> rely on it to provide a way to flash the various components in the system
> (SPL, U-Boot and the system itself) easily, especially since you can upload
> the U-Boot hosting the fastboot "server" through FEL.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

The binary size for 32-bit targets is still reasonable with this
addition (thanks to Thumb2).

But if I enable MUSB for the Pine64 it generates a 537KB u-boot.itb. And
the build process does not complain, I guess because I don't generate a
combined binary (glueing SPL in front). But this isn't really caused by
this patch, so just a heads up.

Cheers,
Andre.

> ---
>  cmd/fastboot/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
> index 4ce7a775e28e..cbb9183ea266 100644
> --- a/cmd/fastboot/Kconfig
> +++ b/cmd/fastboot/Kconfig
> @@ -66,6 +66,7 @@ config FASTBOOT_USB_DEV
>  
>  config FASTBOOT_FLASH
>  	bool "Enable FASTBOOT FLASH command"
> +	default y if ARCH_SUNXI
>  	help
>  	  The fastboot protocol includes a "flash" command for writing
>  	  the downloaded image to a non-volatile storage device. Define
>
Maxime Ripard Nov. 30, 2017, 7:58 a.m. UTC | #2
On Thu, Nov 30, 2017 at 12:23:28AM +0000, André Przywara wrote:
> On 28/11/17 10:34, Maxime Ripard wrote:

> > Now that more and more devices are built using eMMC, providing a way to

> > easily flash the system without too much hassle seems like a right thing to

> > do.

> > 

> > Since fastboot is the most deployed tool to do that these days, we can just

> > rely on it to provide a way to flash the various components in the system

> > (SPL, U-Boot and the system itself) easily, especially since you can upload

> > the U-Boot hosting the fastboot "server" through FEL.

> > 

> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

> 

> Reviewed-by: Andre Przywara <andre.przywara@arm.com>

> 

> The binary size for 32-bit targets is still reasonable with this

> addition (thanks to Thumb2).

> 

> But if I enable MUSB for the Pine64 it generates a 537KB u-boot.itb. And

> the build process does not complain, I guess because I don't generate a

> combined binary (glueing SPL in front). But this isn't really caused by

> this patch, so just a heads up.


I guess we would need to have kind of the same check at compile time
for ARM64 then. I'm not sure exactly how that would be doable
though...

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Andre Przywara Nov. 30, 2017, 9:56 a.m. UTC | #3
Hi,

On 30/11/17 07:58, Maxime Ripard wrote:
> On Thu, Nov 30, 2017 at 12:23:28AM +0000, André Przywara wrote:
>> On 28/11/17 10:34, Maxime Ripard wrote:
>>> Now that more and more devices are built using eMMC, providing a way to
>>> easily flash the system without too much hassle seems like a right thing to
>>> do.
>>>
>>> Since fastboot is the most deployed tool to do that these days, we can just
>>> rely on it to provide a way to flash the various components in the system
>>> (SPL, U-Boot and the system itself) easily, especially since you can upload
>>> the U-Boot hosting the fastboot "server" through FEL.
>>>
>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>
>> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
>>
>> The binary size for 32-bit targets is still reasonable with this
>> addition (thanks to Thumb2).
>>
>> But if I enable MUSB for the Pine64 it generates a 537KB u-boot.itb. And
>> the build process does not complain, I guess because I don't generate a
>> combined binary (glueing SPL in front). But this isn't really caused by
>> this patch, so just a heads up.
> 
> I guess we would need to have kind of the same check at compile time
> for ARM64 then. I'm not sure exactly how that would be doable
> though...

Me neither without digging deeply into the build system ;-)

By the way, can you point me to the part which triggers the generation
of u-boot-sunxi-with-spl.bin? This does not get generated for ARM64 at
the moment, though it should. And this is probably the place where the
check lives for ARM.

Cheers,
Andre.
Maxime Ripard Nov. 30, 2017, 3:50 p.m. UTC | #4
On Thu, Nov 30, 2017 at 09:56:18AM +0000, Andre Przywara wrote:
> Hi,

> 

> On 30/11/17 07:58, Maxime Ripard wrote:

> > On Thu, Nov 30, 2017 at 12:23:28AM +0000, André Przywara wrote:

> >> On 28/11/17 10:34, Maxime Ripard wrote:

> >>> Now that more and more devices are built using eMMC, providing a way to

> >>> easily flash the system without too much hassle seems like a right thing to

> >>> do.

> >>>

> >>> Since fastboot is the most deployed tool to do that these days, we can just

> >>> rely on it to provide a way to flash the various components in the system

> >>> (SPL, U-Boot and the system itself) easily, especially since you can upload

> >>> the U-Boot hosting the fastboot "server" through FEL.

> >>>

> >>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

> >>

> >> Reviewed-by: Andre Przywara <andre.przywara@arm.com>

> >>

> >> The binary size for 32-bit targets is still reasonable with this

> >> addition (thanks to Thumb2).

> >>

> >> But if I enable MUSB for the Pine64 it generates a 537KB u-boot.itb. And

> >> the build process does not complain, I guess because I don't generate a

> >> combined binary (glueing SPL in front). But this isn't really caused by

> >> this patch, so just a heads up.

> > 

> > I guess we would need to have kind of the same check at compile time

> > for ARM64 then. I'm not sure exactly how that would be doable

> > though...

> 

> Me neither without digging deeply into the build system ;-)

> 

> By the way, can you point me to the part which triggers the generation

> of u-boot-sunxi-with-spl.bin? This does not get generated for ARM64 at

> the moment, though it should. And this is probably the place where the

> check lives for ARM.


I *think* this is in arch/arm/cpu/armv7/sunxi/config.mk

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
diff mbox series

Patch

diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index 4ce7a775e28e..cbb9183ea266 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -66,6 +66,7 @@  config FASTBOOT_USB_DEV
 
 config FASTBOOT_FLASH
 	bool "Enable FASTBOOT FLASH command"
+	default y if ARCH_SUNXI
 	help
 	  The fastboot protocol includes a "flash" command for writing
 	  the downloaded image to a non-volatile storage device. Define