From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 25 Feb 2013 14:10:13 -0600 Subject: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target In-Reply-To: <1361816397-8661-1-git-send-email-marex@denx.de> (from marex@denx.de on Mon Feb 25 12:19:54 2013) Message-ID: <1361823013.27903.8@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/25/2013 12:19:54 PM, Marek Vasut wrote: > Implement u-boot.nand target that can be reused with a small amount of > churn across all CPU models. The idea is to delegate the u-boot.nand > target > out of the main Makefile and into the CPU's Makefile (very similar to > what > u-boot.imx does now). The main Makefile shall only contain path to > which the > u-boot.nand target is delegated. Hopefully this will not produce too > much > bloat in the main Makefile. > > To demonstrate this implementation, add u-boot.nand target for i.MX53. > > Signed-off-by: Marek Vasut > Cc: Beno?t Th?baudeau > Cc: Fabio Estevam > Cc: Stefano Babic > --- > Makefile | 18 ++++++++++++++++++ > arch/arm/imx-common/Makefile | 6 ++++++ > 2 files changed, 24 insertions(+) > > diff --git a/Makefile b/Makefile > index 41054b7..8b1010a 100644 > --- a/Makefile > +++ b/Makefile > @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin > $(obj)u-boot.imx: $(obj)u-boot.bin depend > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common > $(obj)u-boot.imx > > +# > +# Generic u-boot.nand target. > +# > +# Every CPU that needs u-boot.nand must add a path to an > implementation of > +# the actual u-boot.nand generator below. > +# > +ifdef CONFIG_MX53 > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common > +endif > + > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; > then \ > + echo "This CPU does not support u-boot.nand > target!" ; \ > + exit 1 > ; \ > + fi > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand We already have CONFIG_SPL_TARGET. Why do we need a new mechanism specific to NAND, with ifdefs in the main Makefile? If we do have something specific to NAND, it should be u-boot-nand.bin to match what nand_spl produced, and it should just be a generic rule that links to what CONFIG_SPL_TARGET produced, if the right CONFIG symbol is set by the board config to say that this is a NAND SPL. Or is someone going to say that they want to generate multiple different SPL images from the same build? :-P -Scott