diff mbox

[U-Boot,3/8,v3] Introduce the Tertiary Program loader

Message ID 1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com
State Superseded
Headers show

Commit Message

Haiying Wang Jan. 28, 2011, 4:58 a.m. UTC
From: Haiying Wang <Haiying.Wang@freescale.com>

TPL is introduced to enable a loader stub that boots out of some type of RAM,
after being loaded by an SPL or similar platform-specific mechanism.

One example of using this tpl loader is to initialize the ddr through spd code
in case the L2 SRAM size is not big enough to hold the final uboot image and
the nand spl code needs to be limitated to 4K byte, then tpl code will load the
final uboot image after ddr is initialized.

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
---
v3: remove TPL_BOOT, use HAS_TPL and IN_TPL
 Makefile |   15 ++++++++++++++-
 README   |   27 +++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletions(-)

Comments

Fabian Cenedese Jan. 28, 2011, 10:02 a.m. UTC | #1
At 23:58 27.01.2011 -0500, Haiying.Wang@freescale.com wrote:
>From: Haiying Wang <Haiying.Wang@freescale.com>
>
>Support P1021MDS board to boot from NAND flash (No NOR flash on this
>board). And because P1021 only has 256K L2 SRAM, which can not used for final
>uboot image, this patch also enables the TPL BOOT on P1021MDS so that DDR can
>be initialized in L2 SRAM through SPD code. So there are three stage uboot
>images:
>* nand_spl, pad from 4KB size to 16KB, load tpl_boot from offset 16KB in NAND.
>* tpl_boot, 112KB size. The env variables are copied to offset 128KB
>  in L2 SRAM, so that ddr spd code can get the interleaving mode setting in env.
>  It loads final uboot image from offset 128KB in NAND.
>* final uboot image, size is variable depends on the functions enabled.

I'm not questioning the patch, I'm just trying to understand.

>+#define CONFIG_MP                      /* Multiprocessor support */
>+
>+#define CONFIG_PCI                     /* Disable PCI/PCIE */

Shouldn't that be "Enable" PCI?

bye  Fabi
Haiying Wang Jan. 28, 2011, 2:43 p.m. UTC | #2
On Fri, 2011-01-28 at 11:02 +0100, Fabian Cenedese wrote:
> 
> I'm not questioning the patch, I'm just trying to understand.
> 
> >+#define CONFIG_MP                      /* Multiprocessor support */
> >+
> >+#define CONFIG_PCI                     /* Disable PCI/PCIE */
> 
> Shouldn't that be "Enable" PCI?

Yes, you are right. Thanks for pointing out.

Haiying
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 0d1ea5d..ae5db69 100644
--- a/Makefile
+++ b/Makefile
@@ -402,8 +402,19 @@  $(obj)u-boot.lds: $(LDSCRIPT)
 nand_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
 
+tpl:		$(TIMESTAMP_FILE) $(VERSION_FILE) depend
+		$(MAKE) -C tpl/board/$(BOARDDIR) all
+
+NAND_SPL_OBJS-y += $(obj)nand_spl/u-boot-spl-16k.bin
+NAND_SPL_OBJS-$(CONFIG_HAS_TPL) += $(obj)tpl/u-boot-tpl.bin
+NAND_SPL_OBJS-y += $(obj)u-boot.bin
+
+ifeq ($(CONFIG_HAS_TPL),y)
+$(obj)u-boot-nand.bin:	nand_spl tpl $(obj)u-boot.bin
+else
 $(obj)u-boot-nand.bin:	nand_spl $(obj)u-boot.bin
-		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
+endif
+		cat $(NAND_SPL_OBJS-y) > $(obj)u-boot-nand.bin
 
 onenand_ipl:	$(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 		$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
@@ -1221,6 +1232,7 @@  clean:
 	@rm -f $(obj)lib/asm-offsets.s
 	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
 	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
+	@rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.map}
 	@rm -f $(ONENAND_BIN)
 	@rm -f $(obj)onenand_ipl/u-boot.lds
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@@ -1245,6 +1257,7 @@  clobber:	clean
 	@rm -fr $(obj)include/generated
 	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
 	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
+	@[ ! -d $(obj)tpl ] || find $(obj)tpl -name "*" -type l -print | xargs rm -f
 
 ifeq ($(OBJTREE),$(SRCTREE))
 mrproper \
diff --git a/README b/README
index 755d17c..a37fdb1 100644
--- a/README
+++ b/README
@@ -2124,6 +2124,33 @@  FIT uImage format:
 		Adds the MTD partitioning infrastructure from the Linux
 		kernel. Needed for UBI support.
 
+- NAND Boot Support
+		CONFIG_NAND_U_BOOT
+
+		Builds a U-Boot image that boots from NAND, prefixed by a small
+		loader stub (secondary program loader -- SPL) that loads the
+		rest of U-Boot into RAM.  This symbol will be set in all build
+		phases.
+
+		CONFIG_NAND_SPL
+
+		This is set by the build system when compiling code to go into
+		the SPL.  It is not set when building the code that the SPL
+		loads.
+
+- TPL Boot Support
+		CONFIG_HAS_TPL
+
+		Builds a U-Boot image that contains a loader stub (tertiary
+		program loader -- TPL) that boots out of some type of RAM,
+		after being loaded by an SPL or similar platform-specific
+		mechanism.  This symbol will be set in all build phases.
+
+		CONFIG_IN_TPL
+
+		This is set by the build system when compiling code to go into
+		the TPL.  It is not set when building the code that the TPL
+		loads, or when building the SPL.
 
 Modem Support:
 --------------