Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure
@ 2015-06-14 12:05 Jörg Krause
  2015-06-14 12:05 ` [Buildroot] [PATCH v3 2/2] docs/manual: add U-Boot configuration Jörg Krause
  2015-06-14 12:46 ` [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Jörg Krause @ 2015-06-14 12:05 UTC (permalink / raw)
  To: buildroot

With the patchset "kconfig: turnaround into single .config"
[http://lists.denx.de/pipermail/u-boot/2015-February/205490.html]
U-Boot switched to a single .config file for board configuration. This allows
us to use the kconfig-package infrastructure.

For providing backward compatibility with older U-Boot version a user choice
between the new Kconfig and the legacy build system is introduced. Kconfig
is chosen as default build system.

This patch supersedes "boot/uboot: Add support for Kbuild & Kconfig build
system" [http://patchwork.ozlabs.org/patch/436498/]

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
Changes v2 -> v3:
  - rebase (Yegor)

Changes v1 -> v2:
  - rebase (Thomas)
  - fix U-Boot version in Legacy help text (Thomas)
  - do not set Kconfig as default (Thomas)
  - fix (def)config input check 
---
 boot/uboot/Config.in | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 boot/uboot/uboot.mk  | 33 ++++++++++++++++++++++++++++++++-
 2 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index e884cc0..f113ad3 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -4,6 +4,25 @@ config BR2_TARGET_UBOOT
 	  Build "Das U-Boot" Boot Monitor
 
 if BR2_TARGET_UBOOT
+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 2015.04),
+	  so that we use the old build system.
+
+config BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+	bool "Kconfig"
+	help
+	  Select this option if you use a recent U-Boot version (2015.04 or
+	  newer), so that we use the Kconfig build system.
+
+endchoice
+
+if BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 config BR2_TARGET_UBOOT_BOARDNAME
 	string "U-Boot board name"
 	help
@@ -11,6 +30,7 @@ config BR2_TARGET_UBOOT_BOARDNAME
 	  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.
+endif
 
 choice
 	prompt "U-Boot Version"
@@ -92,6 +112,33 @@ config BR2_TARGET_UBOOT_PATCH
 
 	  Most users may leave this empty
 
+if BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+choice
+	prompt "U-Boot configuration"
+	default BR2_TARGET_UBOOT_USE_DEFCONFIG
+
+config BR2_TARGET_UBOOT_USE_DEFCONFIG
+	bool "Using an in-tree board defconfig file"
+
+config BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	bool "Using a custom board (def)config file"
+
+endchoice
+
+config BR2_TARGET_UBOOT_BOARD_DEFCONFIG
+	string "Board defconfig"
+	depends on BR2_TARGET_UBOOT_USE_DEFCONFIG
+	help
+	  Name of the board for which U-Boot should be built, without
+	  the _defconfig suffix.
+
+config BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE
+	string "Configuration file path"
+	depends on BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+	help
+	  Path to the U-Boot configuration file.
+endif
+
 choice
 	prompt "U-Boot binary format"
 	default BR2_TARGET_UBOOT_FORMAT_BIN
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 8c10c61..be569d9 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -121,11 +121,24 @@ define UBOOT_APPLY_LOCAL_PATCHES
 endef
 UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_LOCAL_PATCHES
 
+ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY),y)
 define UBOOT_CONFIGURE_CMDS
 	$(TARGET_CONFIGURE_OPTS) 	\
 		$(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)		\
 		$(UBOOT_BOARD_NAME)_config
 endef
+else ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y)
+ifeq ($(BR2_TARGET_UBOOT_USE_DEFCONFIG),y)
+UBOOT_SOURCE_CONFIG = $(UBOOT_DIR)/configs/$(call qstrip,\
+	$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG))_defconfig
+else ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+UBOOT_SOURCE_CONFIG = $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE))
+endif # BR2_TARGET_UBOOT_USE_DEFCONFIG
+
+UBOOT_KCONFIG_FILE = $(UBOOT_SOURCE_CONFIG)
+UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
+UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS)
+endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 
 define UBOOT_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) 	\
@@ -180,12 +193,30 @@ endif
 UBOOT_DEPENDENCIES += host-uboot-tools
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY),y)
 $(eval $(generic-package))
+else ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y)
+$(eval $(kconfig-package))
+endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 
 ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)
+
+ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY),y)
 ifeq ($(UBOOT_BOARD_NAME),)
 $(error No U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting)
-endif
+endif # UBOOT_BOARD_NAME
+else ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y)
+ifeq ($(BR2_TARGET_UBOOT_USE_DEFCONFIG),y)
+ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG)),)
+$(error No board defconfig name specified, check your BR2_TARGET_UBOOT_DEFCONFIG setting)
+endif # qstrip BR2_TARGET_UBOOT_BOARD_DEFCONFIG
+endif # BR2_TARGET_UBOOT_USE_DEFCONFIG
+ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y)
+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 # qstrip BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE
+endif # BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG
+endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 
 ifeq ($(BR2_TARGET_UBOOT_CUSTOM_VERSION),y)
 ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE)),)
-- 
2.4.3

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

