Skip to contentSkip to conversation

Add support for U-Boots Kbuild & Kconfig build system

PATCH New Jörg Krause 2 participants 14 messages Jan 10, 2015 – Jan 15, 2015

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for U-Boots Kbuild & Kconfig build system

Since version 2014.10 U-Boot uses a Kbuild & Kconfig infrastructure for building targets. This series of patches add support for this new build system while remaining backward compatible to any older version of U-Boot.

J?rg Krause (8):
boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV boot/uboot: Add support for Kbuild & Kconfig build system boot/uboot: Add uboot-menuconfig and friends docs/manual/make-tips.mk: Add uboot documentation docs/manual/customize-configuration.txt: Add uboot documentation docs/manual/customize-quick-guide.txt: Add uboot documentation docs/manual/configure-other-components.txt: Add uboot documentation

 boot/uboot/Config.in                       | 38 +++++++++++++++++++++--
 boot/uboot/uboot.mk                        | 48 +++++++++++++++++++++++++-----
 docs/manual/configure-other-components.txt | 19 ++++++++++++
 docs/manual/customize-configuration.txt    |  8 ++---
 docs/manual/customize-quick-guide.txt      |  2 ++
 docs/manual/make-tips.txt                  |  2 ++
 6 files changed, 103 insertions(+), 14 deletions(-)
Signature · 1 line
2.2.1
#1 lore raw

PATCH v2 1/8 boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag

This flag seems to be obsolete. There is no piece of code in the U-Boot source tree referencing CONFIG_NOSOFTFLOAT.

Unfortunatly the use of this flag is not documented here. Maybe it's about this old workaround:
http://lists.denx.de/pipermail/u-boot/2007-March/020282.html

However, this patch has been declined:
http://www.denx.de/wiki/view/U-Boot/PatchStatus?rev=1.27

Since no other configure options are used, remove also UBOOT_CONFIGURE_OPTS.

---
Changes v1 -> v2:
- Add commit log entry about removing UBOOT_CONFIGURE_OPTS

---
 boot/uboot/uboot.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
boot/uboot/uboot.mk +2 -3
index 8ce2fc2..a9ba054 100644
@@ -58,7 +58,6 @@ endif
 
 UBOOT_ARCH = $(KERNEL_ARCH)
 
-UBOOT_CONFIGURE_OPTS += CONFIG_NOSOFTFLOAT=1
 UBOOT_MAKE_OPTS += \
 	CROSS_COMPILE="$(CCACHE) $(TARGET_CROSS)" \
 	ARCH=$(UBOOT_ARCH)
@@ -95,7 +94,7 @@ UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
 endif
 
 define UBOOT_CONFIGURE_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS) 	\
+	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)		\
 		$(UBOOT_BOARD_NAME)_config
 	@echo >> $(@D)/include/config.h
@@ -114,7 +113,7 @@ define UBOOT_CONFIGURE_CMDS
 endef
 
 define UBOOT_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS) 	\
+	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) 		\
 		$(UBOOT_MAKE_TARGET)
 endef
Signature · 1 line
2.2.1
#2 lore raw

PATCH v2 1/8 boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag

Dear J?rg Krause,

Quoted 7 lines · J?rg Krause

This flag seems to be obsolete. There is no piece of code in the U-Boot source tree referencing CONFIG_NOSOFTFLOAT.

Unfortunatly the use of this flag is not documented here. Maybe it's about this old workaround:
http://lists.denx.de/pipermail/u-boot/2007-March/020282.html

Quoted 6 lines

However, this patch has been declined:
http://www.denx.de/wiki/view/U-Boot/PatchStatus?rev=1.27

Since no other configure options are used, remove also UBOOT_CONFIGURE_OPTS.

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 2/8 boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV

In reply to Jörg Krause

Use TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS for building the U-Boot target with 'make <board>_(def)config' and 'make'.

---
Changes v1 -> v2:
- Rewrite commit log

---
 boot/uboot/uboot.mk | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
boot/uboot/uboot.mk +2 -6
index a9ba054..d18ad87 100644
@@ -94,9 +94,7 @@ UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
 endif
 
 define UBOOT_CONFIGURE_CMDS
-	$(TARGET_CONFIGURE_OPTS) 	\
-		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)		\
-		$(UBOOT_BOARD_NAME)_config
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_BOARD_NAME)_config
 	@echo >> $(@D)/include/config.h
 	@echo "/* Add a wrapper around the values Buildroot sets. */" >> $(@D)/include/config.h
 	@echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(@D)/include/config.h
@@ -113,9 +111,7 @@ define UBOOT_CONFIGURE_CMDS
 endef
 
 define UBOOT_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) 	\
-		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) 		\
-		$(UBOOT_MAKE_TARGET)
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_MAKE_TARGET)
 endef
 
 define UBOOT_BUILD_OMAP_IFT
Signature · 1 line
2.2.1
#4 lore raw

PATCH v2 2/8 boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV

Dear J?rg Krause,

Quoted 4 lines · J?rg Krause

Use TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS for building the U-Boot target with 'make <board>_(def)config' and 'make'.

Why? TARGET_CONFIGURE_OPTS is clearly not the same as TARGET_MAKE_ENV. While I agree that TARGET_MAKE_ENV should be passed, the commit log should contain an explanation as to why TARGET_CONFIGURE_OPTS is not necessary.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH v2 3/8 boot/uboot: Add support for Kbuild & Kconfig build system

In reply to Jörg Krause

Since version 2014.10 U-Boots uses a Kbuild & Kconfig build system. The formerly used configuration file boards.cfg has been converted to Kconfig and is not used anymore. Now, configuration is done with a <board>_defconfig file, which is the entry point of the build.

Building U-Boot can be done with a default <board>_defconfig file located in the configs directory of the U-Boot source tree or with a custom defconfig file.

To use the Kbuild & Kconfig build system for custom U-Boot versions this option has to be enabled by the user.

The Kconfig configuration of the package is based on the Linux and Barebox package infrastructure.

---
Changes v1 -> v2:
- Retain backward compatibility to versions before 2014.10 (Thomas Petazzoni)
- Rewrite of commit log

---
 boot/uboot/Config.in | 38 +++++++++++++++++++++++++++++++++++---
 boot/uboot/uboot.mk  | 27 ++++++++++++++++++++++++++-
 2 files changed, 61 insertions(+), 4 deletions(-)
boot/uboot/Config.in +35 -3
index f3e1778..fe62e34 100644
@@ -4,13 +4,22 @@ config BR2_TARGET_UBOOT
 	  Build "Das U-Boot" Boot Monitor
 
 if BR2_TARGET_UBOOT
+if !BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
 config BR2_TARGET_UBOOT_BOARDNAME
 	string "U-Boot board name"
 	help
 	  One of U-Boot supported boards to be built.
-	  This will be suffixed with _config to meet U-Boot standard naming.
-	  See boards.cfg in U-Boot source code for the list of available
-	  configurations.
+
+	  Since U-Boot version 2014.10 the board configuration files are
+	  located in the directory configs in the U-Boot source tree.
+	  For U-Boot versions before version 2014.10 see boards.cfg in U-Boot
+	  source code for the list of available configurations.
+
+	  The board name will be suffixed with _defconfig in case of building
+	  the target with the Kbuild and Kconfig build system (only available
+	  for U-Boot 2014.10 or newer) or with _config in case of building with
+	  the legacy build system (before U-Boot 2014.10).
+endif
 
 choice
 	prompt "U-Boot Version"
@@ -70,6 +79,29 @@ config BR2_TARGET_UBOOT_VERSION
 	default BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION \
 		if BR2_TARGET_UBOOT_CUSTOM_GIT || BR2_TARGET_UBOOT_CUSTOM_HG
 
+config BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+	bool "Use Kbuild & Kconfig build system"
+	default y if BR2_TARGET_UBOOT_VERSION = "2014.10"
+	help
+	  Use the Kbuild & Kconfig build system for building the target.
+
+	  The Kbuild & Kconfig build system is introduced in U-Boot version
+	  2014.10. The configuration file boards.cfg used in versions before
+	  2014.10 has been converted to Kconfig and is not used anymore.
+	  Instead, the configuration is done with a <board>_defconfig file,
+	  which is the entry point of the build process.
+
+if BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+config BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	bool "Use a custom config file"
+
+config BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE
+	string "Custom config file path"
+	depends on BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	help
+	  Path to the custom <board>_defconfig file.
+endif
+
 config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
 	string "custom patch dir"
 	help
boot/uboot/uboot.mk +26 -1
index d18ad87..aa2936f 100644
@@ -93,8 +93,26 @@ endef
 UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES
 endif
 
-define UBOOT_CONFIGURE_CMDS
+ifeq ($(BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG),y)
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+define UBOOT_CONFIGURE_BOARD
+	$(INSTALL) -m 0644 $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE) $(UBOOT_DIR)/configs/buildroot_defconfig
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) buildroot_defconfig
+	rm $(UBOOT_DIR)/configs/buildroot_defconfig
+endef
+else
+define UBOOT_CONFIGURE_BOARD
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_BOARD_NAME)_defconfig
+endef
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+else
+define UBOOT_CONFIGURE_BOARD
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_BOARD_NAME)_config
+endef
+endif # BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+
+define UBOOT_CONFIGURE_CMDS
+	$(UBOOT_CONFIGURE_BOARD)
 	@echo >> $(@D)/include/config.h
 	@echo "/* Add a wrapper around the values Buildroot sets. */" >> $(@D)/include/config.h
 	@echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(@D)/include/config.h
@@ -166,9 +184,16 @@ $(eval $(generic-package))
 ifeq ($(BR2_TARGET_UBOOT),y)
 # we NEED a board name unless we're at make source
 ifeq ($(filter source,$(MAKECMDGOALS)),)
+
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),)
 ifeq ($(UBOOT_BOARD_NAME),)
 $(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting)
 endif
+else
+ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)),)
+$(error No board configuration file specified, check your BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE setting)
+endif
+endif
 
 ifeq ($(BR2_TARGET_UBOOT_CUSTOM_VERSION),y)
 ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE)),)
Signature · 1 line
2.2.1
#6 lore raw

PATCH v2 3/8 boot/uboot: Add support for Kbuild & Kconfig build system

Dear J?rg Krause,

Quoted 46 lines · J?rg Krause
boot/uboot/Config.in +24 -3
index f3e1778..fe62e34 100644
@@ -4,13 +4,22 @@ config BR2_TARGET_UBOOT
 	  Build "Das U-Boot" Boot Monitor
 
 if BR2_TARGET_UBOOT
+if !BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
 config BR2_TARGET_UBOOT_BOARDNAME
 	string "U-Boot board name"
 	help
 	  One of U-Boot supported boards to be built.
-	  This will be suffixed with _config to meet U-Boot standard naming.
-	  See boards.cfg in U-Boot source code for the list of available
-	  configurations.
+
+	  Since U-Boot version 2014.10 the board configuration files are
+	  located in the directory configs in the U-Boot source tree.
+	  For U-Boot versions before version 2014.10 see boards.cfg in U-Boot
+	  source code for the list of available configurations.
+
+	  The board name will be suffixed with _defconfig in case of building
+	  the target with the Kbuild and Kconfig build system (only available
+	  for U-Boot 2014.10 or newer) or with _config in case of building with
+	  the legacy build system (before U-Boot 2014.10).
+endif
 
 choice
 	prompt "U-Boot Version"
