From patchwork Sat Apr 18 12:52:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 462303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 5C3C914030A for ; Sat, 18 Apr 2015 22:53:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3E97891B96; Sat, 18 Apr 2015 12:53:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DapPEYuBzuHw; Sat, 18 Apr 2015 12:53:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6B4CE91B53; Sat, 18 Apr 2015 12:53:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 135F61C1EA6 for ; Sat, 18 Apr 2015 12:53:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0B91F915CC for ; Sat, 18 Apr 2015 12:53:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M1BV-wTgVNhV for ; Sat, 18 Apr 2015 12:52:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx02.posteo.de (mx02.posteo.de [89.146.194.165]) by whitealder.osuosl.org (Postfix) with ESMTPS id AC1EE90F3E for ; Sat, 18 Apr 2015 12:52:56 +0000 (UTC) Received: from dovecot03.posteo.de (unknown [185.67.36.28]) by mx02.posteo.de (Postfix) with ESMTPS id 4725C1F5E872 for ; Sat, 18 Apr 2015 14:52:55 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3lTZ2b0nSmz5vNL for ; Sat, 18 Apr 2015 14:52:55 +0200 (CEST) Received: from nzxt.fritz.box (nzxt.localdomain [192.168.178.46]) (Authenticated sender: joerg.krause@embedded.rocks) by embedded.rocks (Postfix) with ESMTPSA id 99AC7980315; Sat, 18 Apr 2015 14:52:54 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Sat, 18 Apr 2015 14:52:45 +0200 Message-Id: <1429361566-3538-3-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1429361566-3538-1-git-send-email-joerg.krause@embedded.rocks> References: <1429361566-3538-1-git-send-email-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/4] boot/uboot: add support for the kconfig infrastructure X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" With the patchset "kconfig: turnaround into single .config" [1] 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 the default build system. This patch supersedes "boot/uboot: Add support for Kbuild & Kconfig build system" [2] [1] http://lists.denx.de/pipermail/u-boot/2015-February/205490.html [2] http://patchwork.ozlabs.org/patch/436498/ Signed-off-by: Jörg Krause --- boot/uboot/Config.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ boot/uboot/uboot.mk | 28 ++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 7cf695c..f44c3de 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -4,6 +4,26 @@ 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 2014.10), + so that we use the old build system. + +config BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG + bool "Kconfig" + default y + 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 +31,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" @@ -79,6 +100,33 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR 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 a9ba054..941b721 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -93,6 +93,7 @@ endef UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES endif +ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY),y) define UBOOT_CONFIGURE_CMDS $(TARGET_CONFIGURE_OPTS) \ $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \ @@ -111,6 +112,18 @@ define UBOOT_CONFIGURE_CMDS $(call insert_define,CONFIG_ETH1ADDR,$(BR2_TARGET_UBOOT_ETH1ADDR)) @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(@D)/include/config.h 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) \ @@ -165,14 +178,25 @@ 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),y) # we NEED a board name unless we're at make source ifeq ($(filter source,$(MAKECMDGOALS)),) + +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 +$(error No U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) +endif # UBOOT_BOARD_NAME +else ifeq ($(BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG),y) +ifeq ($(UBOOT_SOURCE_CONFIG),) +$(error No U-Boot config file. Check your BR2_TARGET_UBOOT_BOARD_DEFCONFIG or BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE settings) +endif # UBOOT_SOURCE_CONFIG +endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY ifeq ($(BR2_TARGET_UBOOT_CUSTOM_VERSION),y) ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE)),)