From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Schwarz Date: Wed, 27 Jul 2011 11:22:15 +0200 Subject: [U-Boot] [PATCH V4 3/5] nand spl: add NAND Library to new SPL In-Reply-To: <20110726130401.19abc73a@schlenkerla.am.freescale.net> References: <1311675739-10966-1-git-send-email-simonschwarzcor@gmail.com> <1311682158-15150-1-git-send-email-simonschwarzcor@gmail.com> <1311682158-15150-4-git-send-email-simonschwarzcor@gmail.com> <20110726130401.19abc73a@schlenkerla.am.freescale.net> Message-ID: <4E2FD8C7.3080402@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Scott Wood, On 07/26/2011 08:04 PM, Scott Wood wrote: > On Tue, 26 Jul 2011 14:09:16 +0200 > Simon Schwarz wrote: > >> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile >> index 8b598f6..cdc9a14 100644 >> --- a/drivers/mtd/nand/Makefile >> +++ b/drivers/mtd/nand/Makefile >> @@ -26,12 +26,16 @@ include $(TOPDIR)/config.mk >> LIB := $(obj)libnand.o >> >> ifdef CONFIG_CMD_NAND >> +ifdef CONFIG_SPL_BUILD >> +COBJS-y += nand_spl.o >> +else >> COBJS-y += nand.o >> COBJS-y += nand_base.o >> COBJS-y += nand_bbt.o >> -COBJS-y += nand_ecc.o >> COBJS-y += nand_ids.o >> COBJS-y += nand_util.o >> +endif >> +COBJS-y += nand_ecc.o > > You're assuming all NAND SPLs will want nand_ecc -- this will not fit in > most current ones. True. I changed it to: ifdef CONFIG_SPL_BUILD COBJS-y += nand_spl.o ifdef CONFIG_OMAP34XX COBJS-y += nand_ecc.o endif else COBJS-y += nand.o COBJS-y += nand_base.o COBJS-y += nand_bbt.o COBJS-y += nand_ids.o COBJS-y += nand_util.o COBJS-y += nand_ecc.o endif Is there a simple way to write that without duplication of nand_ecc? > > Where is nand_spl.c, and what is in it that is appropriate for all targets? It is essentially the old nand_boot.c from nand_spl. It is added with this patch to drivers/mtd/nand/nand_spl.c So IMHO all boards which are activating the nand library for SPL need this one. There are some alternative implementations in the nand_spl - when they are added to the new SPL the devs may add switches as needed. > > -Scott > Regards & Thanks for your feedback! Simon