@@ -70,6 +79,29 @@ config BR2_TARGET_UBOOT_VERSION
 	default BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION \
 		if BR2_TARGET_UBOOT_CUSTOM_GIT || BR2_TARGET_UBOOT_CUSTOM_HG
 
+config BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+	bool "Use Kbuild & Kconfig build system"
+	default y if BR2_TARGET_UBOOT_VERSION = "2014.10"
+	help
+	  Use the Kbuild & Kconfig build system for building the target.
+
+	  The Kbuild & Kconfig build system is introduced in U-Boot version
+	  2014.10. The configuration file boards.cfg used in versions before
+	  2014.10 has been converted to Kconfig and is not used anymore.
+	  Instead, the configuration is done with a <board>_defconfig file,
+	  which is the entry point of the build process.
+

boot/uboot/Config.in config BR2_TARGET_UBOOT_VERSION · line 103

Quoted 10 lines
boot/uboot/Config.in +10 -0
+if BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+config BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	bool "Use a custom config file"
+
+config BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE
+	string "Custom config file path"
+	depends on BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	help
+	  Path to the custom <board>_defconfig file.
+endif

Hum, this doesn't look really nice. Maybe we want something more like:

choice
prompt "Build system"
default BR2_TARGET_UBOOT_BUILD_SYSTEM_KBUILD

config BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
bool "legacy"
help
Select this option if you use an old U-Boot (older than XYZ), so that we use the old build system.

config BR2_TARGET_UBOOT_BUILD_SYSTEM_KBUILD
bool "kbuild"
help
Select this option if you use a recent U-Boot (more recent than XYZ), so that we use the kbuild build system.

endchoice

And then have the legacy options enclosed in "if BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY ... endif", and the kbuild options enclosed in "if BR2_TARGET_UBOOT_BUILD_SYSTEM_KBUILD ... endif".

Quoted 28 lines
boot/uboot/Config.in +19 -1
-define UBOOT_CONFIGURE_CMDS
+ifeq ($(BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG),y)
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+define UBOOT_CONFIGURE_BOARD
+	$(INSTALL) -m 0644 $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE) $(UBOOT_DIR)/configs/buildroot_defconfig
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) buildroot_defconfig
+	rm $(UBOOT_DIR)/configs/buildroot_defconfig
+endef
+else
+define UBOOT_CONFIGURE_BOARD
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_BOARD_NAME)_defconfig
+endef
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+else
+define UBOOT_CONFIGURE_BOARD
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) $(UBOOT_BOARD_NAME)_config
+endef
+endif # BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+
+define UBOOT_CONFIGURE_CMDS
+	$(UBOOT_CONFIGURE_BOARD)
 	@echo >> $(@D)/include/config.h
 	@echo "/* Add a wrapper around the values Buildroot sets. */" >> $(@D)/include/config.h
 	@echo "#ifndef __BR2_ADDED_CONFIG_H" >> $(@D)/include/config.h
@@ -166,9 +184,16 @@ $(eval $(generic-package))
 ifeq ($(BR2_TARGET_UBOOT),y)
 # we NEED a board name unless we're at make source
 ifeq ($(filter source,$(MAKECMDGOALS)),)

boot/uboot/Config.in $(eval $(generic-package)) · line 196

Quoted 10 lines
boot/uboot/Config.in +7 -0
+
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),)
 ifeq ($(UBOOT_BOARD_NAME),)
 $(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting)
 endif
+else
+ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)),)
+$(error No board configuration file specified, check your BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE setting)
+endif
+endif

I haven't followed what's going on here, but when configured to use kbuild, we should use the kconfig-package infrastructure.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH v2 4/8 boot/uboot: Add uboot-menuconfig and friends

In reply to Jörg Krause

Add the uboot-menuconfig and friends make targets.

uboot-update-config is not supported since U-Boot uses up to three .config files (.config, spl/.config, tpl/.config) for board configuration. Furthermore U-Boot provides its own custom defconfig format.

---
Changes v1 -> v2:
- Retain backward compatibility (Thomas)

