Skip to contentSkip to conversation

Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

PATCH New Hans de Goede 3 participants 4 messages Jun 20, 2016 – Jun 21, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

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.

---
Changes in v2:
-Use "default y if ARCH_SUNXI" instead of selecting DISTRO_DEFAULT for sunxi -Document how to enable DISTRO_DEFAULT in doc/README.distro Changes in v3:
-Rebase on latest master

---
 Kconfig           | 17 +++++++++++++++++
 arch/arm/Kconfig  |  9 ---------
 doc/README.distro |  6 ++++++
 3 files changed, 23 insertions(+), 9 deletions(-)
Kconfig +17 -0
index 817f4f0..3ceff25 100644
@@ -53,6 +53,23 @@ 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 y if ARCH_SUNXI
+	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
arch/arm/Kconfig +0 -9
index f48be96..e9d2fc9 100644
@@ -610,16 +610,8 @@ 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 DM
 	select DM_ETH
@@ -627,7 +619,6 @@ config ARCH_SUNXI
 	select DM_KEYBOARD
 	select DM_SERIAL
 	select DM_USB
-	select HUSH_PARSER
 	select OF_BOARD_SETUP
 	select OF_CONTROL
 	select OF_SEPARATE
doc/README.distro +6 -0
index e1b7216..77d5c6d 100644
@@ -162,6 +162,12 @@ U-Boot Implementation
 Enabling the distro options
 ---------------------------
 
+In your board's defconfig, enable the DISTRO_DEFAULTS option by adding
+a line with "CONFIG_DISTRO_DEFAULTS=y". If you want to enable this
+from Kconfig itself, for e.g. all boards using a specific SoC then
+add a "default y if ARCH_FOO" to the DISTRO_DEFAULTS section of
+the Kconfig file in the root of the u-boot sources.
+
 In your board configuration file, include the following:
 
 ------------------------------------------------------------
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 1/1 Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

2016-06-21 6:16 GMT+09:00 Hans de Goede <[email protected]>:

Quoted 36 lines

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.

---
Changes in v2:

(quoted diff) +0 -2
-Use "default y if ARCH_SUNXI" instead of selecting DISTRO_DEFAULT for sunxi
-Document how to enable DISTRO_DEFAULT in doc/README.distro

Changes in v3:

(quoted diff) +0 -2
-Rebase on latest master
---
 Kconfig           | 17 +++++++++++++++++
 arch/arm/Kconfig  |  9 ---------
 doc/README.distro |  6 ++++++
 3 files changed, 23 insertions(+), 9 deletions(-)
Kconfig +0 -0
index 817f4f0..3ceff25 100644

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 58

Quoted 6 lines
Kconfig +3 -0
@@ -53,6 +53,23 @@ 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 y if ARCH_SUNXI

If we want to allow users to disable distro,
and do not want ARCH_SUNXI appear in a generic config entry, perhaps we can do like this.

config ARCH_SUNXI
bool
select ARCH_SUPPORTS_DISTRO

config DISTRO_DEFAULTS
bool "Select defaults suitable for booting general purpose
Linux distributions"
default y if ARCH_SUPPORTS_DISTRO

Currently it is just fine,
but we might want to do something in the future when we have more platforms to migrate to this way...

config DISTRO_DEFAULTS
bool "Select defaults suitable for booting general purpose Linux
distributions"

     default y if (ARCH_SUNXI || ARCH_TEGRA || ARCH_HISI || ARCH_ZYNQMP ... )

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 68

Quoted 10 lines
Kconfig +10 -0
+       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

Do you mean all of these commands are mandatory for disto? Or just recommended?

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw

PATCH v3 1/1 Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

In reply to Hans de Goede
Quoted 15 lines · Hans de Goede

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.

Quoted 4 lines

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

Applied to u-boot/master, thanks! And I thought I had already applied this, sorry!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160621/68390a09/attachment.sig>
#2 lore raw

PATCH v3 1/1 Kconfig: Add a new DISTRO_DEFAULTS Kconfig option

In reply to Masahiro Yamada
Quoted 63 lines · Masahiro Yamada

2016-06-21 6:16 GMT+09:00 Hans de Goede <[email protected]>:

Quoted 36 lines

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.

---
Changes in v2:

(quoted diff) +0 -2
-Use "default y if ARCH_SUNXI" instead of selecting DISTRO_DEFAULT for sunxi
-Document how to enable DISTRO_DEFAULT in doc/README.distro

Changes in v3:

(quoted diff) +0 -2
-Rebase on latest master
---
 Kconfig           | 17 +++++++++++++++++
 arch/arm/Kconfig  |  9 ---------
 doc/README.distro |  6 ++++++
 3 files changed, 23 insertions(+), 9 deletions(-)
Kconfig +0 -0
index 817f4f0..3ceff25 100644

Kconfig config CC_OPTIMIZE_FOR_SIZE · line 58

Quoted 6 lines
Kconfig +3 -0
@@ -53,6 +53,23 @@ 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 y if ARCH_SUNXI

If we want to allow users to disable distro,
and do not want ARCH_SUNXI appear in a generic config entry, perhaps we can do like this.

config ARCH_SUNXI
bool
select ARCH_SUPPORTS_DISTRO

config DISTRO_DEFAULTS
bool "Select defaults suitable for booting general purpose
Linux distributions"
default y if ARCH_SUPPORTS_DISTRO

Quoted 8 lines

Currently it is just fine,
but we might want to do something in the future when we have more platforms to migrate to this way...

config DISTRO_DEFAULTS
bool "Select defaults suitable for booting general purpose Linux
distributions"

     default y if (ARCH_SUNXI || ARCH_TEGRA || ARCH_HISI || ARCH_ZYNQMP ... )

I suppose that in the long run we'll want to move towards adding in many SUPPORTS_xxx type things to make there be less possible merge conflicts in the main Kconfig files. We may even want to introduce CONFIG_EXPERT and make certain things default unless that's set as we have both the use case of "bring up a new board, easily, that does what I mean" and "I need my board to be as compact as possible" and even "I know exactly what I do and don't want enabled".

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160621/040d88ce/attachment.sig>