From patchwork Thu May 1 19:32:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 344796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 5286F140113 for ; Fri, 2 May 2014 05:32:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 817429352E; Thu, 1 May 2014 19:32:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hFaOMp7dy0o5; Thu, 1 May 2014 19:32:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8790B93513; Thu, 1 May 2014 19:32:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id F33CE1C27FF for ; Thu, 1 May 2014 19:32:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EED238941A for ; Thu, 1 May 2014 19:32:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y6aqZFXSamGy for ; Thu, 1 May 2014 19:32:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs02.rockwellcollins.com (secvs02.rockwellcollins.com [205.175.225.241]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7014293513 for ; Thu, 1 May 2014 19:32:47 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO crulimr01.rockwellcollins.com) ([131.198.26.129]) by mail-virt.rockwellcollins.com with ESMTP; 01 May 2014 14:32:47 -0500 Received: from thehammer.rockwellcollins.com (srcnat-vips-vlan26.rockwellcollins.com [131.198.26.18]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id 7776860170; Thu, 1 May 2014 14:32:46 -0500 (CDT) From: Ryan Barnett To: buildroot@buildroot.org Date: Thu, 1 May 2014 14:32:10 -0500 Message-Id: <1398972731-20680-3-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1398972731-20680-1-git-send-email-rjbarnet@rockwellcollins.com> References: <1398972731-20680-1-git-send-email-rjbarnet@rockwellcollins.com> Cc: thomas.petazzoni@free-electrons.com, yann.morin.1998@free.fr Subject: [Buildroot] [PATCH 2/3] uboot: separate out OMAP options and definitions 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 From: Thomas Petazzoni In preparation for the introduction of Freescale PowerPC specific U-Boot handling which is quite large, it makes sense to extract from the main uboot.mk and the main U-Boot Config.in the highly platform-specific options and definitions, and put them in separate files. Therefore, this commit starts to do so for the OMAP-specific bits. The solution chosen for this split is: boot/uboot/Config.in. boot/uboot/uboot.mk. The justifications for this choice are: * Naming the files as Config..in and uboot-.mk and placing them directly in boot/uboot/ doesn't work, because boot/common.mk is including all boot/*/*.mk, but we want boot/uboot/uboot.mk to itself handle *when* its uboot-.mk files are included, as they need to be included before the $(generic-package) call. * Placing the platform specific bits in a subdirectory as boot/uboot//uboot-.mk does not work because the rule generation for uboot will not work when the call to $(eval $(generic-package)) is made. This is because the rules names are based on the _last_ Makefile that was parsed. The _last_ Makefile parse will then be one of the last platform subdirectories. The rules for uboot then become which is not what we want. For more detailed information please see this email from the mailing list: http://lists.busybox.net/pipermail/buildroot/2014-April/095476.html * We need to have a different file extension than just .mk otherwise the first point comes into effect and the easiest way around this is to add the platform at the end for the extension. [ryan: fixed the issues with including of the platform makefiles] Signed-off-by: Thomas Petazzoni Signed-off-by: Ryan Barnett CC: Yann E. MORIN --- Please offer different suggestions for the naming of the platform specific files. One other option that I thought of is to name the files as uboot-.mak but I guess I preferred my name convention. Regardless the best way to work around the problems I outlined below is to have a different extentions than just .mk for moving the rules outside of the main uboot.mk file. --- boot/uboot/Config.in | 32 +------------------------------- boot/uboot/Config.in.arm-omap | 31 +++++++++++++++++++++++++++++++ boot/uboot/uboot.mk | 26 ++------------------------ boot/uboot/uboot.mk.arm-omap | 29 +++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 55 deletions(-) create mode 100644 boot/uboot/Config.in.arm-omap create mode 100644 boot/uboot/uboot.mk.arm-omap diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 90437b5..757ba8d 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -135,37 +135,7 @@ config BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME U-Boot, if it is not one of the default names. For example: u-boot_magic.bin -config BR2_TARGET_UBOOT_OMAP_IFT - depends on BR2_TARGET_UBOOT_FORMAT_BIN - depends on BR2_arm || BR2_armeb - select BR2_PACKAGE_HOST_OMAP_U_BOOT_UTILS - bool "produce a .ift signed image (OMAP)" - help - Use gpsign to produce an image of u-boot.bin signed with - a Configuration Header for booting on OMAP processors. - This allows U-Boot to boot without the need for an - intermediate bootloader (e.g. x-loader) if it is written - on the first sector of the boot medium. - This only works for some media, such as NAND. Check your - chip documentation for details. You might also want to - read the documentation of gpsign, the tool that generates - the .ift image, at: - https://github.com/nmenon/omap-u-boot-utils/blob/master/README - -if BR2_TARGET_UBOOT_OMAP_IFT - -config BR2_TARGET_UBOOT_OMAP_IFT_CONFIG - string "gpsign Configuration Header config file" - help - The Configuration Header (CH) config file defines the - desired content of the CH for the signed image. - It usually contains external RAM settings and - possibly other external devices initialization. - The omap-u-boot-utils software contains example - configuration files for some boards: - https://github.com/nmenon/omap-u-boot-utils/tree/master/configs - -endif +source "boot/uboot/Config.in.arm-omap" menuconfig BR2_TARGET_UBOOT_NETWORK bool "Custom Network Settings" diff --git a/boot/uboot/Config.in.arm-omap b/boot/uboot/Config.in.arm-omap new file mode 100644 index 0000000..71bd514 --- /dev/null +++ b/boot/uboot/Config.in.arm-omap @@ -0,0 +1,31 @@ +config BR2_TARGET_UBOOT_OMAP_IFT + depends on BR2_TARGET_UBOOT_FORMAT_BIN + depends on BR2_arm || BR2_armeb + select BR2_PACKAGE_HOST_OMAP_U_BOOT_UTILS + bool "produce a .ift signed image (OMAP)" + help + Use gpsign to produce an image of u-boot.bin signed with + a Configuration Header for booting on OMAP processors. + This allows U-Boot to boot without the need for an + intermediate bootloader (e.g. x-loader) if it is written + on the first sector of the boot medium. + This only works for some media, such as NAND. Check your + chip documentation for details. You might also want to + read the documentation of gpsign, the tool that generates + the .ift image, at: + https://github.com/nmenon/omap-u-boot-utils/blob/master/README + +if BR2_TARGET_UBOOT_OMAP_IFT + +config BR2_TARGET_UBOOT_OMAP_IFT_CONFIG + string "gpsign Configuration Header config file" + help + The Configuration Header (CH) config file defines the + desired content of the CH for the signed image. + It usually contains external RAM settings and + possibly other external devices initialization. + The omap-u-boot-utils software contains example + configuration files for some boards: + https://github.com/nmenon/omap-u-boot-utils/tree/master/configs + +endif diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index da67706..49c9638 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -119,11 +119,6 @@ define UBOOT_BUILD_CMDS $(UBOOT_MAKE_TARGET) endef -define UBOOT_BUILD_OMAP_IFT - $(HOST_DIR)/usr/bin/gpsign -f $(@D)/u-boot.bin \ - -c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)) -endef - define UBOOT_INSTALL_IMAGES_CMDS cp -dpf $(@D)/$(UBOOT_BIN) $(BINARIES_DIR)/ $(if $(BR2_TARGET_UBOOT_SPL), @@ -134,25 +129,6 @@ define UBOOT_INSTALL_IMAGES_CMDS -o $(BINARIES_DIR)/uboot-env.bin $(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) endef -define UBOOT_INSTALL_OMAP_IFT_IMAGE - cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ -endef - -ifeq ($(BR2_TARGET_UBOOT_OMAP_IFT),y) -# we NEED a config file unless we're at make source -ifeq ($(filter source,$(MAKECMDGOALS)),) -ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)),) -$(error No gpsign config file. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting) -endif -ifeq ($(wildcard $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))),) -$(error gpsign config file $(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG) not found. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting) -endif -endif -UBOOT_DEPENDENCIES += host-omap-u-boot-utils -UBOOT_POST_BUILD_HOOKS += UBOOT_BUILD_OMAP_IFT -UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_OMAP_IFT_IMAGE -endif - ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y) # we NEED a environment settings unless we're at make source ifeq ($(filter source,$(MAKECMDGOALS)),) @@ -166,6 +142,8 @@ endif UBOOT_DEPENDENCIES += host-uboot-tools endif +include $(sort $(wildcard boot/uboot/uboot.mk.*)) + $(eval $(generic-package)) ifeq ($(BR2_TARGET_UBOOT),y) diff --git a/boot/uboot/uboot.mk.arm-omap b/boot/uboot/uboot.mk.arm-omap new file mode 100644 index 0000000..7f0fb57 --- /dev/null +++ b/boot/uboot/uboot.mk.arm-omap @@ -0,0 +1,29 @@ +################################################################################ +# +# uboot-arm-omap +# +################################################################################ + +define UBOOT_BUILD_OMAP_IFT + $(HOST_DIR)/usr/bin/gpsign -f $(@D)/u-boot.bin \ + -c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)) +endef + +define UBOOT_INSTALL_OMAP_IFT_IMAGE + cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ +endef + +ifeq ($(BR2_TARGET_UBOOT_OMAP_IFT),y) +# we NEED a config file unless we're at make source +ifeq ($(filter source,$(MAKECMDGOALS)),) +ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG)),) +$(error No gpsign config file. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting) +endif +ifeq ($(wildcard $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))),) +$(error gpsign config file $(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG) not found. Check your BR2_TARGET_UBOOT_OMAP_IFT_CONFIG setting) +endif +endif +UBOOT_DEPENDENCIES += host-omap-u-boot-utils +UBOOT_POST_BUILD_HOOKS += UBOOT_BUILD_OMAP_IFT +UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_INSTALL_OMAP_IFT_IMAGE +endif