Skip to contentSkip to conversation

arm: mxs: Preprocess u-boot.bd so they contain full path

PATCH Superseded Marek Vasut 2 participants 3 messages Apr 29, 2013 – May 5, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: mxs: Preprocess u-boot.bd so they contain full path

The u-boot-imx23.bd and u-boot-imx28.bd need to be preprocessed, otherwise they have issues with out-of-tree build where elftosb tool couldn't sometimes find the u-boot.bin and spl/u-boot-spl.bin .

Preprocess these .bd files with sed and insert full path to u-boot.bin and spl/u-boot-spl.bin to prevent this issue. Moreover, to avoid adding more churn into main Makefile, move all this preprocessing and u-boot.sb generation into CPU directory instead.

Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 .gitignore                                 |    1 +
 Makefile                                   |    7 ++-----
 arch/arm/cpu/arm926ejs/mxs/Makefile        |   10 ++++++++++
 arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd |    4 ++--
 arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd |    4 ++--
 5 files changed, 17 insertions(+), 9 deletions(-)

V2: Add .gitignore entry

.gitignore +1 -0
index ed21203..c79d577 100644
@@ -46,6 +46,7 @@
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
+/u-boot.bd
 /u-boot.geany
 
 #
Makefile +2 -5
index 3fd6d15..1874456 100644
@@ -512,13 +512,9 @@ $(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
 		cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
 			$(obj)u-boot.ais
 
-# Specify the target for use in elftosb call
-ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
-ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
 
 $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
-		elftosb -zf $(ELFTOSB_TARGET-y) -c $(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \
-			-o $(obj)u-boot.sb
+		$(MAKE) -C $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
 
 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
 # Both images are created using mkimage (crc etc), so that the ROM
@@ -849,6 +845,7 @@ clobber:	tidy
 	@rm -f $(obj)u-boot.ais
 	@rm -f $(obj)u-boot.dtb
 	@rm -f $(obj)u-boot.sb
+	@rm -f $(obj)u-boot.bd
 	@rm -f $(obj)u-boot.spr
 	@rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
 	@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
arch/arm/cpu/arm926ejs/mxs/Makefile +10 -0
index eeecf89..038c1c1 100644
@@ -40,6 +40,16 @@ all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
+# Specify the target for use in elftosb call
+ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
+ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
+
+$(OBJTREE)/u-boot.bd: $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
+	sed "s at OBJTREE@$(OBJTREE)@g" $^ > $@
+
+$(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/u-boot.bd
+		elftosb -zf $(ELFTOSB_TARGET-y) -c $(OBJTREE)/u-boot.bd -o $(OBJTREE)/u-boot.sb
+
 #########################################################################
 
 # defines $(obj).depend target
arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd +2 -2
index 3a51879..8b6c30e 100644
@@ -4,8 +4,8 @@ options {
 }
 
 sources {
-	u_boot_spl="spl/u-boot-spl.bin";
-	u_boot="u-boot.bin";
+	u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
+	u_boot="OBJTREE/u-boot.bin";
 }
 
 section (0) {
arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd +2 -2
index c60615a..a5fa648 100644
@@ -1,6 +1,6 @@
 sources {
-	u_boot_spl="spl/u-boot-spl.bin";
-	u_boot="u-boot.bin";
+	u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
+	u_boot="OBJTREE/u-boot.bin";
 }
 
 section (0) {
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 arm: mxs: Preprocess u-boot.bd so they contain full path

Quoted 10 lines · Marek Vasut

The u-boot-imx23.bd and u-boot-imx28.bd need to be preprocessed, otherwise they have issues with out-of-tree build where elftosb tool couldn't sometimes find the u-boot.bin and spl/u-boot-spl.bin .

Preprocess these .bd files with sed and insert full path to u-boot.bin and spl/u-boot-spl.bin to prevent this issue. Moreover, to avoid adding more churn into main Makefile, move all this preprocessing and u-boot.sb generation into CPU directory instead.

--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#2 lore raw

PATCH v2 1/1 arm: mxs: Preprocess u-boot.bd so they contain full path

In reply to Marek Vasut

Hi Stefano,

this one too ;-)

Quoted 48 lines

The u-boot-imx23.bd and u-boot-imx28.bd need to be preprocessed, otherwise they have issues with out-of-tree build where elftosb tool couldn't sometimes find the u-boot.bin and spl/u-boot-spl.bin .

Preprocess these .bd files with sed and insert full path to u-boot.bin and spl/u-boot-spl.bin to prevent this issue. Moreover, to avoid adding more churn into main Makefile, move all this preprocessing and u-boot.sb generation into CPU directory instead.

Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 .gitignore                                 |    1 +
 Makefile                                   |    7 ++-----
 arch/arm/cpu/arm926ejs/mxs/Makefile        |   10 ++++++++++
 arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd |    4 ++--
 arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd |    4 ++--
 5 files changed, 17 insertions(+), 9 deletions(-)

V2: Add .gitignore entry

.gitignore +1 -0
index ed21203..c79d577 100644
@@ -46,6 +46,7 @@
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
+/u-boot.bd
 /u-boot.geany
 
 #
Makefile +0 -4
index 3fd6d15..1874456 100644
@@ -512,13 +512,9 @@ $(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin
 $(obj)u-boot.img cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
 			$(obj)u-boot.ais
 
-# Specify the target for use in elftosb call
-ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
-ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
 
 $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
-		elftosb -zf $(ELFTOSB_TARGET-y) -c
Quoted 1 line

$(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \ -

-o

Quoted 55 lines

$(obj)u-boot.sb

Makefile +2 -0
+		$(MAKE) -C $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
 
 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
 # Both images are created using mkimage (crc etc), so that the ROM
@@ -849,6 +845,7 @@ clobber:	tidy
 	@rm -f $(obj)u-boot.ais
 	@rm -f $(obj)u-boot.dtb
 	@rm -f $(obj)u-boot.sb
+	@rm -f $(obj)u-boot.bd
 	@rm -f $(obj)u-boot.spr
 	@rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
 	@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mxs/Makefile index eeecf89..038c1c1 100644

arch/arm/cpu/arm926ejs/mxs/Makefile +5 -0
@@ -40,6 +40,16 @@ all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
+# Specify the target for use in elftosb call
+ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
+ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
+
+$(OBJTREE)/u-boot.bd:

$(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd + sed
"s at OBJTREE@$(OBJTREE)@g" $^ > $@
+
+$(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin
$(OBJTREE)/u-boot.bd + elftosb -zf $(ELFTOSB_TARGET-y) -c
$(OBJTREE)/u-boot.bd -o $(OBJTREE)/u-boot.sb +
#########################################################################

 # defines $(obj).depend target
(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd index 3a51879..8b6c30e 100644

arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd +2 -2
@@ -4,8 +4,8 @@ options {
 }
 
 sources {
-	u_boot_spl="spl/u-boot-spl.bin";
-	u_boot="u-boot.bin";
+	u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
+	u_boot="OBJTREE/u-boot.bin";
 }
 
 section (0) {
(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd index c60615a..a5fa648 100644

arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd line 6

Quoted 8 lines
arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd +2 -2
@@ -1,6 +1,6 @@
 sources {
-	u_boot_spl="spl/u-boot-spl.bin";
-	u_boot="u-boot.bin";
+	u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
+	u_boot="OBJTREE/u-boot.bin";
 }
 
 section (0) {

Best regards,
Marek Vasut