From patchwork Fri Dec 12 23:15:59 2014 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: 420718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 169431400DD for ; Sat, 13 Dec 2014 10:16:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 499833434F; Fri, 12 Dec 2014 23:16:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xfyRMPM16gor; Fri, 12 Dec 2014 23:16:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2700F34369; Fri, 12 Dec 2014 23:16:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 91F5D1C27CD for ; Fri, 12 Dec 2014 23:15:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8D683A315D for ; Fri, 12 Dec 2014 23:15:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tnhoa0S9gYMX for ; Fri, 12 Dec 2014 23:15:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx02.posteo.de (mx02.posteo.de [89.146.194.165]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 078A7A316A for ; Fri, 12 Dec 2014 23:15:56 +0000 (UTC) Received: from dovecot03.posteo.de (unknown [185.67.36.28]) by mx02.posteo.de (Postfix) with ESMTPS id 03EEC25AF505; Sat, 13 Dec 2014 00:15:54 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3jznt15Xy2z5vN5; Sat, 13 Dec 2014 00:15:53 +0100 (CET) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Sat, 13 Dec 2014 00:15:59 +0100 Message-Id: <1418426171-3483-3-git-send-email-jkrause@posteo.de> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418426171-3483-1-git-send-email-jkrause@posteo.de> References: <1418426171-3483-1-git-send-email-jkrause@posteo.de> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 02/14] boot/uboot: Add support for Kconfig build system 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" Since version 2014.10 U-Boots uses a Kconfig build system. The boards.cfg has been converted to Kconfig and is not used anymore. Configuration by Kconfig is done with a _defconfig file now, which is now 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. The Kconfig configuration of the package is based on the Linux and Barebox package infrastructure. Signed-off-by: Jörg Krause --- boot/uboot/Config.in | 32 +++++++++++++++++++++++++------- boot/uboot/uboot.mk | 25 +++++++++++++++++++++---- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index f7c4374..8a5bebc 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -4,13 +4,6 @@ config BR2_TARGET_UBOOT Build "Das U-Boot" Boot Monitor if BR2_TARGET_UBOOT -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. choice prompt "U-Boot Version" @@ -80,6 +73,31 @@ config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR Most users may leave this empty choice + prompt "U-Boot configuration" + default BR2_TARGET_UBOOT_USE_DEFCONFIG + +config BR2_TARGET_UBOOT_USE_DEFCONFIG + bool "Using a defconfig" + +config BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG + bool "Using a custom config file" +endchoice + +config BR2_TARGET_UBOOT_BOARD_DEFCONFIG + string "Board defconfig" + depends on BR2_TARGET_UBOOT_USE_DEFCONFIG + help + Name of the board defconfig file to use, without the trailing + _defconfig. The defconfig file is located in the directory + configs in the U-Boot source tree. + +config BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE + string "Custom defconfig file path" + depends on BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG + help + Path to the custom board defconfig file. + +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 1f8818c..17565e4 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -94,10 +94,18 @@ endef UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_CUSTOM_PATCHES endif +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 = $(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE) +endif + define UBOOT_CONFIGURE_CMDS + $(INSTALL) -m 0644 $(UBOOT_SOURCE_CONFIG) $(UBOOT_DIR)/configs/buildroot_defconfig $(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS) \ $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS) \ - $(UBOOT_BOARD_NAME)_config + buildroot_config + rm $(UBOOT_DIR)/configs/buildroot_defconfig @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 @@ -169,10 +177,19 @@ endif $(eval $(generic-package)) ifeq ($(BR2_TARGET_UBOOT),y) -# we NEED a board name unless we're at make source +# Checks to give errors that the user can understand ifeq ($(filter source,$(MAKECMDGOALS)),) -ifeq ($(UBOOT_BOARD_NAME),) -$(error NO U-Boot board name set. Check your BR2_TARGET_UBOOT_BOARDNAME setting) + +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_BOARD_DEFCONFIG setting) +endif +endif + +ifeq ($(BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG),y) +ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)),) +$(error No kernel configuration file specified, check your BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE setting) +endif endif ifeq ($(BR2_TARGET_UBOOT_CUSTOM_VERSION),y)