* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
@ 2013-04-28 18:39 Marek Vasut
2013-04-28 21:10 ` Otavio Salvador
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-04-28 18:39 UTC (permalink / raw)
To: u-boot
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>
---
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 ++--
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index f8ecfd7..5338924 100644
--- 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
@@ -861,6 +857,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}
diff --git a/arch/arm/cpu/arm926ejs/mxs/Makefile b/arch/arm/cpu/arm926ejs/mxs/Makefile
index eeecf89..038c1c1 100644
--- a/arch/arm/cpu/arm926ejs/mxs/Makefile
+++ b/arch/arm/cpu/arm926ejs/mxs/Makefile
@@ -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
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd
index 3a51879..8b6c30e 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx23.bd
@@ -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) {
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd
index c60615a..a5fa648 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd
@@ -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) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
2013-04-28 18:39 [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path Marek Vasut
@ 2013-04-28 21:10 ` Otavio Salvador
2013-04-28 23:02 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2013-04-28 21:10 UTC (permalink / raw)
To: u-boot
On Sun, Apr 28, 2013 at 3:39 PM, Marek Vasut <marex@denx.de> wrote:
> 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>
Please Cc me in 'mxs' patches.
> 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 ++--
As you'll be processing this '.bd' files with sed, I think naming the
u-boot.imx2[38].bd.in could make it easier to understand when someone
not familiar with the code looks at it.
Just due curiosity how did you find it failed? I did try to build it
with out-of-tree using MAKEALL and had no issues. Is it reproducable
with higher number of parallel tasks?
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
2013-04-28 21:10 ` Otavio Salvador
@ 2013-04-28 23:02 ` Marek Vasut
2013-04-28 23:08 ` Otavio Salvador
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-04-28 23:02 UTC (permalink / raw)
To: u-boot
Dear Otavio Salvador,
> On Sun, Apr 28, 2013 at 3:39 PM, Marek Vasut <marex@denx.de> wrote:
> > 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>
>
> Please Cc me in 'mxs' patches.
>
> > 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 ++--
>
> As you'll be processing this '.bd' files with sed, I think naming the
> u-boot.imx2[38].bd.in could make it easier to understand when someone
> not familiar with the code looks at it.
Not really, just keep them as they were.
> Just due curiosity how did you find it failed? I did try to build it
> with out-of-tree using MAKEALL and had no issues. Is it reproducable
> with higher number of parallel tasks?
Not sure anymore, I had this fix on my todo so I did it.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
2013-04-28 23:02 ` Marek Vasut
@ 2013-04-28 23:08 ` Otavio Salvador
2013-04-28 23:13 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Otavio Salvador @ 2013-04-28 23:08 UTC (permalink / raw)
To: u-boot
On Sun, Apr 28, 2013 at 8:02 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> On Sun, Apr 28, 2013 at 3:39 PM, Marek Vasut <marex@denx.de> wrote:
>> > 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>
>>
>> Please Cc me in 'mxs' patches.
>>
>> > 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 ++--
>>
>> As you'll be processing this '.bd' files with sed, I think naming the
>> u-boot.imx2[38].bd.in could make it easier to understand when someone
>> not familiar with the code looks at it.
>
> Not really, just keep them as they were.
When doing 'in-tree' build it will end changing the file itself, won't it?
>> Just due curiosity how did you find it failed? I did try to build it
>> with out-of-tree using MAKEALL and had no issues. Is it reproducable
>> with higher number of parallel tasks?
>
> Not sure anymore, I had this fix on my todo so I did it.
Right; no problem. This approach does makes sense, but I'd prefer a '.in' file.
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
2013-04-28 23:08 ` Otavio Salvador
@ 2013-04-28 23:13 ` Marek Vasut
2013-04-28 23:21 ` Otavio Salvador
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-04-28 23:13 UTC (permalink / raw)
To: u-boot
Dear Otavio Salvador,
> On Sun, Apr 28, 2013 at 8:02 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> >
> >> On Sun, Apr 28, 2013 at 3:39 PM, Marek Vasut <marex@denx.de> wrote:
> >> > 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>
> >>
> >> Please Cc me in 'mxs' patches.
> >>
> >> > 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 ++--
> >>
> >> As you'll be processing this '.bd' files with sed, I think naming the
> >> u-boot.imx2[38].bd.in could make it easier to understand when someone
> >> not familiar with the code looks at it.
> >
> > Not really, just keep them as they were.
>
> When doing 'in-tree' build it will end changing the file itself, won't it?
$OBJTREE/u-boot.bd will be produced, so no, read the patch again.
> >> Just due curiosity how did you find it failed? I did try to build it
> >> with out-of-tree using MAKEALL and had no issues. Is it reproducable
> >> with higher number of parallel tasks?
> >
> > Not sure anymore, I had this fix on my todo so I did it.
>
> Right; no problem. This approach does makes sense, but I'd prefer a '.in'
> file.
>
> --
> 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
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path
2013-04-28 23:13 ` Marek Vasut
@ 2013-04-28 23:21 ` Otavio Salvador
0 siblings, 0 replies; 6+ messages in thread
From: Otavio Salvador @ 2013-04-28 23:21 UTC (permalink / raw)
To: u-boot
On Sun, Apr 28, 2013 at 8:13 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> On Sun, Apr 28, 2013 at 8:02 PM, Marek Vasut <marex@denx.de> wrote:
>> > Dear Otavio Salvador,
>> >
>> >> On Sun, Apr 28, 2013 at 3:39 PM, Marek Vasut <marex@denx.de> wrote:
>> >> > 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>
>> >>
>> >> Please Cc me in 'mxs' patches.
>> >>
>> >> > 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 ++--
>> >>
>> >> As you'll be processing this '.bd' files with sed, I think naming the
>> >> u-boot.imx2[38].bd.in could make it easier to understand when someone
>> >> not familiar with the code looks at it.
>> >
>> > Not really, just keep them as they were.
>>
>> When doing 'in-tree' build it will end changing the file itself, won't it?
>
> $OBJTREE/u-boot.bd will be produced, so no, read the patch again.
You're right however, please add the u-boot.bd to .gitignore or it is
listed in git status after build.
>> >> Just due curiosity how did you find it failed? I did try to build it
>> >> with out-of-tree using MAKEALL and had no issues. Is it reproducable
>> >> with higher number of parallel tasks?
>> >
>> > Not sure anymore, I had this fix on my todo so I did it.
>>
>> Right; no problem. This approach does makes sense, but I'd prefer a '.in'
>> file.
>>
>> --
>> 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
>
> Best regards,
> Marek Vasut
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-28 23:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-28 18:39 [U-Boot] [PATCH] arm: mxs: Preprocess u-boot.bd so they contain full path Marek Vasut
2013-04-28 21:10 ` Otavio Salvador
2013-04-28 23:02 ` Marek Vasut
2013-04-28 23:08 ` Otavio Salvador
2013-04-28 23:13 ` Marek Vasut
2013-04-28 23:21 ` Otavio Salvador
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox