diff mbox

[U-Boot,11/13] sunxi: Add support for android boot image

Message ID 1441032373-16992-12-git-send-email-maxime.ripard@free-electrons.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Maxime Ripard Aug. 31, 2015, 2:46 p.m. UTC
When using the fastboot boot command, the image sent to U-Boot will be an
Android boot image. If the support is missing, that won't obviously work,
so we need it in our configuration.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 include/configs/sunxi-common.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Ian Campbell Sept. 1, 2015, 7:08 a.m. UTC | #1
On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> When using the fastboot boot command, the image sent to U-Boot will be an
> Android boot image. If the support is missing, that won't obviously work,
> so we need it in our configuration.

Dumb question: Is it possible to boot anything _other_ than an android
boot image via fastboot?

If not then one of the two config options really ought to imply the
other.

If it is possible to boot something else via fastboot then:
    Acked-by: Ian Campbell <ijc@hellion.org.uk>

Ian.
Maxime Ripard Sept. 1, 2015, 7:15 a.m. UTC | #2
On Tue, Sep 01, 2015 at 08:08:58AM +0100, Ian Campbell wrote:
> On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > When using the fastboot boot command, the image sent to U-Boot will be an
> > Android boot image. If the support is missing, that won't obviously work,
> > so we need it in our configuration.
> 
> Dumb question: Is it possible to boot anything _other_ than an android
> boot image via fastboot?

AFAIK, the fastboot tool will automatically generate an android boot
image when given any image, and will send that. I don't think there's
any way to circumvent that behaviour.

> If not then one of the two config options really ought to imply the
> other.

Yeah, probably.

Maxime
Paul Kocialkowski Sept. 1, 2015, 9 a.m. UTC | #3
Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > When using the fastboot boot command, the image sent to U-Boot will be an
> > Android boot image. If the support is missing, that won't obviously work,
> > so we need it in our configuration.
> 
> Dumb question: Is it possible to boot anything _other_ than an android
> boot image via fastboot?
> 
> If not then one of the two config options really ought to imply the
> other.

Well, those options have not been moved to Kconfig yet, but when they
do, there should indeed be such a dependency.

Otherwise, I believe it still makes sense to have two separate options
because one might want Android boot image support without fastboot.

> If it is possible to boot something else via fastboot then:
>     Acked-by: Ian Campbell <ijc@hellion.org.uk>
> 
> Ian.
Ian Campbell Sept. 1, 2015, 10:46 a.m. UTC | #4
On Tue, 2015-09-01 at 11:00 +0200, Paul Kocialkowski wrote:
> Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> > On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > > When using the fastboot boot command, the image sent to U-Boot will 
> > > be an
> > > Android boot image. If the support is missing, that won't obviously 
> > > work,
> > > so we need it in our configuration.
> > 
> > Dumb question: Is it possible to boot anything _other_ than an android
> > boot image via fastboot?
> > 
> > If not then one of the two config options really ought to imply the
> > other.
> 
> Well, those options have not been moved to Kconfig yet, but when they
> do, there should indeed be such a dependency.
> 
> Otherwise, I believe it still makes sense to have two separate options
> because one might want Android boot image support without fastboot.

Then fastboot should depend on android boot image support but not vice
-versa.

> 
> > If it is possible to boot something else via fastboot then:
> >     Acked-by: Ian Campbell <ijc@hellion.org.uk>
> > 
> > Ian.
>
Maxime Ripard Sept. 1, 2015, 11:28 a.m. UTC | #5
On Tue, Sep 01, 2015 at 11:00:53AM +0200, Paul Kocialkowski wrote:
> Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> > On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > > When using the fastboot boot command, the image sent to U-Boot will be an
> > > Android boot image. If the support is missing, that won't obviously work,
> > > so we need it in our configuration.
> > 
> > Dumb question: Is it possible to boot anything _other_ than an android
> > boot image via fastboot?
> > 
> > If not then one of the two config options really ought to imply the
> > other.
> 
> Well, those options have not been moved to Kconfig yet, but when they
> do, there should indeed be such a dependency.
> 
> Otherwise, I believe it still makes sense to have two separate options
> because one might want Android boot image support without fastboot.

Ah, good point, Android stores its kernel/initrd in that format. So
even if you don't want fastboot, you might want the support for the
image itself.

Maxime
Maxime Ripard Sept. 1, 2015, 11:29 a.m. UTC | #6
On Tue, Sep 01, 2015 at 11:46:05AM +0100, Ian Campbell wrote:
> On Tue, 2015-09-01 at 11:00 +0200, Paul Kocialkowski wrote:
> > Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> > > On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > > > When using the fastboot boot command, the image sent to U-Boot will 
> > > > be an
> > > > Android boot image. If the support is missing, that won't obviously 
> > > > work,
> > > > so we need it in our configuration.
> > > 
> > > Dumb question: Is it possible to boot anything _other_ than an android
> > > boot image via fastboot?
> > > 
> > > If not then one of the two config options really ought to imply the
> > > other.
> > 
> > Well, those options have not been moved to Kconfig yet, but when they
> > do, there should indeed be such a dependency.
> > 
> > Otherwise, I believe it still makes sense to have two separate options
> > because one might want Android boot image support without fastboot.
> 
> Then fastboot should depend on android boot image support but not vice
> -versa.

Indeed, but it's not yet a Kconfig option.

Maxime
Ian Campbell Sept. 1, 2015, 1:54 p.m. UTC | #7
On Tue, 2015-09-01 at 13:29 +0200, Maxime Ripard wrote:
> On Tue, Sep 01, 2015 at 11:46:05AM +0100, Ian Campbell wrote:
> > On Tue, 2015-09-01 at 11:00 +0200, Paul Kocialkowski wrote:
> > > Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> > > > On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > > > > When using the fastboot boot command, the image sent to U-Boot 
> > > > > will 
> > > > > be an
> > > > > Android boot image. If the support is missing, that won't 
> > > > > obviously 
> > > > > work,
> > > > > so we need it in our configuration.
> > > > 
> > > > Dumb question: Is it possible to boot anything _other_ than an 
> > > > android
> > > > boot image via fastboot?
> > > > 
> > > > If not then one of the two config options really ought to imply the
> > > > other.
> > > 
> > > Well, those options have not been moved to Kconfig yet, but when they
> > > do, there should indeed be such a dependency.
> > > 
> > > Otherwise, I believe it still makes sense to have two separate 
> > > options
> > > because one might want Android boot image support without fastboot.
> > 
> > Then fastboot should depend on android boot image support but not vice
> > -versa.
> 
> Indeed, but it's not yet a Kconfig option.

I'm not sure that's a necessary prerequisite, in some common place do:

#if defined(CONFIG_CMD_FASTBOOT) && !defined(CONFIG_ANDROID_BOOT_IMAGE)
#define CONFIG_ANDROID_BOOT_IMAGE
#endif

Ian.
Paul Kocialkowski Sept. 1, 2015, 1:59 p.m. UTC | #8
Le mardi 01 septembre 2015 à 14:54 +0100, Ian Campbell a écrit :
> On Tue, 2015-09-01 at 13:29 +0200, Maxime Ripard wrote:
> > On Tue, Sep 01, 2015 at 11:46:05AM +0100, Ian Campbell wrote:
> > > On Tue, 2015-09-01 at 11:00 +0200, Paul Kocialkowski wrote:
> > > > Le mardi 01 septembre 2015 à 08:08 +0100, Ian Campbell a écrit :
> > > > > On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
> > > > > > When using the fastboot boot command, the image sent to U-Boot 
> > > > > > will 
> > > > > > be an
> > > > > > Android boot image. If the support is missing, that won't 
> > > > > > obviously 
> > > > > > work,
> > > > > > so we need it in our configuration.
> > > > > 
> > > > > Dumb question: Is it possible to boot anything _other_ than an 
> > > > > android
> > > > > boot image via fastboot?
> > > > > 
> > > > > If not then one of the two config options really ought to imply the
> > > > > other.
> > > > 
> > > > Well, those options have not been moved to Kconfig yet, but when they
> > > > do, there should indeed be such a dependency.
> > > > 
> > > > Otherwise, I believe it still makes sense to have two separate 
> > > > options
> > > > because one might want Android boot image support without fastboot.
> > > 
> > > Then fastboot should depend on android boot image support but not vice
> > > -versa.
> > 
> > Indeed, but it's not yet a Kconfig option.
> 
> I'm not sure that's a necessary prerequisite, in some common place do:
> 
> #if defined(CONFIG_CMD_FASTBOOT) && !defined(CONFIG_ANDROID_BOOT_IMAGE)
> #define CONFIG_ANDROID_BOOT_IMAGE
> #endif

Well, I'm not sure adding Kconfig-style logic really is a good idea as
it removes some incentive to do things right and move everything over to
Kconfig (which is out of the scope of this patch set, I believe).

In addition, I don't see what a relevant place to but this in would be.
Putting that in sunxi-common.h is just adding two useless extra lines
(having the define is sufficient).

Overall, I don't think this is a good idea when we have Kconfig around
the corner to do things right…
Rob Herring (Arm) Sept. 8, 2015, 1:12 p.m. UTC | #9
On Tue, Sep 1, 2015 at 2:08 AM, Ian Campbell <ijc@hellion.org.uk> wrote:
> On Mon, 2015-08-31 at 16:46 +0200, Maxime Ripard wrote:
>> When using the fastboot boot command, the image sent to U-Boot will be an
>> Android boot image. If the support is missing, that won't obviously work,
>> so we need it in our configuration.
>
> Dumb question: Is it possible to boot anything _other_ than an android
> boot image via fastboot?

Yes, fastboot just writes either raw block data or sparse images to
partitions. While the client tool can create the boot image for you,
that is purely a client side feature. What you can boot is determined
by your boot scripts. You can also boot an Android boot image with
bootm and without any fastboot support.

Rob
diff mbox

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 710521c617f5..ee81fa9a1142 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -364,6 +364,7 @@  extern int soft_i2c_gpio_scl;
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
 #define CONFIG_FASTBOOT_BUF_SIZE	(256 << 20)
+#define CONFIG_ANDROID_BOOT_IMAGE
 
 #define CONFIG_FASTBOOT_FLASH
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV	0