All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] uboot: install multiple spl images
@ 2016-03-10 22:23 Jason Abele
  2016-03-10 22:34 ` Thomas Petazzoni
  2016-05-04 15:08 ` Thomas De Schampheleire
  0 siblings, 2 replies; 8+ messages in thread
From: Jason Abele @ 2016-03-10 22:23 UTC (permalink / raw)
  To: buildroot

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 example, the NextThingCo C.H.I.P. uses two binaries from uboot,
spl/sunxi-spl.bin and spl/sunxi-spl-with-ecc.bin.

This patch allows them to be listed explicitly.

 boot/uboot/Config.in |  2 +-
 boot/uboot/uboot.mk  | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

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)
 	$(if $(BR2_TARGET_UBOOT_ENVIMAGE),
 		$(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
 		$(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
@@ -196,9 +198,11 @@ 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))     \
-		-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
 endef
 UBOOT_DEPENDENCIES += host-zynq-boot-bin
 UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_GENERATE_ZYNQ_IMAGE
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uboot: install multiple spl images
@ 2016-07-05 11:17 Maxime Hadjinlian
  2016-07-05 11:26 ` Maxime Hadjinlian
  2016-07-05 15:35 ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Maxime Hadjinlian @ 2016-07-05 11:17 UTC (permalink / raw)
  To: buildroot

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.

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 <jason@nextthing.co>
[Maxime:
 - Add foreach loop for general case and mkpimage
 - Use firstword for zynq case]
Signe-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
---
 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
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-05 15:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 22:23 [Buildroot] [PATCH] uboot: install multiple spl images Jason Abele
2016-03-10 22:34 ` Thomas Petazzoni
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

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.