All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] uboot: install multiple spl images
Date: Thu, 10 Mar 2016 23:34:42 +0100	[thread overview]
Message-ID: <20160310233442.42eb90cf@free-electrons.com> (raw)
In-Reply-To: <1457648583-25071-1-git-send-email-jason.abele@gmail.com>

Jason,

On Thu, 10 Mar 2016 14:23:03 -0800, Jason Abele wrote:
> From: Jason Abele <jason@nextthing.co>
> 
> 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.
> 
> Signed-off-by: Jason Abele <jason@nextthing.co>

For some reason, I was expecting this patch to arrive :-)

> ---
> For example, the NextThingCo C.H.I.P. uses two binaries from uboot,
> spl/sunxi-spl.bin and spl/sunxi-spl-with-ecc.bin.

This should be part of the commit log itself as it is a very useful
example of why this patch was needed.

> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 4a6dc56..d4f9445 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -322,7 +322,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 d539b31..aae99f8 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -169,7 +169,9 @@ 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)/)
> +		for p in $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)); do \
> +			cp -dpf $(@D)/$$p $(BINARIES_DIR)/; \
> +		done)

Ideally, using the make $(foreach ...) function here would be better.

>  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))     \
> -		-o $(BINARIES_DIR)/BOOT.BIN
> +	for p in $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)); do \
> +		$(HOST_DIR)/usr/bin/python2 $(HOST_DIR)/usr/bin/zynq-boot-bin.py \
> +			-u $(@D)/$$p -o $(BINARIES_DIR)/BOOT.BIN; \
> +		fi; \
> +	done

Having a for loop here is really useless, since the output file is
BOOT.BIN at each iteration of the loop. Since for the specific Zynq
case it doesn't make sense to have multiple values in
BR2_TARGET_UBOOT_SPL_NAME, I would suggest to just do:

-	-u $(@D)/$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME))
+	-u $(@D)/$(firstword $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)))

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2016-03-10 22:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 22:23 [Buildroot] [PATCH] uboot: install multiple spl images Jason Abele
2016-03-10 22:34 ` Thomas Petazzoni [this message]
2016-03-10 23:04   ` Jason Abele
2016-05-04 15:08 ` Thomas De Schampheleire
2016-07-05 11:19   ` Maxime Hadjinlian
  -- strict thread matches above, loose matches on Subject: below --
2016-07-05 11:17 Maxime Hadjinlian
2016-07-05 11:26 ` Maxime Hadjinlian
2016-07-05 15:35 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160310233442.42eb90cf@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.