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

Hans de Goede hdegoede at redhat.com
Mon Aug 4 20:35:06 CEST 2014


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.

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

Regards,

Hans


More information about the U-Boot mailing list