---
 boot/uboot/uboot.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
boot/uboot/uboot.mk +14 -0
index aa2936f..30dcc49 100644
@@ -182,6 +182,20 @@ endif
 $(eval $(generic-package))
 
 ifeq ($(BR2_TARGET_UBOOT),y)
+ifeq ($(BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG),y)
+uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-savedefconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+uboot-update-defconfig: uboot-savedefconfig
+	cp -f $(UBOOT_DIR)/defconfig $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)
+else
+uboot-update-defconfig: ;
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+endif # BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG
+
 # we NEED a board name unless we're at make source
 ifeq ($(filter source,$(MAKECMDGOALS)),)
 
Signature · 1 line
2.2.1
#8 lore raw

PATCH v2 4/8 boot/uboot: Add uboot-menuconfig and friends

Dear J?rg Krause,

Quoted 4 lines · J?rg Krause

ifeq ($(BR2_TARGET_UBOOT),y)

boot/uboot/uboot.mk +3 -0
+ifeq ($(BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG),y)
+uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)

boot/uboot/uboot.mk endif · line 197

Quoted 10 lines
boot/uboot/uboot.mk +10 -0
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-savedefconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+uboot-update-defconfig: uboot-savedefconfig
+	cp -f $(UBOOT_DIR)/defconfig $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)
+else
+uboot-update-defconfig: ;
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+endif # BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG

Please use the kconfig-package infrastructure.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#9 lore raw

PATCH v2 4/8 boot/uboot: Add uboot-menuconfig and friends

Dear Thomas Petazzoni,

Quoted 4 lines · Thomas Petazzoni

Dear J?rg Krause,

On Sat, 10 Jan 2015 14:47:23 +0100, J?rg Krause wrote:

Quoted 16 lines
Quoted 4 lines

ifeq ($(BR2_TARGET_UBOOT),y)

boot/uboot/uboot.mk +3 -0
+ifeq ($(BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG),y)
+uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)

boot/uboot/uboot.mk endif · line 197

Quoted 10 lines
boot/uboot/uboot.mk +10 -0
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-savedefconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+uboot-update-defconfig: uboot-savedefconfig
+	cp -f $(UBOOT_DIR)/defconfig $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)
+else
+uboot-update-defconfig: ;
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+endif # BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG

Please use the kconfig-package infrastructure.

Using the kconfig-package infrastructure requires a .config file to be set with UBOOT_KCONFIG_FILE. This .config file is copied to UBOOT_DIR after patching and before configuration starts.

This causes me some trouble since in the U-Boot build process the .config file (and also spl/.config and tpl/.config) is written by make <board>_defconfig. This command is called in UBOOT_CONFIGURE_CMDS which runs after copying .config to UBOOT_DIR.

The patches are mainly based on the Linux and Barebox packages, which also uses the make _defconfig build step to make the .config file.

Best regards
J?rg Krause

#10 lore raw

PATCH v2 5/8 docs/manual/make-tips.mk: Add uboot documentation

In reply to Jörg Krause

Based on the Barebox documentation text.

---
Changes v1 -> v2:
- None

---
 docs/manual/make-tips.txt | 2 ++
 1 file changed, 2 insertions(+)
docs/manual/make-tips.txt +2 -0
index 027eddf..952a91a 100644
@@ -28,6 +28,8 @@ some settings in the +.config+ file may hide some targets:
   selected in the internal toolchain backend;
 * +barebox-menuconfig+ and +barebox-savedefconfig+ only work when the
   +barebox+ bootloader is enabled.
+* +uboot-menuconfig+ and +uboot-savedefconfig+ only work when the
+  +uboot+ bootloader is enabled.
 
 .Cleaning:
 
Signature · 1 line
2.2.1
#11 lore raw

PATCH v2 6/8 docs/manual/customize-configuration.txt: Add uboot documentation

In reply to Jörg Krause

Based on the Barebox documentation text.

---
Changes v1 -> v2:
- None

---
 docs/manual/customize-configuration.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
docs/manual/customize-configuration.txt +4 -4
index 6224d40..a3f348d 100644
@@ -24,8 +24,8 @@ Alternatively, you can copy the file to any other place and rebuild with
 [[customize-store-package-config]]
 === Storing the configuration of other components
 
-The configuration files for BusyBox, the Linux kernel, Barebox and
-uClibc should be stored as well if changed. For each of these
+The configuration files for BusyBox, the Linux kernel, Barebox, U-Boot
+and uClibc should be stored as well if changed. For each of these
 components, a Buildroot configuration option exists to point to an input
 configuration file, e.g. +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+. To store
 their configuration, set these configuration options to a path where you
@@ -56,7 +56,7 @@ configuration files easier.
   path specified by +BR2_UCLIBC_CONFIG+.
 * +make barebox-update-defconfig+ saves the barebox configuration to the
   path specified by +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+.
+* +make uboot-update-defconfig+ saves the uboot configuration to the
+  path specified by +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE+.
 * For at91bootstrap3, no helper exists so you have to copy the config
   file manually to +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+.
-
-
Signature · 1 line
2.2.1
#12 lore raw

PATCH v2 7/8 docs/manual/customize-quick-guide.txt: Add uboot documentation

In reply to Jörg Krause

Based on the Barebox documentation text.

---
Changes v1 -> v2:
- None

---
 docs/manual/customize-quick-guide.txt | 2 ++
 1 file changed, 2 insertions(+)
docs/manual/customize-quick-guide.txt +2 -0
index 4ff185a..627ecba 100644
@@ -20,6 +20,7 @@ your project can be skipped.
    * +BR2_UCLIBC_CONFIG+
    * +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+
    * +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+
+   * +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE+
 1. Write the configuration files:
    * +make linux-update-defconfig+
    * +make busybox-update-config+
@@ -27,6 +28,7 @@ your project can be skipped.
    * +cp <output>/build/at91bootstrap3-*/.config
      board/<manufacturer>/<boardname>/at91bootstrap3.config+
    * +make barebox-update-defconfig+
+   * +make uboot-update-defconfig+
 1. Create +board/<manufacturer>/<boardname>/rootfs-overlay/+ and fill it
    with additional files you need on your rootfs, e.g.
    +board/<manufacturer>/<boardname>/rootfs-overlay/etc/inittab+.
Signature · 1 line
2.2.1
#13 lore raw

PATCH v2 8/8 docs/manual/configure-other-components.txt: Add uboot documentation

In reply to Jörg Krause

Add documentation for U-Boots Kconfig configuration.

---
Changes v1 -> v2:
- Rewrite help text with regard of configuration only available for newer U-Boot versions

---
 docs/manual/configure-other-components.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
docs/manual/configure-other-components.txt +19 -0
index deb1fa2..1ad56e5 100644
@@ -50,3 +50,22 @@ kernel. The corresponding configuration variables are
 +BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG+ and
 +BR2_TARGET_BAREBOX_USE_DEFCONFIG+. To open the configuration editor,
 use +make barebox-menuconfig+.
+
+U-Boot::
++
+Configuration of U-Boot requires version 2014.10 or newer. Additionaly,
++BR2_TARGET_UBOOT_USE_KBUILD_KCONFIG+ has to be enabled by the user. This
+is done by default for the latest U-Boot version.
++
+If you already have a custom U-Boot configuration file, you can directly
+specify this file in the Buildroot configuration, by selecting
++BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG+.
++
+If you do not yet have a custom U-Boot configuration file, you can either
+start by specifying a board name in the Buildroot configuration, using
++BR2_TARGET_UBOOT_BOARDNAME+, or start by creating an empty file and
+specifying it as custom configuration file, using
++BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG+.
++
+To make subsequent changes to the configuration, use +make
+uboot-menuconfig+ to open the U-Boot configuration editor.
Signature · 1 line
2.2.1