Improve default "make" targets (ALL-y)
Hey
For the Debian package, we currently maintain lists like:
dbau1100 u-boot.img dockstar u-boot.kwb eNET u-boot.bin efikamx u-boot.imx omap4_panda MLO u-boot.bin
[...]
for two reasons:
- because we need to call make u-boot.kwb explicitly to get it built
- to list the files from the obj-dir that we actually want in the .deb
it would be nicer for the packaging, but I guess also for u-boot maintainers, if these files were just generated by default when one calls "make".
The subsequent patches will generate u-boot.imx and u-boot.kwb when it's obvious that these are desired.
However, I didn't manage to find hints in the u-boot tree on when "u-boot.img" should be generated, and when u-boot.bin is enough; apparently one can mkimage -T firmware for any board config. Ideas welcome on how to detect these.
Thanks,
Signature · 1 line
Lo?c Minier
PATCH 1/2 Build u-boot.imx by default when board uses it
--- Makefile | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Makefile +4 -0
@@ -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
Signature · 1 line
1.7.7.1
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 10 lines · Lo?c Minier
Signed-off-by Lo?c Minier <[email protected]>--- Makefile | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)Makefile +0
-0
Makefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 374
Quoted 10 lines
Makefile +4
-0@@ -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
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH 1/2 Build u-boot.imx by default when board uses it
In reply to Loïc MinierMakefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 370
Quoted 6 lines · On Thursday 10 November 2011 08:49:41 Lo?c Minier wrote:
Makefile +3
-0+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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111110/cfff3698/attachment.pgp
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 6 lines · Mike Frysinger
Makefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 370
Quoted 3 lines
Makefile +3
-0+ifneq ($(CONFIG_IMX_CONFIG),) +ALL-y += $(obj)u-boot.imx +endifwhy 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.
Signature · 1 line
Lo?c Minier
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 9 lines · On Thursday 10 November 2011 18:45:30 Lo?c Minier wrote:
Quoted 7 lines · Mike Frysinger
Makefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 370
Quoted 3 lines
Makefile +3
-0+ifneq ($(CONFIG_IMX_CONFIG),) +ALL-y += $(obj)u-boot.imx +endifwhy 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 ...
Quoted 4 lines
That's what I tried at first, but
CONFIG_IMX_CONFIGis actually the name of the config file to pass to mkimage; same for u-boot.kwb.
CONFIG_IMX_CONFIGis 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111110/21707acb/attachment.pgp
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 13 lines · Mike Frysinger
Quoted 12 lines · On Thursday 10 November 2011 18:45:30 Lo?c Minier wrote:
Quoted 7 lines · Mike Frysinger
Makefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 370
Quoted 3 lines
Makefile +3
-0+ifneq ($(CONFIG_IMX_CONFIG),) +ALL-y += $(obj)u-boot.imx +endifwhy 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_CONFIGis actually the name of the config file to pass to mkimage; same for u-boot.kwb.
Quoted 7 lines
Quoted 1 line
CONFIG_IMX_CONFIGis 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-specificcruft out of the top levelMakefileif 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
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 9 lines · Aneesh V
arch/arm/cpu/armv7/omap4/config.mkhas this:ifdef
CONFIG_SPL_BUILD
ALL-y += $(OBJTREE)/MLO
else
ALL-y += $(obj)u-boot.img
endifHowever, this may have to be duplicated in many such config.mk files.
Ah I had seen this snippet and wondered why you hadn't put it in spl/Makefile, but now I realize that only the MLO part could go there, and that you don't want to built u-boot.img when building a spl.
I don't really mind whether we set these things in some specific .mk files or in Makefile + spl/Makefile; I care that it's consistent and that related things are kept together as to update them together. I guess we can follow the OMAP approach for other boards.
Signature · 1 line
Lo?c Minier
PATCH 1/2 Build u-boot.imx by default when board uses it
In reply to Mike FrysingerQuoted 8 lines · Mike Frysinger
Quoted 1 line
CONFIG_IMX_CONFIGis 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-specificcruft out of the top levelMakefileif possible. isn't there a sub-config.mk somewhere you could add the line unconditionally ?
Can't see one, but Aneesh proposes the OMAP approach of arch/arm/cpu/**/config.mk files.
The CONFIG_IMX_CONFIG actually changes per-board, so the boards.cfg approach to set it seems ok; however we could try defining the u-boot.imx rule in a common i.MX makefile snippet somewhere.
Perhaps arch/arm/cpu/armv7/config.mk or arch/arm/cpu/armv7/mx5/Makefile, or a new file; I don't have a strong opinion.
Signature · 1 line
Lo?c Minier
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 13 lines · On Friday 11 November 2011 08:35:14 Lo?c Minier wrote:
Quoted 8 lines · Mike Frysinger
Quoted 1 line
CONFIG_IMX_CONFIGis 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-specificcruft out of the top levelMakefileif possible. isn't there a sub-config.mk somewhere you could add the line unconditionally ?Can't see one, but Aneesh proposes the OMAP approach of
arch/arm/cpu/**/config.mkfiles.
Quoted 7 lines
The
CONFIG_IMX_CONFIGactually changes per-board, so the boards.cfg approach to set it seems ok; however we could try defining the u-boot.imx rule in a common i.MX makefile snippet somewhere.Perhaps
arch/arm/cpu/armv7/config.mkorarch/arm/cpu/armv7/mx5/Makefile, or a new file; I don't have a strong opinion.
if there's a config option to key off of, and it affects multiple arm arches/socs, then arch/arm/config.mk would probably be the best place to add the lines.
maybe Albert has an opinion on the arch/arm/ layout.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111111/f78fdf28/attachment.pgp
PATCH 1/2 Build u-boot.imx by default when board uses it
In reply to Loïc MinierQuoted 13 lines · Lo?c Minier
Quoted 8 lines · Mike Frysinger
Quoted 1 line
CONFIG_IMX_CONFIGis 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-specificcruft out of the top levelMakefileif possible. isn't there a sub-config.mk somewhere you could add the line unconditionally ?Can't see one, but Aneesh proposes the OMAP approach of
arch/arm/cpu/**/config.mkfiles.
Quoted 7 lines
The
CONFIG_IMX_CONFIGactually changes per-board, so the boards.cfg approach to set it seems ok; however we could try defining the u-boot.imx rule in a common i.MX makefile snippet somewhere.Perhaps
arch/arm/cpu/armv7/config.mkorarch/arm/cpu/armv7/mx5/Makefile, or a new file; I don't have a strong opinion.
Then maybe in arch/arm/cpu/armv7/config.mk - the coming MX6 SOC will use CONFIG_IMX_CONFIG, too.
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH 1/2 Build u-boot.imx by default when board uses it
In reply to Loïc MinierDear =?iso-8859-1?Q?Lo=EFc?= Minier,
Quoted 3 lines · In message <[email protected]> you wrote:
The
CONFIG_IMX_CONFIGactually changes per-board, so the boards.cfg approach to set it seems ok; however we could try defining the
No. The ability to pass additional parameters in boards.cfg was primarily needed to be able to remove existing board support from the top level Makefile, which often used lots of such stuff.
New boards, or changes to existing boards, should only make minimal use of this, or even better help to reduce that.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Living on Earth may be expensive, but it includes an annual free trip around the Sun.
PATCH 1/2 Build u-boot.imx by default when board uses it
In reply to Loïc MinierQuoted 8 lines · Lo?c Minier
Quoted 6 lines · Mike Frysinger
Makefile ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin · line 370
Quoted 3 lines
Makefile +3
-0+ifneq ($(CONFIG_IMX_CONFIG),) +ALL-y += $(obj)u-boot.imx +endifwhy 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 ...
Quoted 5 lines
That's what I tried at first, but
CONFIG_IMX_CONFIGis actually the name of the config file to pass to mkimage; same for u-boot.kwb.
CONFIG_IMX_CONFIGis 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
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 6 lines · Daniel Schwierzeck
ALL-$(CONFIG_UBOOT_IMG) += $(obj)u-boot.img
ALL-$(CONFIG_UBOOT_IMX) += $(obj)u-boot.imx
ALL-$(CONFIG_UBOOT_KWB) += $(obj)u-boot.kwbthen you can define
CONFIG_UBOOT_KWBorCONFIG_UBOOT_IMXin your board config if needed
That'd be a fine solution for me if others agree it's the right approach; ideally, we would even set CONFIG_UBOOT_IMX when CONFIG_IMX_CONFIG is set (not sure where though).
Signature · 1 line
Lo?c Minier
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 11 lines · Lo?c Minier
Quoted 6 lines · Daniel Schwierzeck
ALL-$(CONFIG_UBOOT_IMG) += $(obj)u-boot.img
ALL-$(CONFIG_UBOOT_IMX) += $(obj)u-boot.imx
ALL-$(CONFIG_UBOOT_KWB) += $(obj)u-boot.kwbthen you can define
CONFIG_UBOOT_KWBorCONFIG_UBOOT_IMXin your board config if neededThat'd be a fine solution for me if others agree it's the right approach; ideally, we would even set
CONFIG_UBOOT_IMXwhenCONFIG_IMX_CONFIGis set (not sure where though).
Sorry to bring a dead thread to new life...
The issue is not yet solved and I am asking if we can do something for the incoming release 2012.04. I would prefer we do not add a new switch CONFIG_UBOOT_IMX into the configuration file, because it is possible to have the same u-boot image running on different storages, for example on NAND or NOR, and they have different offsets. This means different imximage (header), while u-boot itself (binary) remains the same. So this information should be not interpreted by the compiler.
Rereading the thread a major point is that we must not change the main Makefile. What about if the changes suggested in the patch are put into arch/arm/cpu/armv7/config.mk ?
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 15 lines · Stefano Babic
Quoted 11 lines · Lo?c Minier
Quoted 6 lines · Daniel Schwierzeck
ALL-$(CONFIG_UBOOT_IMG) += $(obj)u-boot.img
ALL-$(CONFIG_UBOOT_IMX) += $(obj)u-boot.imx
ALL-$(CONFIG_UBOOT_KWB) += $(obj)u-boot.kwbthen you can define
CONFIG_UBOOT_KWBorCONFIG_UBOOT_IMXin your board config if needed?That'd be a fine solution for me if others agree it's the right ?approach; ideally, we would even set
CONFIG_UBOOT_IMXwhen ?CONFIG_IMX_CONFIG is set (not sure where though).Sorry to bring a dead thread to new life...
Quoted 7 lines
The issue is not yet solved and I am asking if we can do something for the incoming release 2012.04. I would prefer we do not add a new switch
CONFIG_UBOOT_IMXinto the configuration file, because it is possible to have the same u-boot image running on different storages, for example on NAND or NOR, and they have different offsets. This means different imximage (header), while u-boot itself (binary) remains the same. So this information should be not interpreted by the compiler.
i'm not sure i follow. it's been a while since this thread came through, but it seemed like you could handle this (defining the various CONFIG_xxx stuff) in arch/soc asm/config.h files ?
Quoted 3 lines
Rereading the thread a major point is that we must not change the main
Makefile. What about if the changes suggested in the patch are put intoarch/arm/cpu/armv7/config.mk?
the suggested ALL-$(CONFIG_xxx) syntax should be usable in the arch/soc config.mk files
-mike
PATCH 1/2 Build u-boot.imx by default when board uses it
Quoted 3 lines · Mike Frysinger
the suggested ALL-$(CONFIG_xxx) syntax should be usable in the
arch/socconfig.mk files
Right. I push a new version ;-)
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 2/2 Build u-boot.kwb by default when board uses it
In reply to Loïc Minier--- Makefile | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Makefile +4 -0
@@ -369,6 +369,10 @@ ifneq ($(CONFIG_IMX_CONFIG),) ALL-y += $(obj)u-boot.imx endif +ifneq ($(CONFIG_SYS_KWD_CONFIG),) +ALL-y += $(obj)u-boot.kwb +endif + all: $(ALL-y) $(SUBDIR_EXAMPLES) $(obj)u-boot.dtb: $(obj)u-boot
Signature · 1 line
1.7.7.1
Quoted 18 lines · Lo?c Minier
? ? ? ?Hey
?For the Debian package, we currently maintain lists like:
dbau1100 ? ? ? ?u-boot.img
dockstar ? ? ? ?u-boot.kwb
eNET ? ? ? ? ? ?u-boot.bin
efikamx ? ? ? ? u-boot.imxomap4_panda? ? MLO u-boot.bin
[...]?for two reasons:
?- because we need to call make u-boot.kwb explicitly to get it built ?- to list the files from the obj-dir that we actually want in the .deb?it would be nicer for the packaging, but I guess also for u-boot ?maintainers, if these files were just generated by default when one ?calls "make".
Quoted 7 lines
?The subsequent patches will generate u-boot.imx and u-boot.kwb when ?it's obvious that these are desired.
?However, I didn't manage to find hints in the u-boot tree on when ?"u-boot.img" should be generated, and when u-boot.bin is enough; ?apparently one can mkimage -T firmware for any board config. ?Ideas ?welcome on how to detect these.
Any omap3/omap4/omap5/am335x where you generate MLO you want u-boot.img rather than u-boot.bin, even for panda iirc.
Signature · 1 line
Tom
Quoted 2 lines · Tom Rini
Any omap3/omap4/omap5/am335x where you generate MLO you want u-boot.img rather than u-boot.bin, even for panda iirc.
Thanks for the hint; I'll follow that rule for OMAP3/OMAP4 boards we build in Debian ATM; Aneesh pointed at the Makefile snippet which adds u-boot.img on omap3 and omap4 platforms, sounds good to me.
There are other architectures where it's less obvious:
Debian architecture board target
----------------------------------------------
avr32 hammerhead u-boot.img i386 eNET u-boot.bin mipsel dbau1100 u-boot.img mips qemu_mips u-boot.img powerpc ZUMA u-boot.img sh4 r2dplus u-boot.img sh4 sh7785lcr_32bit u-boot.img sparc gr_xc3s_1500 u-boot.img
I didn't check for each of the single boards above, I wonder whether I can tell from the u-boot source code (if it's correct) whether indeed u-boot.img or u-boot.bin is the correct binary to ship for that board.
[ Ideally, "make" would also build the right one, or perhaps "make install" or some other special target which represents the final deliverables for that board. ]
Signature · 1 line
Lo?c Minier
Quoted 3 lines · On Friday 11 November 2011 08:41:46 Lo?c Minier wrote:
[ Ideally, "make" would also build the right one, or perhaps "make install" or some other special target which represents the final deliverables for that board. ]
yes, make should output by default the necessary images imo. this is why we have ALL-y and the ability for arches/boards to customize things.
there however is no way currently to tell the user what they should be using. they'd simply have to do ls u-boot* and then follow the simple rules:
- ignore: u-boot u-boot.{map,lds,srec,ihex}
- if there is a file other than u-boot.bin, you probably want that
- otherwise, you want u-boot.bin
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111111/d99c4e02/attachment.pgp
Quoted 3 lines · Mike Frysinger
- ignore: u-boot u-boot.{map,lds,srec,ihex}
- if there is a file other than u-boot.bin, you probably want that
- otherwise, you want u-boot.bin
These are decent rules; plus SPL files I guess, and perhaps DTB versions.
What did you think of some kind of "install" or "dist" rule?
Signature · 1 line
Lo?c Minier
Quoted 9 lines · On Friday 11 November 2011 16:01:46 Lo?c Minier wrote:
Quoted 3 lines · Mike Frysinger
- ignore: u-boot u-boot.{map,lds,srec,ihex}
- if there is a file other than u-boot.bin, you probably want that
- otherwise, you want u-boot.binThese are decent rules; plus SPL files I guess, and perhaps DTB versions.
What did you think of some kind of "install" or "dist" rule?
i don't have a problem with "install", but "dist" has clear semantics and is not appropriate for what you want: it's for creating a tarball of the current source tree for distribution (i.e. making a release).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111111/bccacce0/attachment.pgp