Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system
@ 2015-01-10 13:47 Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag Jörg Krause
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

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(-)

-- 
2.2.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 15:39   ` Thomas Petazzoni
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV Jörg Krause
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - Add commit log entry about removing UBOOT_CONFIGURE_OPTS
---
 boot/uboot/uboot.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 8ce2fc2..a9ba054 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 15:39   ` Thomas Petazzoni
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system Jörg Krause
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - Rewrite commit log
---
 boot/uboot/uboot.mk | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a9ba054..d18ad87 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 15:43   ` Thomas Petazzoni
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends Jörg Krause
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
--- 
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(-)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index f3e1778..fe62e34 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -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
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index d18ad87..aa2936f 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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)),)
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
                   ` (2 preceding siblings ...)
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 15:43   ` Thomas Petazzoni
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 5/8] docs/manual/make-tips.mk: Add uboot documentation Jörg Krause
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - Retain backward compatibility (Thomas)
---
 boot/uboot/uboot.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index aa2936f..30dcc49 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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)),)
 
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 5/8] docs/manual/make-tips.mk: Add uboot documentation
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
                   ` (3 preceding siblings ...)
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 6/8] docs/manual/customize-configuration.txt: " Jörg Krause
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

Based on the Barebox documentation text.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - None
---
 docs/manual/make-tips.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/manual/make-tips.txt b/docs/manual/make-tips.txt
index 027eddf..952a91a 100644
--- a/docs/manual/make-tips.txt
+++ b/docs/manual/make-tips.txt
@@ -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:
 
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 6/8] docs/manual/customize-configuration.txt: Add uboot documentation
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
                   ` (4 preceding siblings ...)
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 5/8] docs/manual/make-tips.mk: Add uboot documentation Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 7/8] docs/manual/customize-quick-guide.txt: " Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 8/8] docs/manual/configure-other-components.txt: " Jörg Krause
  7 siblings, 0 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

Based on the Barebox documentation text.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - None
---
 docs/manual/customize-configuration.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/manual/customize-configuration.txt b/docs/manual/customize-configuration.txt
index 6224d40..a3f348d 100644
--- a/docs/manual/customize-configuration.txt
+++ b/docs/manual/customize-configuration.txt
@@ -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+.
-
-
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 7/8] docs/manual/customize-quick-guide.txt: Add uboot documentation
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
                   ` (5 preceding siblings ...)
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 6/8] docs/manual/customize-configuration.txt: " Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 8/8] docs/manual/configure-other-components.txt: " Jörg Krause
  7 siblings, 0 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

Based on the Barebox documentation text.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
Changes v1 -> v2:
  - None
---
 docs/manual/customize-quick-guide.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/manual/customize-quick-guide.txt b/docs/manual/customize-quick-guide.txt
index 4ff185a..627ecba 100644
--- a/docs/manual/customize-quick-guide.txt
+++ b/docs/manual/customize-quick-guide.txt
@@ -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+.
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 8/8] docs/manual/configure-other-components.txt: Add uboot documentation
  2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
                   ` (6 preceding siblings ...)
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 7/8] docs/manual/customize-quick-guide.txt: " Jörg Krause
@ 2015-01-10 13:47 ` Jörg Krause
  7 siblings, 0 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-10 13:47 UTC (permalink / raw)
  To: buildroot

Add documentation for U-Boots Kconfig configuration.

Signed-off-by: J?rg Krause <jkrause@posteo.de>
---
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(+)

diff --git a/docs/manual/configure-other-components.txt b/docs/manual/configure-other-components.txt
index deb1fa2..1ad56e5 100644
--- a/docs/manual/configure-other-components.txt
+++ b/docs/manual/configure-other-components.txt
@@ -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.
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag Jörg Krause
@ 2015-01-10 15:39   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-01-10 15:39 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Sat, 10 Jan 2015 14:47:20 +0100, J?rg Krause wrote:
> 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.
> 
> Signed-off-by: J?rg Krause <jkrause@posteo.de>

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV Jörg Krause
@ 2015-01-10 15:39   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-01-10 15:39 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Sat, 10 Jan 2015 14:47:21 +0100, J?rg Krause wrote:
> Use TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS for building the U-Boot
> target with 'make <board>_(def)config' and 'make'.
> 
> Signed-off-by: J?rg Krause <jkrause@posteo.de>

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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system Jörg Krause
@ 2015-01-10 15:43   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-01-10 15:43 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

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

> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index f3e1778..fe62e34 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -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

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".

> -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

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

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends
  2015-01-10 13:47 ` [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends Jörg Krause
@ 2015-01-10 15:43   ` Thomas Petazzoni
  2015-01-15 20:55     ` Jörg Krause
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2015-01-10 15:43 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

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

>  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

Please use the kconfig-package infrastructure.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends
  2015-01-10 15:43   ` Thomas Petazzoni
@ 2015-01-15 20:55     ` Jörg Krause
  0 siblings, 0 replies; 14+ messages in thread
From: Jörg Krause @ 2015-01-15 20:55 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

On Sa, 2015-01-10 at 16:43 +0100, Thomas Petazzoni wrote:
> Dear J?rg Krause,
> 
> On Sat, 10 Jan 2015 14:47:23 +0100, J?rg Krause wrote:
> 
> >  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
> 
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-01-15 20:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-10 13:47 [Buildroot] [PATCH v2 0/8] Add support for U-Boots Kbuild & Kconfig build system Jörg Krause
2015-01-10 13:47 ` [Buildroot] [PATCH v2 1/8] boot/uboot: Remove obsolete CONFIG_NOSOFTFLOAT flag Jörg Krause
2015-01-10 15:39   ` Thomas Petazzoni
2015-01-10 13:47 ` [Buildroot] [PATCH v2 2/8] boot/uboot: Replace TARGET_CONFIGURE_OPTS with TARGET_MAKE_ENV Jörg Krause
2015-01-10 15:39   ` Thomas Petazzoni
2015-01-10 13:47 ` [Buildroot] [PATCH v2 3/8] boot/uboot: Add support for Kbuild & Kconfig build system Jörg Krause
2015-01-10 15:43   ` Thomas Petazzoni
2015-01-10 13:47 ` [Buildroot] [PATCH v2 4/8] boot/uboot: Add uboot-menuconfig and friends Jörg Krause
2015-01-10 15:43   ` Thomas Petazzoni
2015-01-15 20:55     ` Jörg Krause
2015-01-10 13:47 ` [Buildroot] [PATCH v2 5/8] docs/manual/make-tips.mk: Add uboot documentation Jörg Krause
2015-01-10 13:47 ` [Buildroot] [PATCH v2 6/8] docs/manual/customize-configuration.txt: " Jörg Krause
2015-01-10 13:47 ` [Buildroot] [PATCH v2 7/8] docs/manual/customize-quick-guide.txt: " Jörg Krause
2015-01-10 13:47 ` [Buildroot] [PATCH v2 8/8] docs/manual/configure-other-components.txt: " Jörg Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox