]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: mxs: Preprocess u-boot.bd so they contain full path
authorMarek Vasut <marex@denx.de>
Sun, 28 Apr 2013 14:18:49 +0000 (14:18 +0000)
committerStefano Babic <sbabic@denx.de>
Mon, 6 May 2013 08:37:36 +0000 (10:37 +0200)
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.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
.gitignore
Makefile
arch/arm/cpu/arm926ejs/mxs/Makefile
arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd
arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd

index ed212032b4dd7ef53eac57f5b208fc6153c73fbe..c79d5770c04623fa3430273dff92ee9c49bb866a 100644 (file)
@@ -46,6 +46,7 @@
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
+/u-boot.bd
 /u-boot.geany
 
 #
index d1d286b4ee8b09a75a86a1fe7846d13273e1da86..dd7e02adbaeb768566d1779d2b009630b21c6821 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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}
index eeecf89f8b84bf5332dea4dd5f986de7d7470950..038c1c1d82bfe9b7911e5277957a2ed44347399a 100644 (file)
@@ -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@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
index 3a51879d5e4abb64b2a0ee096bfc78ae4710cf3a..8b6c30e8e9b02cdd0fa0da8e18be70c81aa3385d 100644 (file)
@@ -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) {
index c60615a45671a59145aecd43e61a209bd9216b3f..a5fa6483a93cbf241f3ff96b5609ee6b5f27d998 100644 (file)
@@ -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) {