From patchwork Tue Nov 27 23:05:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Belisko X-Patchwork-Id: 202315 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 903812C0086 for ; Wed, 28 Nov 2012 10:06:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8163830EF7; Tue, 27 Nov 2012 23:06:47 +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 qezFy52TgCjE; Tue, 27 Nov 2012 23:06:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8BC7430EE0; Tue, 27 Nov 2012 23:06:45 +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 672028F74A for ; Tue, 27 Nov 2012 23:06:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7BBBB8695C for ; Tue, 27 Nov 2012 23:06:39 +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 aQOPt+FKFvJF for ; Tue, 27 Nov 2012 23:06:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 212488692B for ; Tue, 27 Nov 2012 23:06:37 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id e49so9032129eek.16 for ; Tue, 27 Nov 2012 15:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=1oBol1vFvMTWZDdGbMxLRtrc2HKUJK/iGvAF85TRlxo=; b=bN7aMon8E2CQl8Gs9JlUw7KlbfRpFhnExIb+2QbTZd2IktLYN6MAu2QkZUHeMzfmNe aXiUcy40RaWQ4bh6EdJArgDq0mNbWbQ6tXPuG0ZTX6MID1TXhdqjQR4IPpr4B3c1B78L HYeE5kd4kFoJCAldMme5NqA9w9WdFaVf7DxRKL7B264nA+SFplOEBnSkcKsQ2xWZLO9X p5p+0G4Hn53SK9fPF1J8nROEYV/kPdMmoyQ9Qc+AJcSlfWpaRyw1NXrzvQgEhV/d4QY7 ipr6r+sqWdEb2xnMrnuxu+G3oEyNyAYolGck0EMZryvX0c6dZb89FRt7GQB3iMMqXGEZ Vtjg== Received: by 10.14.213.134 with SMTP id a6mr63247609eep.45.1354057597652; Tue, 27 Nov 2012 15:06:37 -0800 (PST) Received: from localhost.localdomain (dial-109-230-36-120.orange.sk. [109.230.36.120]) by mx.google.com with ESMTPS id a44sm43598332eeo.7.2012.11.27.15.06.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 15:06:36 -0800 (PST) From: Marek Belisko To: buildroot@busybox.net Date: Wed, 28 Nov 2012 00:05:53 +0100 Message-Id: <1354057553-6337-3-git-send-email-marek.belisko@open-nandra.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1354057553-6337-1-git-send-email-marek.belisko@open-nandra.com> References: <1354057553-6337-1-git-send-email-marek.belisko@open-nandra.com> Cc: Marek Belisko Subject: [Buildroot] [RFC 2/2] barebox: Add possibility to build also barebox xloader (MLO). X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This add config option for user to select defconfig or custom xloader config. Barebox have xloader defconfig for: phycard_a_xl2_xload_defconfig pcm049_xload_defconfig archosg9_xload_defconfig phycard_a_l1_xload_defconfig omap3530_beagle_xload_defconfig panda_xload_defconfig Signed-off-by: Marek Belisko --- boot/barebox/Config.in | 28 ++++++++++++++++++++++++++++ boot/barebox/barebox.mk | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/boot/barebox/Config.in b/boot/barebox/Config.in index 95f330f..bb20542 100644 --- a/boot/barebox/Config.in +++ b/boot/barebox/Config.in @@ -99,4 +99,32 @@ config BR2_TARGET_BAREBOX_BAREBOXENV help Install bareboxenv tool in target. +choice + prompt "Barebox xloader configuration" + default BR2_TARGET_BAREBOX_XLOADER_NONE + +config BR2_TARGET_BAREBOX_XLOADER_NONE + bool "None" + +config BR2_TARGET_BAREBOX_XLOADER_USE_DEFCONFIG + bool "Using defconfig" + +config BR2_TARGET_BAREBOX_XLOADER_USE_CUSTOM_CONFIG + bool "Using a custom config file" + +endchoice + +config BR2_TARGET_BAREBOX_BOARD_XLOADER_DEFCONFIG + string "board xloader defconfig" + depends on BR2_TARGET_BAREBOX_XLOADER_USE_DEFCONFIG + help + Name of the board for which Barebox xloader should be built, without + the _defconfig suffix (can be used for pandaboard, beagleboard ...). + +config BR2_TARGET_BAREBOX_XLOADER_CUSTOM_CONFIG_FILE + string "Xloader configuration file path" + depends on BR2_TARGET_BAREBOX_XLOADER_USE_CUSTOM_CONFIG + help + Path to the barebox custom xloader configuration file. + endif diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk index 16110b9..199b708 100644 --- a/boot/barebox/barebox.mk +++ b/boot/barebox/barebox.mk @@ -56,7 +56,33 @@ endif BAREBOX_BUILD_DIR = barebox +ifneq ($(BR2_TARGET_BAREBOX_XLOADER_NONE),y) +ifeq ($(BR2_TARGET_BAREBOX_XLOADER_USE_DEFCONFIG),y) +BAREBOX_XLOADER_SOURCE_CONFIG = $(@D)/arch/$(BAREBOX_ARCH)/configs/$(call qstrip,$(BR2_TARGET_BAREBOX_BOARD_XLOADER_DEFCONFIG))_defconfig +else ifeq ($(BR2_TARGET_BAREBOX_XLOADER_USE_CUSTOM_CONFIG),y) +BAREBOX_XLOADER_SOURCE_CONFIG = $(BR2_TARGET_BAREBOX_XLOADER_CUSTOM_CONFIG_FILE) +endif + +BAREBOX_XLOADER_BUILD_DIR = MLO + +define BAREBOX_XLOADER_CONFIGURE_CMDS + mkdir -p $(@D)/$(BAREBOX_XLOADER_BUILD_DIR) + cp $(BAREBOX_XLOADER_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_xload_defconfig + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_xload_defconfig O=$(BAREBOX_XLOADER_BUILD_DIR) +endef + +define BAREBOX_XLOADER_BUILD_CMDS + $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) O=$(BAREBOX_XLOADER_BUILD_DIR) +endef + +define BAREBOX_XLOADER_INSTALL_IMAGES_CMDS + cp $(@D)/$(BAREBOX_XLOADER_BUILD_DIR)/MLO $(BINARIES_DIR) +endef + +endif + define BAREBOX_CONFIGURE_CMDS + $(BAREBOX_XLOADER_CONFIGURE_CMDS) mkdir -p $(@D)/$(BAREBOX_BUILD_DIR) cp $(BAREBOX_SOURCE_CONFIG) $(@D)/arch/$(BAREBOX_ARCH)/configs/buildroot_defconfig $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) buildroot_defconfig O=$(BAREBOX_BUILD_DIR) @@ -70,11 +96,13 @@ endef endif define BAREBOX_BUILD_CMDS + $(BAREBOX_XLOADER_BUILD_CMDS) $(BAREBOX_BUILD_BAREBOXENV_CMDS) $(MAKE) $(BAREBOX_MAKE_FLAGS) -C $(@D) O=$(BAREBOX_BUILD_DIR) endef define BAREBOX_INSTALL_IMAGES_CMDS + $(BAREBOX_XLOADER_INSTALL_IMAGES_CMDS) cp $(@D)/$(BAREBOX_BUILD_DIR)/barebox.bin $(BINARIES_DIR) endef