diff mbox

[1/2] Build u-boot.imx by default when board uses it

Message ID 1320932982-19967-2-git-send-email-loic.minier@linaro.org
State New
Headers show

Commit Message

loic.minier@linaro.org Nov. 10, 2011, 1:49 p.m. UTC
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
---
 Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Stefano Babic Nov. 10, 2011, 3:35 p.m. UTC | #1
On 11/10/2011 02:49 PM, Loïc Minier wrote:
> Signed-off-by: Loïc Minier <loic.minier@linaro.org>
> ---
>  Makefile |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 294c762..0ccc3bf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -365,6 +365,10 @@ ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
>  ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
>  ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
>  
> +ifneq ($(CONFIG_IMX_CONFIG),)
> +ALL-y += $(obj)u-boot.imx
> +endif
> +
>  all:		$(ALL-y) $(SUBDIR_EXAMPLES)
>  
>  $(obj)u-boot.dtb:	$(obj)u-boot

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Mike Frysinger Nov. 10, 2011, 11:24 p.m. UTC | #2
On Thursday 10 November 2011 08:49:41 Loïc Minier wrote:
> --- a/Makefile
> +++ b/Makefile
> 
> +ifneq ($(CONFIG_IMX_CONFIG),)
> +ALL-y += $(obj)u-boot.imx
> +endif

why won't this work:
ALL-$(CONFIG_IMX_CONFIG) += $(obj)u-boot.mix

that was the point of naming it "ALL-y" in the first place ...
-mike
loic.minier@linaro.org Nov. 10, 2011, 11:45 p.m. UTC | #3
On Thu, Nov 10, 2011, Mike Frysinger wrote:
> > +ifneq ($(CONFIG_IMX_CONFIG),)
> > +ALL-y += $(obj)u-boot.imx
> > +endif
> why won't this work:
> ALL-$(CONFIG_IMX_CONFIG) += $(obj)u-boot.mix
> that was the point of naming it "ALL-y" in the first place ...

 That's what I tried at first, but CONFIG_IMX_CONFIG is actually the
 name of the config file to pass to mkimage; same for u-boot.kwb.

 CONFIG_IMX_CONFIG is set in boards.cfg.
Mike Frysinger Nov. 11, 2011, 1:51 a.m. UTC | #4
On Thursday 10 November 2011 18:45:30 Loïc Minier wrote:
> On Thu, Nov 10, 2011, Mike Frysinger wrote:
> > > +ifneq ($(CONFIG_IMX_CONFIG),)
> > > +ALL-y += $(obj)u-boot.imx
> > > +endif
> > 
> > why won't this work:
> > ALL-$(CONFIG_IMX_CONFIG) += $(obj)u-boot.mix
> > that was the point of naming it "ALL-y" in the first place ...
> 
>  That's what I tried at first, but CONFIG_IMX_CONFIG is actually the
>  name of the config file to pass to mkimage; same for u-boot.kwb.
> 
>  CONFIG_IMX_CONFIG is set in boards.cfg.

ugly undocumented CONFIG's are awesome

this really should be in a subdir rather than the top level.  we want to keep 
arch/soc-specific cruft out of the top level Makefile if possible.  isn't there 
a sub-config.mk somewhere you could add the line unconditionally ?
-mike
Daniel Schwierzeck Nov. 11, 2011, 2:29 a.m. UTC | #5
On 11.11.2011 00:45, Loïc Minier wrote:
> On Thu, Nov 10, 2011, Mike Frysinger wrote:
>>> +ifneq ($(CONFIG_IMX_CONFIG),)
>>> +ALL-y += $(obj)u-boot.imx
>>> +endif
>> why won't this work:
>> ALL-$(CONFIG_IMX_CONFIG) += $(obj)u-boot.mix
>> that was the point of naming it "ALL-y" in the first place ...
>
>   That's what I tried at first, but CONFIG_IMX_CONFIG is actually the
>   name of the config file to pass to mkimage; same for u-boot.kwb.
>
>   CONFIG_IMX_CONFIG is set in boards.cfg.
>

why not

ALL-$(CONFIG_UBOOT_IMG) += $(obj)u-boot.img
ALL-$(CONFIG_UBOOT_IMX) += $(obj)u-boot.imx
ALL-$(CONFIG_UBOOT_KWB) += $(obj)u-boot.kwb

then you can define CONFIG_UBOOT_KWB or CONFIG_UBOOT_IMX in your board 
config if needed

Best regards,
Daniel
Aneesh V Nov. 11, 2011, 3:39 a.m. UTC | #6
On Friday 11 November 2011 07:21 AM, Mike Frysinger wrote:
> On Thursday 10 November 2011 18:45:30 Loïc Minier wrote:
>> On Thu, Nov 10, 2011, Mike Frysinger wrote:
>>>> +ifneq ($(CONFIG_IMX_CONFIG),)
>>>> +ALL-y += $(obj)u-boot.imx
>>>> +endif
>>>
>>> why won't this work:
>>> ALL-$(CONFIG_IMX_CONFIG) += $(obj)u-boot.mix
>>> that was the point of naming it "ALL-y" in the first place ...
>>
>>   That's what I tried at first, but CONFIG_IMX_CONFIG is actually the
>>   name of the config file to pass to mkimage; same for u-boot.kwb.
>>
>>   CONFIG_IMX_CONFIG is set in boards.cfg.
>
> ugly undocumented CONFIG's are awesome
>
> this really should be in a subdir rather than the top level.  we want to keep
> arch/soc-specific cruft out of the top level Makefile if possible.  isn't there
> a sub-config.mk somewhere you could add the line unconditionally ?

This is what I have done for u-boot.img for OMAP4.

arch/arm/cpu/armv7/omap4/config.mk has this:

ifdef CONFIG_SPL_BUILD
ALL-y	+= $(OBJTREE)/MLO
else
ALL-y	+= $(obj)u-boot.img
endif

However, this may have to be duplicated in many such config.mk files.

br,
Aneesh
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 294c762..0ccc3bf 100644
--- a/Makefile
+++ b/Makefile
@@ -365,6 +365,10 @@  ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 
+ifneq ($(CONFIG_IMX_CONFIG),)
+ALL-y += $(obj)u-boot.imx
+endif
+
 all:		$(ALL-y) $(SUBDIR_EXAMPLES)
 
 $(obj)u-boot.dtb:	$(obj)u-boot