diff mbox

[U-Boot] Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

Message ID 1465656887-26380-1-git-send-email-hdegoede@redhat.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Hans de Goede June 11, 2016, 2:54 p.m. UTC
DISTRO_DEFAULTS is intended to mirror / replace
include/config_distro_defaults.h.

The intend is for boards which include this file to select this from
their Kconfig files and when moving setting to Kconfig which are #define-ed
in config_distro_defaults.h to select this from DISTRO_DEFAULTS so that
boards which have selected DISTRO_DEFAULTS will keep the same configuration
as before without needing any defconfig file changes.

The initial list of selected things matches all settings recently removed
from config_distro_defaults.h because they have been converted to Kconfig,
with the exception of CMD_ELF and CMD_NET, which have a default of y, if
the default of these ever changes they should be selected by DISTRO_DEFAULTS
too.

For testing and example purposes this commit also converts ARCH_SUNXI
to use DISTRO_DEFAULT instead of selecting everything it needs itself.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 Kconfig          | 16 ++++++++++++++++
 arch/arm/Kconfig | 10 +---------
 common/Kconfig   |  1 +
 3 files changed, 18 insertions(+), 9 deletions(-)

Comments

Tom Rini June 11, 2016, 11:13 p.m. UTC | #1
On Sat, Jun 11, 2016 at 04:54:47PM +0200, Hans de Goede wrote:

> DISTRO_DEFAULTS is intended to mirror / replace
> include/config_distro_defaults.h.
> 
> The intend is for boards which include this file to select this from
> their Kconfig files and when moving setting to Kconfig which are #define-ed
> in config_distro_defaults.h to select this from DISTRO_DEFAULTS so that
> boards which have selected DISTRO_DEFAULTS will keep the same configuration
> as before without needing any defconfig file changes.
> 
> The initial list of selected things matches all settings recently removed
> from config_distro_defaults.h because they have been converted to Kconfig,
> with the exception of CMD_ELF and CMD_NET, which have a default of y, if
> the default of these ever changes they should be selected by DISTRO_DEFAULTS
> too.
> 
> For testing and example purposes this commit also converts ARCH_SUNXI
> to use DISTRO_DEFAULT instead of selecting everything it needs itself.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  Kconfig          | 16 ++++++++++++++++
>  arch/arm/Kconfig | 10 +---------
>  common/Kconfig   |  1 +
>  3 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/Kconfig b/Kconfig
> index 4b46216..cc2902c 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -53,6 +53,22 @@ config CC_OPTIMIZE_FOR_SIZE
>  
>  	  This option is enabled by default for U-Boot.
>  
> +config DISTRO_DEFAULTS
> +	bool "Select defaults suitable for booting general purpose Linux distributions"
> +	default n
> +	select CMD_BOOTZ
> +	select CMD_DHCP
> +	select CMD_EXT2
> +	select CMD_EXT4
> +	select CMD_FAT
> +	select CMD_FS_GENERIC
> +	select CMD_MII
> +	select CMD_PING
> +	select HUSH_PARSER
> +	help
> +	  Select this to enable various options and commands which are suitable
> +	  for building u-boot for booting general purpose Linux distributions.

Thanks for doing this, this part here looks good.

> +
>  config SYS_MALLOC_F
>  	bool "Enable malloc() pool before relocation"
>  	default y if DM
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4aeb4d2..4f6a3b3 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -584,24 +584,16 @@ config TARGET_CM_T43
>  
>  config ARCH_SUNXI
>  	bool "Support sunxi (Allwinner) SoCs"
> -	select CMD_BOOTZ
> -	select CMD_DHCP
> -	select CMD_EXT2
> -	select CMD_EXT4
> -	select CMD_FAT
> -	select CMD_FS_GENERIC
>  	select CMD_GPIO
> -	select CMD_MII
>  	select CMD_MMC if MMC
> -	select CMD_PING
>  	select CMD_USB
> +	select DISTRO_DEFAULTS

