[U-Boot] [PATCH 5/7] sunxi-common.h: Use new generic $bootcmd

Ian Campbell ijc at hellion.org.uk
Mon Aug 4 23:21:57 CEST 2014


On Mon, 2014-08-04 at 20:35 +0200, Hans de Goede wrote:
> Hi,
> 
> On 08/01/2014 08:54 PM, Stephen Warren wrote:
> > On 08/01/2014 01:46 AM, Hans de Goede wrote:
> >> Use the new standard bootcmd from <config_distro_bootcmd.h>.
> > 
> > Acked-by: Stephen Warren <swarren at nvidia.com>
> 
> Thanks for the review.
> 
> >> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> > 
> >> +#ifdef CONFIG_AHCI
> >> +#define BOOT_TARGET_DEVICES(func) \
> >> +    func(MMC, mmc, 0) \
> >> +    func(SCSI, scsi, 0) \
> >> +    func(USB, usb, 0) \
> >> +    func(PXE, pxe, na) \
> >> +    func(DHCP, dhcp, na)
> >> +#else
> >> +#define BOOT_TARGET_DEVICES(func) \
> >> +    func(MMC, mmc, 0) \
> >> +    func(USB, usb, 0) \
> >> +    func(PXE, pxe, na) \
> >> +    func(DHCP, dhcp, na)
> >> +#endif
> > 
> > In the spirit of using crazy macros (!) :-) I might code that as:
> > 
> > #ifdef CONFIG_AHCI
> > #define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
> > #else
> > #define BOOT_TARGET_DEVICES_SCSI(func)
> > #endif
> > 
> > #define BOOT_TARGET_DEVICES(func) \
> >     func(MMC, mmc, 0) \
> >     BOOT_TARGET_DEVICES_SCSI(func) \
> >     func(USB, usb, 0) \
> >     func(PXE, pxe, na) \
> >     func(DHCP, dhcp, na)
> > 
> > ... since it doesn't duplicate the rest of the main macro, but either way is fine by me.
> 
> Ah, I like, esp. since in the future we may get boards without
> an USB host (tablets), and then things would get complicated but
> not with your trick.

Agreed, Stephen's way is much better and more flexible. We could use it
even for the non-optional stuff right away I suppose but I'm not sure
there is much point.

> I've modified this patch my personal tree to use your approach.

Ack to that in principal.

Ian.



More information about the U-Boot mailing list