Skip to contentSkip to conversation

uboot: install multiple spl images

PATCH New Maxime Hadjinlian 2 participants 3 messages Jul 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot: install multiple spl images

From: Jason Abele <[email protected]>

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.

[Maxime:
- Add foreach loop for general case and mkpimage
- Use firstword for zynq case]

---
 boot/uboot/Config.in |  2 +-
 boot/uboot/uboot.mk  | 17 ++++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)
boot/uboot/Config.in +1 -1
index 9ffbb51..a468548 100644
@@ -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.
 
boot/uboot/uboot.mk +12 -5
index a2274ee..8ac035b 100644
@@ -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
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 uboot: install multiple spl images

Hi all,

The SoB lines are mangled, don't know what happened there. Anyway this can be fixed when it's merged.

Quoted 79 lines · Maxime Hadjinlian

From: Jason Abele <[email protected]>

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.

[Maxime:
- Add foreach loop for general case and mkpimage
- Use firstword for zynq case]

---
 boot/uboot/Config.in |  2 +-
 boot/uboot/uboot.mk  | 17 ++++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)
boot/uboot/Config.in +1 -1
index 9ffbb51..a468548 100644
@@ -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.
 
boot/uboot/uboot.mk +12 -6
index a2274ee..8ac035b 100644
@@ -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

#2 lore raw

PATCH 1/1 uboot: install multiple spl images

In reply to Maxime Hadjinlian

Hello,

Quoted 13 lines · Maxime Hadjinlian

From: Jason Abele <[email protected]>

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.

[Maxime:
- Add foreach loop for general case and mkpimage
- Use firstword for zynq case]

Quoted 7 lines
---
 boot/uboot/Config.in |  2 +-
 boot/uboot/uboot.mk  | 17 ++++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

Applied to master, thanks.

Thomas

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