* [Buildroot] [PATCH v3 2/2] docs/manual: add U-Boot configuration
  2015-06-14 12:05 [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Jörg Krause
@ 2015-06-14 12:05 ` Jörg Krause
  2015-06-14 12:46 ` [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Jörg Krause @ 2015-06-14 12:05 UTC (permalink / raw)
  To: buildroot

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
Changes v2 -> v3:
  - None

Changes v1 -> v2:
  - None
---
 docs/manual/configure-other-components.txt | 8 ++++++++
 docs/manual/customize-configuration.txt    | 6 ++++--
 docs/manual/customize-quick-guide.txt      | 2 ++
 docs/manual/make-tips.txt                  | 2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/docs/manual/configure-other-components.txt b/docs/manual/configure-other-components.txt
index deb1fa2..60a80f0 100644
--- a/docs/manual/configure-other-components.txt
+++ b/docs/manual/configure-other-components.txt
@@ -50,3 +50,11 @@ 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 (version 2015.04 or newer) is done in the same
+way as for the Linux kernel. The corresponding configuration variables
+are +BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG+ and
++BR2_TARGET_UBOOT_USE_DEFCONFIG+. To open the configuration editor,
+use +make uboot-menuconfig+.
diff --git a/docs/manual/customize-configuration.txt b/docs/manual/customize-configuration.txt
index 6224d40..ae6cebe 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,6 +56,8 @@ 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 U-Boot 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+.
 
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+.
diff --git a/docs/manual/make-tips.txt b/docs/manual/make-tips.txt
index 1cf1544..97a3302 100644
--- a/docs/manual/make-tips.txt
+++ b/docs/manual/make-tips.txt
@@ -34,6 +34,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
+  +U-Boot+ bootloader is enabled.
 
 .Cleaning:
 
-- 
2.4.3

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

* [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure
  2015-06-14 12:05 [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Jörg Krause
  2015-06-14 12:05 ` [Buildroot] [PATCH v3 2/2] docs/manual: add U-Boot configuration Jörg Krause
@ 2015-06-14 12:46 ` Thomas Petazzoni
  2015-06-14 13:18   ` Jörg Krause
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2015-06-14 12:46 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Sun, 14 Jun 2015 14:05:57 +0200, J?rg Krause wrote:
> With the patchset "kconfig: turnaround into single .config"
> [http://lists.denx.de/pipermail/u-boot/2015-February/205490.html]
> U-Boot switched to a single .config file for board configuration. This allows
> us to use the kconfig-package infrastructure.
> 
> For providing backward compatibility with older U-Boot version a user choice
> between the new Kconfig and the legacy build system is introduced. Kconfig
> is chosen as default build system.

This will break plenty of existing configuration that use older
Buildroot versions. Since the legacy configure/build commands also work
with newer U-Boot, I think we should rather have the legacy build logic
used by default.

> This patch supersedes "boot/uboot: Add support for Kbuild & Kconfig build
> system" [http://patchwork.ozlabs.org/patch/436498/]

Please mark your patches as Superseded yourself in patchwork :-) No
need to indicate that in the commit log.

Thanks!

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

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

* [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure
  2015-06-14 12:46 ` [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Thomas Petazzoni
@ 2015-06-14 13:18   ` Jörg Krause
  0 siblings, 0 replies; 4+ messages in thread
From: Jörg Krause @ 2015-06-14 13:18 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

On So, 2015-06-14 at 14:46 +0200, Thomas Petazzoni wrote:
> Dear J?rg Krause,
> 
> On Sun, 14 Jun 2015 14:05:57 +0200, J?rg Krause wrote:
> > With the patchset "kconfig: turnaround into single .config"
> > [http://lists.denx.de/pipermail/u-boot/2015-February/205490.html]
> > U-Boot switched to a single .config file for board configuration. 
> > This allows
> > us to use the kconfig-package infrastructure.
> > 
> > For providing backward compatibility with older U-Boot version a 
> > user choice
> > between the new Kconfig and the legacy build system is introduced. 
> > Kconfig
> > is chosen as default build system.
> 
> This will break plenty of existing configuration that use older
> Buildroot versions. Since the legacy configure/build commands also 
> work
> with newer U-Boot, I think we should rather have the legacy build 
> logic
> used by default.

Sorry, I forgot to discard this sentence from the commit log. Indeed,
Kconfig is _not_ chosen as default.

> > This patch supersedes "boot/uboot: Add support for Kbuild & Kconfig 
> > build
> > system" [http://patchwork.ozlabs.org/patch/436498/]
> 
> Please mark your patches as Superseded yourself in patchwork :-)

Done :-)

> No need to indicate that in the commit log.

Okay.

Best regards
J?rg Krause

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

end of thread, other threads:[~2015-06-14 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-14 12:05 [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Jörg Krause
2015-06-14 12:05 ` [Buildroot] [PATCH v3 2/2] docs/manual: add U-Boot configuration Jörg Krause
2015-06-14 12:46 ` [Buildroot] [PATCH v3 1/2] boot/uboot: add support for the kconfig infrastructure Thomas Petazzoni
2015-06-14 13:18   ` 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