All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haiying.Wang at freescale.com <Haiying.Wang@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/8 v3] Introduce the Tertiary Program loader
Date: Thu, 27 Jan 2011 23:58:06 -0500	[thread overview]
Message-ID: <1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com> (raw)

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(-)

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:
 --------------
-- 
1.7.3.1.50.g1e633

             reply	other threads:[~2011-01-28  4:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28  4:58 Haiying.Wang at freescale.com [this message]
2011-01-28  4:58 ` [U-Boot] [PATCH 4/8 v3] powerpc/85xx: add TPL support Haiying.Wang at freescale.com
2011-01-28  4:58 ` [U-Boot] [PATCH 5/8 v3] P1021: add P1021MDS board support Haiying.Wang at freescale.com
2011-01-28 14:49   ` Kumar Gala
2011-01-28 15:19     ` Haiying Wang
2011-01-28 19:06   ` Timur Tabi
2011-01-28 19:13     ` Scott Wood
2011-01-28 19:22     ` Haiying Wang
2011-01-28 19:24       ` Timur Tabi
2011-01-28 19:30         ` Haiying Wang
2011-01-28  4:58 ` [U-Boot] [PATCH 8/8 v3] p1021mds: add QE and UEC support Haiying.Wang at freescale.com
2011-01-28  4:58 ` [U-Boot] [PATCH 7/7] add gc-sections to TPL boot Haiying.Wang at freescale.com
2011-01-28 17:36   ` Scott Wood
2011-01-28 18:08     ` Haiying Wang
2011-01-28 18:21       ` Albert ARIBAUD
2011-01-28 18:30       ` Scott Wood
2011-01-28 18:46         ` Haiying Wang
2011-01-28 18:58           ` Scott Wood
2011-01-28 19:07           ` Haiying Wang
2011-01-28 19:12             ` Scott Wood
     [not found] ` <1296190690-21146-3-git-send-email-Haiying.Wang@freescale.c om>
2011-01-28 10:02   ` [U-Boot] [PATCH 5/8 v3] P1021: add P1021MDS board support Fabian Cenedese
2011-01-28 14:43     ` Haiying Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com \
    --to=haiying.wang@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.