Here's what I don't like, and is a double edged sword.  I'd rather see
this default y if ARCH_SUNXI above (and likely to add in a bunch of
other SoCs/etc) so that people that are doing a custom board based on
sunxi or whatever can still turn off what they want to turn off and the
defconfig growth burden goes on them.  Thanks!
Masahiro Yamada June 12, 2016, 7:17 a.m. UTC | #2
Hi Hans,

2016-06-11 23:54 GMT+09:00 Hans de Goede <hdegoede@redhat.com>:
> DISTRO_DEFAULTS is intended to mirror / replace
> include/config_distro_defaults.h.
>
> The intend is for boards which include this file to select this from
> their Kconfig files and when moving setting to Kconfig which are #define-ed
> in config_distro_defaults.h to select this from DISTRO_DEFAULTS so that
> boards which have selected DISTRO_DEFAULTS will keep the same configuration
> as before without needing any defconfig file changes.
>
> The initial list of selected things matches all settings recently removed
> from config_distro_defaults.h because they have been converted to Kconfig,
> with the exception of CMD_ELF and CMD_NET, which have a default of y, if
> the default of these ever changes they should be selected by DISTRO_DEFAULTS
> too.
>
> For testing and example purposes this commit also converts ARCH_SUNXI
> to use DISTRO_DEFAULT instead of selecting everything it needs itself.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Could you update the "Enabling the distro options" section of doc/README.distro
to suggest to enable this option?

Thanks!
Hans de Goede June 12, 2016, 9:30 a.m. UTC | #3
Hi,

On 12-06-16 01:13, Tom Rini wrote:
> On Sat, Jun 11, 2016 at 04:54:47PM +0200, Hans de Goede wrote:
>
>> DISTRO_DEFAULTS is intended to mirror / replace
>> include/config_distro_defaults.h.
>>
>> The intend is for boards which include this file to select this from
>> their Kconfig files and when moving setting to Kconfig which are #define-ed
>> in config_distro_defaults.h to select this from DISTRO_DEFAULTS so that
>> boards which have selected DISTRO_DEFAULTS will keep the same configuration
>> as before without needing any defconfig file changes.
>>
>> The initial list of selected things matches all settings recently removed
>> from config_distro_defaults.h because they have been converted to Kconfig,
>> with the exception of CMD_ELF and CMD_NET, which have a default of y, if
>> the default of these ever changes they should be selected by DISTRO_DEFAULTS
>> too.
>>
>> For testing and example purposes this commit also converts ARCH_SUNXI
>> to use DISTRO_DEFAULT instead of selecting everything it needs itself.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  Kconfig          | 16 ++++++++++++++++
>>  arch/arm/Kconfig | 10 +---------
>>  common/Kconfig   |  1 +
>>  3 files changed, 18 insertions(+), 9 deletions(-)
>>
>> diff --git a/Kconfig b/Kconfig
>> index 4b46216..cc2902c 100644
>> --- a/Kconfig
>> +++ b/Kconfig
>> @@ -53,6 +53,22 @@ config CC_OPTIMIZE_FOR_SIZE
>>
>>  	  This option is enabled by default for U-Boot.
>>
>> +config DISTRO_DEFAULTS
>> +	bool "Select defaults suitable for booting general purpose Linux distributions"
>> +	default n
>> +	select CMD_BOOTZ
>> +	select CMD_DHCP
>> +	select CMD_EXT2
>> +	select CMD_EXT4
>> +	select CMD_FAT
>> +	select CMD_FS_GENERIC
>> +	select CMD_MII
>> +	select CMD_PING
>> +	select HUSH_PARSER
>> +	help
>> +	  Select this to enable various options and commands which are suitable
>> +	  for building u-boot for booting general purpose Linux distributions.
>
> Thanks for doing this, this part here looks good.
>
>> +
>>  config SYS_MALLOC_F
>>  	bool "Enable malloc() pool before relocation"
>>  	default y if DM
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 4aeb4d2..4f6a3b3 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -584,24 +584,16 @@ config TARGET_CM_T43
>>
>>  config ARCH_SUNXI
>>  	bool "Support sunxi (Allwinner) SoCs"
>> -	select CMD_BOOTZ
>> -	select CMD_DHCP
>> -	select CMD_EXT2
>> -	select CMD_EXT4
>> -	select CMD_FAT
>> -	select CMD_FS_GENERIC
>>  	select CMD_GPIO
>> -	select CMD_MII
>>  	select CMD_MMC if MMC
>> -	select CMD_PING
>>  	select CMD_USB
>> +	select DISTRO_DEFAULTS
>
> Here's what I don't like, and is a double edged sword.  I'd rather see
> this default y if ARCH_SUNXI above

Done for v2.

> (and likely to add in a bunch of
> other SoCs/etc)

I agree this likely needs to be done for other SoCs too, but I'm leaving
that up to a follow-up patch. I guess we could do a grep for
#include <config_distro_defaults.h> and get a list of SoCs to enable
this on this way, but I don't want to do that without the maintainers
for the influenced SoCs acking it, so as said that should be done
in follow-up patches, preferably by the SoC maintainers themselves.

I guess this is also what you meant, just making it explicit that
I do not plan to turn this on for other SoCs.

Regards,

Hans
Tom Rini June 12, 2016, 2:04 p.m. UTC | #4
On Sun, Jun 12, 2016 at 11:30:51AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 12-06-16 01:13, Tom Rini wrote:
> >On Sat, Jun 11, 2016 at 04:54:47PM +0200, Hans de Goede wrote:
> >
> >>DISTRO_DEFAULTS is intended to mirror / replace
> >>include/config_distro_defaults.h.
> >>
> >>The intend is for boards which include this file to select this from
> >>their Kconfig files and when moving setting to Kconfig which are #define-ed
> >>in config_distro_defaults.h to select this from DISTRO_DEFAULTS so that
> >>boards which have selected DISTRO_DEFAULTS will keep the same configuration
> >>as before without needing any defconfig file changes.
> >>
> >>The initial list of selected things matches all settings recently removed
> >>from config_distro_defaults.h because they have been converted to Kconfig,
> >>with the exception of CMD_ELF and CMD_NET, which have a default of y, if
> >>the default of these ever changes they should be selected by DISTRO_DEFAULTS
> >>too.
> >>
> >>For testing and example purposes this commit also converts ARCH_SUNXI
> >>to use DISTRO_DEFAULT instead of selecting everything it needs itself.
> >>
> >>Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >>---
> >> Kconfig          | 16 ++++++++++++++++
> >> arch/arm/Kconfig | 10 +---------
> >> common/Kconfig   |  1 +
> >> 3 files changed, 18 insertions(+), 9 deletions(-)
> >>
> >>diff --git a/Kconfig b/Kconfig
> >>index 4b46216..cc2902c 100644
> >>--- a/Kconfig
> >>+++ b/Kconfig
> >>@@ -53,6 +53,22 @@ config CC_OPTIMIZE_FOR_SIZE
> >>
> >> 	  This option is enabled by default for U-Boot.
> >>
> >>+config DISTRO_DEFAULTS
> >>+	bool "Select defaults suitable for booting general purpose Linux distributions"
> >>+	default n
> >>+	select CMD_BOOTZ
> >>+	select CMD_DHCP
> >>+	select CMD_EXT2
> >>+	select CMD_EXT4
> >>+	select CMD_FAT
> >>+	select CMD_FS_GENERIC
> >>+	select CMD_MII
> >>+	select CMD_PING
> >>+	select HUSH_PARSER
> >>+	help
> >>+	  Select this to enable various options and commands which are suitable
> >>+	  for building u-boot for booting general purpose Linux distributions.
> >
> >Thanks for doing this, this part here looks good.
> >
> >>+
> >> config SYS_MALLOC_F
> >> 	bool "Enable malloc() pool before relocation"
> >> 	default y if DM
> >>diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>index 4aeb4d2..4f6a3b3 100644
> >>--- a/arch/arm/Kconfig
> >>+++ b/arch/arm/Kconfig
> >>@@ -584,24 +584,16 @@ config TARGET_CM_T43
> >>
> >> config ARCH_SUNXI
> >> 	bool "Support sunxi (Allwinner) SoCs"
> >>-	select CMD_BOOTZ
> >>-	select CMD_DHCP
> >>-	select CMD_EXT2
> >>-	select CMD_EXT4
> >>-	select CMD_FAT
> >>-	select CMD_FS_GENERIC
> >> 	select CMD_GPIO
> >>-	select CMD_MII
> >> 	select CMD_MMC if MMC
> >>-	select CMD_PING
> >> 	select CMD_USB
> >>+	select DISTRO_DEFAULTS
> >
> >Here's what I don't like, and is a double edged sword.  I'd rather see
> >this default y if ARCH_SUNXI above
> 
> Done for v2.

