
On 09/24/2012 07:03:37 PM, Tom Rini wrote:
On Mon, Sep 24, 2012 at 06:52:40PM -0500, Scott Wood wrote:
On 09/24/2012 06:48:28 PM, Tom Rini wrote:
On Fri, Sep 21, 2012 at 07:01:18PM -0500, Scott Wood wrote:
Signed-off-by: Scott Wood scottwood@freescale.com
[snip]
diff --git a/arch/powerpc/cpu/mpc85xx/Makefile
b/arch/powerpc/cpu/mpc85xx/Makefile
index 33e93c8..c51a774 100644 --- a/arch/powerpc/cpu/mpc85xx/Makefile +++ b/arch/powerpc/cpu/mpc85xx/Makefile @@ -28,7 +28,25 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).o
+MINIMAL=
+ifdef CONFIG_SPL_BUILD +ifdef CONFIG_SPL_INIT_MINIMAL +MINIMAL=y +endif +endif
+ifdef MINIMAL
+START = start.o resetvec.o
+COBJS-y += cpu_init_early.o tlb.o +COBJS-$(CONFIG_SPL_NAND_MINIMAL) += cpu_init_nand.o
+else
So, maybe it's just personal preference by why not: START = start.o resetvec.o ifdef CONFIG_SPL_BUILD COBJS-$(CONFIG_SPL_INIT_MINIMAL) += cpu_init_early.o tlb.o COBJS-$(CONFIG_SPL_NAND_MINIMAL) += cpu_init_nand.o else ....
The START line could be factored out, but I don't think the rest works -- where would non-minimal SPL pull in its files?
COBJS-$(CONFIG_WHATEVER_IT_USES) ?
You're assuming that every WHATEVER_IT_USES has its own symbol (separate from symbols needed by a minimal build), which is something I was unsuccessful at pushing people to do early in the SPL development. I'm not optimistic that things will suddenly change. MINIMAL is a wall that avoids breakage when non-minimal SPL developers add things sloppily.
Plus, this way non-minimal SPL can just get the whole arch/powerpc/cpu/mpc85xx and rely on gc-sections, without having to duplicate things in the makefile and do fine-grained config.
MINIMAL means CONFIG_SPL_BUILD (true of all SPLs) and CONFIG_SPL_INIT_MINIMAL.
CONFIG_SPL_BUILD is always true when you're building the SPL itself, but it's not always true when CONFIG_SPL_INIT_MINIMAL is defined, because other than CONFIG_SPL_BUILD the config symbols don't change when building the main U-Boot.
So setting CONFIG_SPL_NAND_MINIMAL and not being compatible with it could be a problem. But is that a likely problem to run into? And probably a problem that would best be solved by making cpu_init_nand.o more re-usable? Or did you mean something else?
I don't quite understand the above, though cpu_init_nand.o should be renamed to cpu_init_minimal.o and depend on CONFIG_SPL_INIT_MINIMAL rather than CONFIG_SPL_NAND_MINIMAL. There's nothing really NAND-specific about it, other than that NAND is the only place we need a minimal SPL.
-Scott