Patchwork [U-Boot,RFC,v2,12/12] arm, davinci: Add support for generating AIS images to the Makefile

login
register
mail settings
Submitter Christian Riesch
Date Nov. 21, 2011, 4:33 p.m.
Message ID <1321893227-19545-14-git-send-email-christian.riesch@omicron.at>
Download mbox | patch
Permalink /patch/126842/
State Superseded
Headers show

Comments

Christian Riesch - Nov. 21, 2011, 4:33 p.m.
Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
 .gitignore                       |    1 +
 Makefile                         |   10 ++++++++++
 board/davinci/da8xxevm/config.mk |    5 +++++
 3 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 board/davinci/da8xxevm/config.mk
Mike Frysinger - Nov. 21, 2011, 7:09 p.m.
On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
> --- a/Makefile
> +++ b/Makefile
>
> +$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
> +		$(obj)tools/mkimage -s -n /dev/null -T aisimage \
> +		-e $(CONFIG_SPL_TEXT_BASE) -d $(obj)spl/u-boot-spl.bin \
> +		$(obj)spl/u-boot-spl.ais
> +		$(OBJCOPY) ${OBJCFLAGS} -I binary --pad-to=$(PAD_TO) -O binary
> $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais +		cat
> $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > $(obj)u-boot.ais +		rm
> $(obj)spl/u-boot-spl.ais
> +		rm $(obj)spl/u-boot-spl-pad.ais
> +

can't this live in arch/arm/.../config.mk somewhere ?

> --- /dev/null
> +++ b/board/davinci/da8xxevm/config.mk
>
> +# required for SPI flash SPL
> +#
> +
> +PAD_TO	:= 32768

"PAD_TO" is way too generic a name.  this should also be a CONFIG_XXX define in 
the board config header rather than using config.mk.
-mike
Christian Riesch - Nov. 22, 2011, 7:30 a.m.
Hello Mike,
Thank you for your comments.

On Mon, Nov 21, 2011 at 8:09 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
>> --- a/Makefile
>> +++ b/Makefile
>>
>> +$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
>> +             $(obj)tools/mkimage -s -n /dev/null -T aisimage \
>> +             -e $(CONFIG_SPL_TEXT_BASE) -d $(obj)spl/u-boot-spl.bin \
>> +             $(obj)spl/u-boot-spl.ais
>> +             $(OBJCOPY) ${OBJCFLAGS} -I binary --pad-to=$(PAD_TO) -O binary
>> $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais +               cat
>> $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > $(obj)u-boot.ais +            rm
>> $(obj)spl/u-boot-spl.ais
>> +             rm $(obj)spl/u-boot-spl-pad.ais
>> +
>
> can't this live in arch/arm/.../config.mk somewhere ?

I guess it could. I placed it in Makefile since there are already a
lot of similar targets there, like $(obj)u-boot.kwb, $(obj)u-boot.imx,
$(obj)u-boot.ubl...

>
>> --- /dev/null
>> +++ b/board/davinci/da8xxevm/config.mk
>>
>> +# required for SPI flash SPL
>> +#
>> +
>> +PAD_TO       := 32768
>
> "PAD_TO" is way too generic a name.  this should also be a CONFIG_XXX define in
> the board config header rather than using config.mk.

Ok. I'll find a different name. I used $(PAD_TO) since the
$(obj)u-boot.ubl target in Makefile already uses this name.
Regards, Christian
Mike Frysinger - Nov. 22, 2011, 8:57 p.m.
On Tuesday 22 November 2011 02:30:59 Christian Riesch wrote:
> Hello Mike,
> Thank you for your comments.
> 
> On Mon, Nov 21, 2011 at 8:09 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
> >> --- a/Makefile
> >> +++ b/Makefile
> >> 
> >> +$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
> >> +             $(obj)tools/mkimage -s -n /dev/null -T aisimage \
> >> +             -e $(CONFIG_SPL_TEXT_BASE) -d $(obj)spl/u-boot-spl.bin \
> >> +             $(obj)spl/u-boot-spl.ais
> >> +             $(OBJCOPY) ${OBJCFLAGS} -I binary --pad-to=$(PAD_TO) -O
> >> binary $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais +        
> >>       cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin >
> >> $(obj)u-boot.ais +            rm $(obj)spl/u-boot-spl.ais
> >> +             rm $(obj)spl/u-boot-spl-pad.ais
> >> +
> > 
> > can't this live in arch/arm/.../config.mk somewhere ?
> 
> I guess it could. I placed it in Makefile since there are already a
> lot of similar targets there, like $(obj)u-boot.kwb, $(obj)u-boot.imx,
> $(obj)u-boot.ubl...

we need to clean this up.  if moving the target to a cpu config.mk doesn't 
work, then we can leave it alone for now until we generally clean this cruft 
up.

> >> --- /dev/null
> >> +++ b/board/davinci/da8xxevm/config.mk
> >> 
> >> +# required for SPI flash SPL
> >> +#
> >> +
> >> +PAD_TO       := 32768
> > 
> > "PAD_TO" is way too generic a name.  this should also be a CONFIG_XXX
> > define in the board config header rather than using config.mk.
> 
> Ok. I'll find a different name. I used $(PAD_TO) since the
> $(obj)u-boot.ubl target in Makefile already uses this name.

we should fix that too ;)
-mike

Patch

diff --git a/.gitignore b/.gitignore
index ff4bae0..e4e95e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ 
 /u-boot.dis
 /u-boot.lds
 /u-boot.ubl
+/u-boot.ais
 /u-boot.dtb
 /u-boot.sb
 
diff --git a/Makefile b/Makefile
index fb658f4..94c5fbb 100644
--- a/Makefile
+++ b/Makefile
@@ -417,6 +417,15 @@  $(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
 		rm $(obj)u-boot-ubl.bin
 		rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+		$(obj)tools/mkimage -s -n /dev/null -T aisimage \
+		-e $(CONFIG_SPL_TEXT_BASE) -d $(obj)spl/u-boot-spl.bin \
+		$(obj)spl/u-boot-spl.ais
+		$(OBJCOPY) ${OBJCFLAGS} -I binary --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
+		cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > $(obj)u-boot.ais
+		rm $(obj)spl/u-boot-spl.ais
+		rm $(obj)spl/u-boot-spl-pad.ais
+
 $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
 		elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \
 			-o $(obj)u-boot.sb
@@ -788,6 +797,7 @@  clobber:	clean
 	@rm -f $(obj)u-boot.kwb
 	@rm -f $(obj)u-boot.imx
 	@rm -f $(obj)u-boot.ubl
+	@rm -f $(obj)u-boot.ais
 	@rm -f $(obj)u-boot.dtb
 	@rm -f $(obj)u-boot.sb
 	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
diff --git a/board/davinci/da8xxevm/config.mk b/board/davinci/da8xxevm/config.mk
new file mode 100644
index 0000000..05cf77f
--- /dev/null
+++ b/board/davinci/da8xxevm/config.mk
@@ -0,0 +1,5 @@ 
+# required for SPI flash SPL
+#
+
+PAD_TO	:= 32768
+