diff mbox

[U-Boot,RFC,11/17] spl/nand: introduce CONFIG_SPL_NAND_MINIMAL

Message ID 1348272087-29608-12-git-send-email-scottwood@freescale.com
State RFC
Headers show

Commit Message

Scott Wood Sept. 22, 2012, 12:01 a.m. UTC
This will be used by SPL builds that do not use the standard nand_base.c
and friends.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 README                    |    3 +++
 drivers/mtd/nand/Makefile |   41 +++++++++++++++++++++++++++++++----------
 2 files changed, 34 insertions(+), 10 deletions(-)

Comments

Tom Rini Sept. 24, 2012, 11:55 p.m. UTC | #1
On Fri, Sep 21, 2012 at 07:01:21PM -0500, Scott Wood wrote:

> This will be used by SPL builds that do not use the standard nand_base.c
> and friends.
[snip]
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
[snip]
> +ifdef CONFIG_SPL_NAND_MINIMAL
> +# minimal-only files go here
>  else
> +CONFIG_SPL_NAND_ECC=y
> +CONFIG_SPL_NAND_BASE=y
> +CONFIG_SPL_NAND_DRIVERS=y
> +endif

OK, why don't we just use these as regular board-config.h file based
options?  We already have to set a number of CONFIG_SYS_NAND defines.
Scott Wood Sept. 25, 2012, 12:02 a.m. UTC | #2
On 09/24/2012 06:55:49 PM, Tom Rini wrote:
> On Fri, Sep 21, 2012 at 07:01:21PM -0500, Scott Wood wrote:
> 
> > This will be used by SPL builds that do not use the standard  
> nand_base.c
> > and friends.
> [snip]
> > --- a/drivers/mtd/nand/Makefile
> > +++ b/drivers/mtd/nand/Makefile
> [snip]
> > +ifdef CONFIG_SPL_NAND_MINIMAL
> > +# minimal-only files go here
> >  else
> > +CONFIG_SPL_NAND_ECC=y
> > +CONFIG_SPL_NAND_BASE=y
> > +CONFIG_SPL_NAND_DRIVERS=y
> > +endif
> 
> OK, why don't we just use these as regular board-config.h file based
> options?  We already have to set a number of CONFIG_SYS_NAND defines.

OK -- just add them to all boards that currently have  
CONFIG_SPL_NAND_SUPPORT?

-Scott
Tom Rini Sept. 25, 2012, 12:13 a.m. UTC | #3
On Mon, Sep 24, 2012 at 07:02:18PM -0500, Scott Wood wrote:
> On 09/24/2012 06:55:49 PM, Tom Rini wrote:
> >On Fri, Sep 21, 2012 at 07:01:21PM -0500, Scott Wood wrote:
> >
> >> This will be used by SPL builds that do not use the standard
> >nand_base.c
> >> and friends.
> >[snip]
> >> --- a/drivers/mtd/nand/Makefile
> >> +++ b/drivers/mtd/nand/Makefile
> >[snip]
> >> +ifdef CONFIG_SPL_NAND_MINIMAL
> >> +# minimal-only files go here
> >>  else
> >> +CONFIG_SPL_NAND_ECC=y
> >> +CONFIG_SPL_NAND_BASE=y
> >> +CONFIG_SPL_NAND_DRIVERS=y
> >> +endif
> >
> >OK, why don't we just use these as regular board-config.h file based
> >options?  We already have to set a number of CONFIG_SYS_NAND defines.
> 
> OK -- just add them to all boards that currently have
> CONFIG_SPL_NAND_SUPPORT?

Yeah, and maybe some quick checking to see which are really needed (just
need to build-check say omap3_beagle and da850evm to cover all of the
"omap" and then davinci platforms).  Looking at the omap3_beagle discard
map I have handy, we might be able to toss some stuff out.
diff mbox

Patch

diff --git a/README b/README
index 8e07d41..5a57a14 100644
--- a/README
+++ b/README
@@ -2637,6 +2637,9 @@  FIT uImage format:
 		CONFIG_SPL_NAND_SIMPLE
 		Support for drivers/mtd/nand/libnand.o in SPL binary
 
+		CONFIG_SPL_NAND_MINIMAL
+		Do not build the standard NAND subsystem files.
+
 		CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT,
 		CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
 		CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 29dc20e..5be1270 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -26,21 +26,40 @@  include $(TOPDIR)/config.mk
 LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
+
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+
+ifdef CONFIG_SPL_NAND_MINIMAL
+# minimal-only files go here
 else
+CONFIG_SPL_NAND_ECC=y
+CONFIG_SPL_NAND_BASE=y
+CONFIG_SPL_NAND_DRIVERS=y
+endif
+
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o
+COBJS-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
+
+else # not spl
+
+# Further references to these symbols in this file mean,
+# "Build this if we're not in SPL, or if we're in SPL and the symbol was set."
+CONFIG_SPL_NAND_ECC=y
+CONFIG_SPL_NAND_BASE=y
+CONFIG_SPL_NAND_DRIVERS=y
+
 COBJS-y += nand.o
 COBJS-y += nand_bbt.o
 COBJS-y += nand_ids.o
 COBJS-y += nand_util.o
-endif
-COBJS-y += nand_ecc.o
-COBJS-y += nand_base.o
+
+endif # not spl
+
+COBJS-$(CONFIG_SPL_NAND_ECC) += nand_ecc.o
+COBJS-$(CONFIG_SPL_NAND_BASE) += nand_base.o
+
+ifdef CONFIG_SPL_NAND_DRIVERS
+
 COBJS-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
 
 COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
@@ -64,7 +83,9 @@  COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
-endif
+
+endif # drivers
+endif # nand
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)