From patchwork Wed Nov 24 21:25:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiying Wang X-Patchwork-Id: 72947 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C141AB708B for ; Thu, 25 Nov 2010 08:24:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5C0028119; Wed, 24 Nov 2010 22:24:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nH9NOi+1Ds7a; Wed, 24 Nov 2010 22:24:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 370652811B; Wed, 24 Nov 2010 22:24:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 164492811B for ; Wed, 24 Nov 2010 22:24:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ROU4U-zyCvss for ; Wed, 24 Nov 2010 22:24:28 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by theia.denx.de (Postfix) with ESMTPS id 0A1A328119 for ; Wed, 24 Nov 2010 22:24:24 +0100 (CET) Received: from mail7-db3-R.bigfish.com (10.3.81.240) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.8; Wed, 24 Nov 2010 21:24:24 +0000 Received: from mail7-db3 (localhost.localdomain [127.0.0.1]) by mail7-db3-R.bigfish.com (Postfix) with ESMTP id E2C86A884FD for ; Wed, 24 Nov 2010 21:24:23 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h691h668h67dh685h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:az33egw01.freescale.net; RD:az33egw01.freescale.net; EFVD:NLI Received: from mail7-db3 (localhost.localdomain [127.0.0.1]) by mail7-db3 (MessageSwitch) id 1290633863521115_24447; Wed, 24 Nov 2010 21:24:23 +0000 (UTC) Received: from DB3EHSMHS011.bigfish.com (unknown [10.3.81.240]) by mail7-db3.bigfish.com (Postfix) with ESMTP id 7159011E8052 for ; Wed, 24 Nov 2010 21:24:23 +0000 (UTC) Received: from az33egw01.freescale.net (192.88.158.102) by DB3EHSMHS011.bigfish.com (10.3.87.111) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 24 Nov 2010 21:24:20 +0000 Received: from az33smr02.freescale.net (az33smr02.freescale.net [10.64.34.200]) by az33egw01.freescale.net (8.14.3/8.14.3) with ESMTP id oAOLOIEh011474 for ; Wed, 24 Nov 2010 14:24:18 -0700 (MST) Received: from haiying-laptop.am.freescale.net (haiying-laptop.am.freescale.net [10.29.200.208]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id oAOLOHAS003780; Wed, 24 Nov 2010 15:24:18 -0600 (CST) From: To: Date: Wed, 24 Nov 2010 16:25:28 -0500 Message-ID: <1290633928-7270-1-git-send-email-Haiying.Wang@freescale.com> X-Mailer: git-send-email 1.7.3.1.50.g1e633 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] Introduce the Tertiary Program loader X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Haiying Wang 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 is limited to 4K byte. The tpl code will load the final uboot image after ddr is initialized. Signed-off-by: Haiying Wang --- It is used to replace the [PATCH 3/7] Add support for third program loader Makefile | 14 ++++++++++++++ README | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index b4aae89..e561706 100644 --- a/Makefile +++ b/Makefile @@ -287,6 +287,10 @@ LDPPFLAGS += \ $(shell $(LD) --version | \ sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p') +ifeq ($(CONFIG_TPL_U_BOOT),y) +TPL_BOOT = tpl +endif + ifeq ($(CONFIG_NAND_U_BOOT),y) NAND_SPL = nand_spl U_BOOT_NAND = $(obj)u-boot-nand.bin @@ -404,8 +408,16 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all +$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend + $(MAKE) -C tpl/board/$(BOARDDIR) all + +ifeq ($(CONFIG_TPL_U_BOOT),y) +$(U_BOOT_NAND): $(NAND_SPL) $(TPL_BOOT) $(obj)u-boot.bin + cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin +else $(U_BOOT_NAND): $(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 $(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all @@ -1223,6 +1235,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) @@ -1247,6 +1260,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 1acf9a3..53665b0 100644 --- a/README +++ b/README @@ -2108,6 +2108,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_TPL_U_BOOT + + 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_TPL_BOOT + + 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: --------------