Thanks.

> >(and likely to add in a bunch of
> >other SoCs/etc)
> 
> I agree this likely needs to be done for other SoCs too, but I'm leaving
> that up to a follow-up patch. I guess we could do a grep for
> #include <config_distro_defaults.h> and get a list of SoCs to enable
> this on this way, but I don't want to do that without the maintainers
> for the influenced SoCs acking it, so as said that should be done
> in follow-up patches, preferably by the SoC maintainers themselves.
> 
> I guess this is also what you meant, just making it explicit that
> I do not plan to turn this on for other SoCs.

Exactly, thanks again.
diff mbox

Patch

diff --git a/Kconfig b/Kconfig
index 4b46216..cc2902c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -53,6 +53,22 @@  config CC_OPTIMIZE_FOR_SIZE
 
 	  This option is enabled by default for U-Boot.
 
+config DISTRO_DEFAULTS
+	bool "Select defaults suitable for booting general purpose Linux distributions"
+	default n
+	select CMD_BOOTZ
+	select CMD_DHCP
+	select CMD_EXT2
+	select CMD_EXT4
+	select CMD_FAT
+	select CMD_FS_GENERIC
+	select CMD_MII
+	select CMD_PING
+	select HUSH_PARSER
+	help
+	  Select this to enable various options and commands which are suitable
+	  for building u-boot for booting general purpose Linux distributions.
+
 config SYS_MALLOC_F
 	bool "Enable malloc() pool before relocation"
 	default y if DM
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4aeb4d2..4f6a3b3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -584,24 +584,16 @@  config TARGET_CM_T43
 
 config ARCH_SUNXI
 	bool "Support sunxi (Allwinner) SoCs"
-	select CMD_BOOTZ
-	select CMD_DHCP
-	select CMD_EXT2
-	select CMD_EXT4
-	select CMD_FAT
-	select CMD_FS_GENERIC
 	select CMD_GPIO
-	select CMD_MII
 	select CMD_MMC if MMC
-	select CMD_PING
 	select CMD_USB
+	select DISTRO_DEFAULTS
 	select DM
 	select DM_ETH
 	select DM_GPIO
 	select DM_KEYBOARD
 	select DM_SERIAL
 	select DM_USB
-	select HUSH_PARSER
 	select OF_BOARD_SETUP
 	select OF_CONTROL
 	select OF_SEPARATE
diff --git a/common/Kconfig b/common/Kconfig
index 4d17b10..f86c5a2 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -99,6 +99,7 @@  endmenu
 
 config BOOTDELAY
 	int "delay in seconds before automatically booting"
+	default 2 if DISTRO_DEFAULTS
 	default 0
 	help
 	  Delay before automatically running bootcmd;