From patchwork Tue Jul 5 11:17:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Hadjinlian X-Patchwork-Id: 644708 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rkLvj5g11z9s9x for ; Tue, 5 Jul 2016 21:17:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=lsh+S075; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 02FD430C30; Tue, 5 Jul 2016 11:17:34 +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 VLxcruSymaWA; Tue, 5 Jul 2016 11:17:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 34F9E30C28; Tue, 5 Jul 2016 11:17:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9C4DF1C1E91 for ; Tue, 5 Jul 2016 11:17:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 986EE8A154 for ; Tue, 5 Jul 2016 11:17:29 +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 k9bHR5d3D60O for ; Tue, 5 Jul 2016 11:17:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 919968A152 for ; Tue, 5 Jul 2016 11:17:28 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id 187so27963169wmz.1 for ; Tue, 05 Jul 2016 04:17:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=t2sn4EKlBKBnbCvpgSu4WwoW+YzKSOucyhG+orYC0yc=; b=lsh+S075bajH4HuEsgg1X5U40/WxclctzcABPlb17O7/XV1crQnq/cy7HsWWC/mqZI ueM/OYAcrdMhyZJeu5W2XcYGtMyGb7Eaq9G5UsJZEfAmjizTjXxix1/2Tlp96JSj8NOj yU0qqEUlSra8X9b28Gm1pdz0sM4IHG4fCpuTMPMSdp4hlUEijX0qw3r6Krf04m+kGf9u G4Jaz2wK9rLKepDChg1JS3ORHHKodBPBJLirQpblAM80pyVvb8wl1HrGIR/Ktz8PZqM2 ZyriobJ8+aT0j3fcCbNhd4olhOtme5GXNb7n/ueo9TjeS44JSq3iHQOGA916e2WWnbbd aM9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=t2sn4EKlBKBnbCvpgSu4WwoW+YzKSOucyhG+orYC0yc=; b=H4t1KwWfaENVNRQcTbzvAumi2X+FTd7FmHj9RlfroZRKen4hNrncKNiRXjOoUXtidx y3engUrPB78FNsNOUAnBBOeyCQ/7uG7o32dNeWms+GeRDjLMfZEk4RvOKo8RuoL6hsuY IbeOKuHi3PwSirzmfDcdFgyZGJ6960FnweZ/j/kwDw2kiuh3yRzePbc9qpuzLaiQFO2r cHaXHrTsuPH6gxtTSMCMg65073TghlOpGrcPciG4q0fFBaU96iZ3Ic+4pAvqRmfSlA5b nkASOQqkFqcii0/CQMTdWm8o464JQmhwtj0EMr5tGhqmLOc0qZEGozddr9kalUSZGwIK pSjw== X-Gm-Message-State: ALyK8tLOelxOBfKDfF0rfg3VMfI2tgIf6UEU+93yB1OZNgyU3/M4kQMc6w4qWrotK5eLiw== X-Received: by 10.28.207.6 with SMTP id f6mr6490633wmg.29.1467717447176; Tue, 05 Jul 2016 04:17:27 -0700 (PDT) Received: from cerise.home ([2a01:cb19:84c0:6b00:408e:9653:c255:83a4]) by smtp.gmail.com with ESMTPSA id a4sm2839037wjq.40.2016.07.05.04.17.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jul 2016 04:17:26 -0700 (PDT) From: Maxime Hadjinlian To: buildroot@buildroot.org Date: Tue, 5 Jul 2016 13:17:25 +0200 Message-Id: <1467717445-29708-1-git-send-email-maxime.hadjinlian@gmail.com> X-Mailer: git-send-email 2.8.1 Cc: Jason Abele Subject: [Buildroot] [PATCH] uboot: install multiple spl images 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Jason Abele For some platforms, there are multiple generated spl images. Extend BR2_TARGET_UBOOT_SPL_NAME to allow these multiple images to be installed after uboot build completes. For example, the NextThingCo C.H.I.P. uses two binaries from uboot, spl/sunxi-spl.bin and spl/sunxi-spl-with-ecc.bin. Signed-off-by: Jason Abele [Maxime: - Add foreach loop for general case and mkpimage - Use firstword for zynq case] Signe-off-by: Maxime Hadjinlian Signed-off-by: Maxime Hadjinlian --- boot/uboot/Config.in | 2 +- boot/uboot/uboot.mk | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 9ffbb51..a468548 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -313,7 +313,7 @@ config BR2_TARGET_UBOOT_SPL_NAME default "spl/u-boot-spl.bin" depends on BR2_TARGET_UBOOT_SPL help - This is the name of the SPL binary, generated during + A space-separated list of SPL binaries, generated during u-boot build. For most platform it is spl/u-boot-spl.bin but not always. It is MLO on OMAP for example. diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a2274ee..8ac035b 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -170,7 +170,10 @@ define UBOOT_INSTALL_IMAGES_CMDS $(if $(BR2_TARGET_UBOOT_FORMAT_NAND), cp -dpf $(@D)/$(UBOOT_MAKE_TARGET) $(BINARIES_DIR)) $(if $(BR2_TARGET_UBOOT_SPL), - cp -dpf $(@D)/$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)) $(BINARIES_DIR)/) + $(foreach f,$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)), \ + cp -dpf $(@D)/$(f) $(BINARIES_DIR)/ + ) + ) $(if $(BR2_TARGET_UBOOT_ENVIMAGE), cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \ $(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \ @@ -198,8 +201,9 @@ endif ifeq ($(BR2_TARGET_UBOOT_ZYNQ_IMAGE),y) define UBOOT_GENERATE_ZYNQ_IMAGE - $(HOST_DIR)/usr/bin/python2 $(HOST_DIR)/usr/bin/zynq-boot-bin.py \ - -u $(@D)/$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)) \ + $(HOST_DIR)/usr/bin/python2 \ + $(HOST_DIR)/usr/bin/zynq-boot-bin.py \ + -u $(@D)/$(firstword $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)) \ -o $(BINARIES_DIR)/BOOT.BIN endef UBOOT_DEPENDENCIES += host-zynq-boot-bin @@ -208,8 +212,11 @@ endif ifeq ($(BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC),y) define UBOOT_CRC_ALTERA_SOCFPGA_IMAGE - $(HOST_DIR)/usr/bin/mkpimage -o $(BINARIES_DIR)/$(notdir $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME))).crc \ - $(@D)/$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)) + $(foreach f,$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)), \ + $(HOST_DIR)/usr/bin/mkpimage \ + -o $(BINARIES_DIR)/$(notdir $(call qstrip,$(f))).crc \ + $(@D)/$(call qstrip,$(f)) + ) endef UBOOT_DEPENDENCIES += host-mkpimage UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_CRC_ALTERA_SOCFPGA_IMAGE