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

2014-08-04 Thread Ian Campbell
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 .
> > 
> > Acked-by: Stephen Warren 
> 
> 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.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-04 Thread Hans de Goede
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 .
> 
> Acked-by: Stephen Warren 

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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Stephen Warren

On 08/01/2014 01:46 AM, Hans de Goede wrote:

Use the new standard bootcmd from .


Acked-by: Stephen Warren 


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.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Hans de Goede
Hi,
On 08/01/2014 09:46 AM, Hans de Goede wrote:
> Use the new standard bootcmd from .

Note this applies on top of Stephen Warren's
"[PATCH 1/3] config: introduce a generic $bootcmd"

Regards,

Hans


> 
> Signed-off-by: Hans de Goede 
> ---
>  include/configs/sunxi-common.h | 27 ---
>  1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 4c712f3..f5a702a 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -123,9 +123,6 @@
>  #define CONFIG_ENV_OFFSET(544 << 10) /* (8 + 24 + 512) KiB */
>  #define CONFIG_ENV_SIZE  (128 << 10) /* 128 KiB */
>  
> -#define CONFIG_EXTRA_ENV_SETTINGS \
> - "bootm_size=0x1000\0"
> -
>  #include 
>  #undef CONFIG_CMD_FPGA
>  
> @@ -219,6 +216,30 @@
>  
>  #ifndef CONFIG_SPL_BUILD
>  #include 
> +
> +#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
> +
> +#include 
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> + "bootm_size=0x1000\0" \
> + BOOTENV
> +
> +#else /* ifndef CONFIG_SPL_BUILD */
> +#define CONFIG_EXTRA_ENV_SETTINGS
>  #endif
>  
>  #endif /* _SUNXI_COMMON_CONFIG_H */
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Hans de Goede
Use the new standard bootcmd from .

Signed-off-by: Hans de Goede 
---
 include/configs/sunxi-common.h | 27 ---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 4c712f3..f5a702a 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -123,9 +123,6 @@
 #define CONFIG_ENV_OFFSET  (544 << 10) /* (8 + 24 + 512) KiB */
 #define CONFIG_ENV_SIZE(128 << 10) /* 128 KiB */
 
-#define CONFIG_EXTRA_ENV_SETTINGS \
-   "bootm_size=0x1000\0"
-
 #include 
 #undef CONFIG_CMD_FPGA
 
@@ -219,6 +216,30 @@
 
 #ifndef CONFIG_SPL_BUILD
 #include 
+
+#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
+
+#include 
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "bootm_size=0x1000\0" \
+   BOOTENV
+
+#else /* ifndef CONFIG_SPL_BUILD */
+#define CONFIG_EXTRA_ENV_SETTINGS
 #endif
 
 #endif /* _SUNXI_COMMON_CONFIG_H */
-- 
2.0.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot