Add support to tpl boot and p1021mds board
v2 cover Add support to tpl boot and p1021mds board
This is the second version of patchset to add support of TPL(Tertiary Program
Loader) and P1021MDS board. Compared with the previous version, patch #3 is
splitted into two patches and incorporates the comments from Wolfgang and Mike. Patch#4 has changes based on 2010.12-rc2 release. The other patches remain unchanged.
[PATCH 1/8] powerpc/85xx: do not reloc l2srbar if CONFIG_FLASH_BASE is not defined [PATCH 2/8] 8xxx/ddr: add support to only compute the ddr sdram size [PATCH 3/8 v2] Introduce the Tertiary Program loader
[PATCH 4/8 v2] powerpc/85xx: add TPL_BOOT support
[PATCH 5/8 v2] P1021MDS: add P1021MDS board support
[PATCH 6/8] powerpc/p1021: add more P1021 defines.
[PATCH 7/8] powerpc/85xx: do not initialize QE if QE's firmware is in nand flash [PATCH 8/8] p1021mds: add QE and UEC support
PATCH v2 1/8 powerpc/85xx: do not reloc l2srbar if CONFIG_FLASH_BASE is not defined
From: Haiying Wang <[email protected]>
This fixes the compiling error for the board which doesn't have NOR flash (so CONFIG_FLASH_BASE is not defined)
--- arch/powerpc/cpu/mpc85xx/cpu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -1
@@ -327,7 +327,7 @@ int cpu_init_r(void)if (l2cache->l2ctl & MPC85xx_L2CTL_L2E) {puts ("already enabled" ); l2srbar = l2cache->l2srbar0; -#ifdef CONFIG_SYS_INIT_L2_ADDR +#if defined(CONFIG_SYS_INIT_L2_ADDR ) && defined(CONFIG_SYS_FLASH_BASE )if (l2cache->l2ctl & MPC85xx_L2CTL_L2SRAM_ENTIRE && l2srbar >=CONFIG_SYS_FLASH_BASE ) { l2srbar =CONFIG_SYS_INIT_L2_ADDR ;
Signature · 1 line
1.7.3.1.50.g1e633
Kumar Gala
AppliedPATCH 1/8 powerpc/85xx: do not reloc l2srbar if CONFIG_FLASH_BASE is not defined
Quoted 9 lines · On Dec 1, 2010, at 9:35 AM, <[email protected]>…
From: Haiying Wang <[email protected]>
This fixes the compiling error for the board which doesn't have NOR flash (so
CONFIG_FLASH_BASEis not defined)Signed-off-by Haiying Wang <[email protected]>---
arch/powerpc/cpu/mpc85xx/cpu_init.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)
applied to 85xx
- k
PATCH v2 2/8 8xxx/ddr: add support to only compute the ddr sdram size
In reply to Haiying.Wang at freescale.comFrom: Haiying Wang <[email protected]>
This patch adds fsl_ddr_sdram_size to only calculate the ddr sdram size, in case that the DDR SDRAM is initialized in the 2nd stage uboot and should not be intialized again in the final stage uboot.
--- arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 10 ++++++++- arch/powerpc/cpu/mpc8xxx/ddr/ddr.h | 8 ++++-- arch/powerpc/cpu/mpc8xxx/ddr/main.c | 31 +++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +9 -1
@@ -1176,7 +1176,8 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,fsl_ddr_cfg_regs_t *ddr, const common_timing_params_t *common_dimm, const dimm_params_t *dimm_params, - unsigned int dbw_cap_adj) + unsigned int dbw_cap_adj, + unsigned int size_only) { unsigned int i;unsigned int cas_latency;
@@ -1394,6 +1395,13 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,printf ("CS%d is disabled.\n" , i); } +/* +* In the case we only need to compute the ddr sdram size, we only need +* to set csn registers, so return from here. +*/ +if (size_only) +return 0 ; +set_ddr_eor (ddr, popts);#if !defined(CONFIG_FSL_DDR1 )
arch/powerpc/cpu/mpc8xxx/ddr/ddr.h +5 -3
@@ -1,5 +1,5 @@/* -* Copyright 2008 Freescale Semiconductor, Inc. +* Copyright 2008-2010 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
@@ -55,7 +55,8 @@ typedef struct {#define STEP_ALL 0xFFFextern unsigned long long -fsl_ddr_compute (fsl_ddr_info_t *pinfo,unsigned int start_step); +fsl_ddr_compute (fsl_ddr_info_t *pinfo,unsigned int start_step, +unsigned int size_only);extern const char *step_to_string (unsigned int step);
@@ -64,7 +65,8 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,fsl_ddr_cfg_regs_t *ddr, const common_timing_params_t *common_dimm, const dimm_params_t *dimm_parameters, - unsigned int dbw_capacity_adjust); + unsigned int dbw_capacity_adjust, + unsigned int size_only); extern unsigned int compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params, common_timing_params_t *outpdimm,
arch/powerpc/cpu/mpc8xxx/ddr/main.c +26 -5
@@ -1,5 +1,5 @@/* -* Copyright 2008 Freescale Semiconductor, Inc. +* Copyright 2008-2010 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
@@ -233,7 +233,8 @@ int step_assign_addresses(fsl_ddr_info_t *pinfo, }unsigned long long -fsl_ddr_compute (fsl_ddr_info_t *pinfo,unsigned int start_step) +fsl_ddr_compute (fsl_ddr_info_t *pinfo,unsigned int start_step, +unsigned int size_only) {unsigned int i, j;unsigned int all_controllers_memctl_interleaving =0 ;
@@ -338,7 +339,8 @@ fsl_ddr_compute(fsl_ddr_info_t *pinfo, unsigned int start_step) &pinfo->memctl_opts[i], &ddr_reg[i], &timing_params[i], pinfo->dimm_params[i], - dbw_capacity_adjust[i]); + dbw_capacity_adjust[i], + size_only); }default :
@@ -405,7 +407,7 @@ phys_size_t fsl_ddr_sdram(void)memset (&info,0 ,sizeof (fsl_ddr_info_t));/* Compute it once normally. */ - total_memory =fsl_ddr_compute (&info,STEP_GET_SPD ); + total_memory =fsl_ddr_compute (&info,STEP_GET_SPD ,0 );/* Check for memory controller interleaving. */ memctl_interleaved =0 ;
@@ -430,7 +432,8 @@ phys_size_t fsl_ddr_sdram(void) info.memctl_opts[i].memctl_interleaving =0 ;debug ("Recomputing with memctl_interleaving off.\n" ); total_memory =fsl_ddr_compute (&info, -STEP_ASSIGN_ADDRESSES ); +STEP_ASSIGN_ADDRESSES , +0 ); } }
@@ -477,3 +480,21 @@ phys_size_t fsl_ddr_sdram(void)return total_memory; } + +/* +* fsl_ddr_sdram_size() - This function only returns the size of the total +* memory without setting ddr control registers. +*/ +phys_size_t +fsl_ddr_sdram_size (void ) +{ +fsl_ddr_info_t info; +unsigned long long total_memory =0 ; + +memset (&info,0 ,sizeof (fsl_ddr_info_t)); + +/* Compute it once normally. */ + total_memory =fsl_ddr_compute (&info,STEP_GET_SPD ,1 ); + +return total_memory; +}
Signature · 1 line
1.7.3.1.50.g1e633
Kumar Gala
AppliedPATCH 2/8 8xxx/ddr: add support to only compute the ddr sdram size
Quoted 6 lines · On Dec 1, 2010, at 9:35 AM, <[email protected]>…
From: Haiying Wang <[email protected]>
This patch adds
fsl_ddr_sdram_sizeto only calculate the ddr sdram size, in case that the DDR SDRAM is initialized in the 2nd stage uboot and should not be intialized again in the final stage uboot.
Quoted 6 lines
Signed-off-by Haiying Wang <[email protected]>---
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 10 ++++++++- arch/powerpc/cpu/mpc8xxx/ddr/ddr.h | 8 ++++-- arch/powerpc/cpu/mpc8xxx/ddr/main.c | 31 +++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-)
applied
- k
PATCH v2 3/8 Introduce the Tertiary Program loader
In reply to Haiying.Wang at freescale.comFrom: Haiying Wang <[email protected]>
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.
---
Incorporate Mike's comment to use new variable NAND_SPL_OBJS-y
Makefile | 17 +++++++++++++++-- README | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-)
Makefile +15 -2
@@ -290,6 +290,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
@@ -407,8 +411,15 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all -$(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 +$(TPL_BOOT): $(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_TPL_U_BOOT) += $(obj)tpl/u-boot-tpl.bin +NAND_SPL_OBJS-y += $(obj)u-boot.bin + +$(U_BOOT_NAND): $(NAND_SPL) $(TPL_BOOT) $(obj)u-boot.bin + cat $(NAND_SPL_OBJS-y) > u-boot-nand.bin $(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
@@ -1226,6 +1237,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)
@@ -1250,6 +1262,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 \
README +27 -0
@@ -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: --------------
Signature · 1 line
1.7.3.1.50.g1e633
PATCH v2 3/8 Introduce the Tertiary Program loader
Quoted 10 lines · On Dec 1, 2010, at 9:35 AM, <[email protected]>…
From: Haiying Wang <[email protected]>
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.
Quoted 6 lines
Signed-off-by Haiying Wang <[email protected]>---
Incorporate Mike's comment to use new variable NAND_SPL_OBJS-yMakefile | 17 +++++++++++++++-- README | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-)
Wolfgang,
Did you plan on review this patch?
- k
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Kumar Gala,
Quoted 2 lines · In message <[email protected]> you wrote:
Did you plan on review this patch?
Just done - I wonder if this code has ever been tested at all?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You can observe a lot just by watchin'. - Yogi Berra
PATCH v2 3/8 Introduce the Tertiary Program loader
In reply to Haiying.Wang at freescale.comDear Haiying.Wang at freescale.com,
Quoted 22 lines · In message <[email protected]> you…
From: Haiying Wang <[email protected]>
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 <[email protected]>---
Incorporate Mike's comment to use new variable NAND_SPL_OBJS-yMakefile | 17 +++++++++++++++-- README | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-)Makefile +0
-0
Makefile LDPPFLAGS += \ · line 295
Quoted 6 lines
Makefile +3
-0@@ -290,6 +290,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
I don't understand what the "TPL_BOOT" is good for, or how it's supposed to work.
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 11 lines
Makefile +2
-2ifeq ($(CONFIG_NAND_U_BOOT),y) NAND_SPL = nand_spl U_BOOT_NAND = $(obj)u-boot-nand.bin@@ -407,8 +411,15 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all -$(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 +$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend + $(MAKE) -C tpl/board/$(BOARDDIR) all
Assume CONFIG_TPL_U_BOOT is not defined, then TPL_BOOT is not defined, and this rule will probably cause a build error, doesn't it?
Has this code ever been tested?
And if we use a variable for the "tlp" string, should this not be
... $(MAKE) -C $(TPL_BOOT)/board/$(BOARDDIR) all
??
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 419
Quoted 3 lines
Makefile +3
-0+NAND_SPL_OBJS-y += $(obj)nand_spl/u-boot-spl-16k.bin +NAND_SPL_OBJS-$(CONFIG_TPL_U_BOOT) += $(obj)tpl/u-boot-tpl.bin +NAND_SPL_OBJS-y += $(obj)u-boot.bin
Ditto here and in the following - but how is NAND_SPL related to TPL building? These should be completely independent?
Makefile $(obj)u-boot.lds: $(LDSCRIPT)
Quoted 13 lines
Makefile +13
-0+- 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.
Can we not do with a single variable definition?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Things that try to look like things often do look more like things than things. Well-known fact. - Terry Pratchett, _Wyrd Sisters_
PATCH v2 3/8 Introduce the Tertiary Program loader
Quoted 8 lines · Wolfgang Denk
Quoted 8 lines
Makefile +0
-0@@ -290,6 +290,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')
Quoted 6 lines
Makefile LDPPFLAGS += \ · line 295
Quoted 3 lines
Makefile +3
-0+ifeq ($(CONFIG_TPL_U_BOOT),y) +TPL_BOOT = tpl +endifI don't understand what the "
TPL_BOOT" is good for, or how it's supposed to work.
TPL_BOOT works like NAND_SPL but after NAND_SPL is executed. It is a
middle stage boot loader to balance the 4K nand spl limitation which can
not include ddr spd code and the 256K L2 SRAM size which can not
accommodate the final uboot image on some Freescale Qoriq P1 platforms.
The main purpose of tpl is to initialize the ddr with spd code in l2
sram then load the final uboot image to ddr. The reason to call tpl is
because it runs after spl, the Second Program Loader. My original patch
used CONFIG_MIDDLE_STAGE_SRAM_BOOT but you recommended to use CONFIG_SYS_2ND_STAGE_BOOT(http://lists.denx.de/pipermail/u-boot/2010-August/075653.html). However, 2ND STAGE is not correct here since it runs after SPL.
Quoted 7 lines
Quoted 7 lines
Makefile +0
-0ifeq ($(CONFIG_NAND_U_BOOT),y) NAND_SPL = nand_spl U_BOOT_NAND = $(obj)u-boot-nand.bin@@ -407,8 +411,15 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all
Quoted 7 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 4 lines
Makefile +2
-2-$(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 +$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend + $(MAKE) -C tpl/board/$(BOARDDIR) allAssume
CONFIG_TPL_U_BOOTis not defined, thenTPL_BOOTis not defined, and this rule will probably cause a build error, doesn't it?
No, I don't think there is a build error.
Quoted 1 line
Has this code ever been tested?
Yes, I tested it on P1021MDS board, and also built for other 85xx NAND_config without error.
Quoted 11 lines
... $(MAKE) -C $(TPL_BOOT)/board/$(BOARDDIR) all??
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 419
Quoted 3 lines
Makefile +3
-0+NAND_SPL_OBJS-y += $(obj)nand_spl/u-boot-spl-16k.bin +NAND_SPL_OBJS-$(CONFIG_TPL_U_BOOT) += $(obj)tpl/u-boot-tpl.bin +NAND_SPL_OBJS-y += $(obj)u-boot.binDitto here and in the following - but how is
NAND_SPLrelated to TPL building? These should be completely independent?
It came up with Mike Frysinger's comments
http://lists.denx.de/pipermail/u-boot/2010-November/082373.html . It is applied in the case that the TPL is used with nand spl build. In fact, our another usage of TPL_BOOT is for SPI/SD boot. Patch will come is this set is accepted.
Quoted 6 lines
Quoted 6 lines
Makefile +6
-0+ 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.
Quoted 8 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT)
Quoted 6 lines
Makefile +6
-0+ + 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.Can we not do with a single variable definition?
I did not get it. Could you please give a recommendation?
Thanks.
Haiying
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Haiying Wang,
Quoted 15 lines · In message <1295842861.2196.38.camel@haiying-laptop> you wrote:
Quoted 8 lines · Wolfgang Denk
Quoted 8 lines
Makefile +0
-0@@ -290,6 +290,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')Quoted 6 lines
Makefile LDPPFLAGS += \ · line 295
Quoted 3 lines
Makefile +3
-0+ifeq ($(CONFIG_TPL_U_BOOT),y) +TPL_BOOT = tpl +endifI don't understand what the "
TPL_BOOT" is good for, or how it's supposed to work.
Quoted 4 lines
TPL_BOOTworks likeNAND_SPLbut afterNAND_SPLis executed. It is a middle stage boot loader to balance the 4K nand spl limitation which can not include ddr spd code and the 256K L2 SRAM size which can not accommodate the final uboot image on some Freescale Qoriq P1 platforms.
Yes, I understand what you are atempting to do.
What I do not understand is what the TPL_BOOT variable in the Makefile is good for. I cannot understand the current use.
Quoted 14 lines
The main purpose of tpl is to initialize the ddr with spd code in l2
sram then load the final uboot image to ddr. The reason to call tpl is
because it runs after spl, the Second Program Loader. My original patch
usedCONFIG_MIDDLE_STAGE_SRAM_BOOTbut you recommended to use CONFIG_SYS_2ND_STAGE_BOOT(http://lists.denx.de/pipermail/u-boot/2010-August/075653.html). However, 2ND STAGE is not correct here since it runs after SPL.Quoted 7 lines
Quoted 7 lines
Makefile +0
-0ifeq ($(CONFIG_NAND_U_BOOT),y) NAND_SPL = nand_spl U_BOOT_NAND = $(obj)u-boot-nand.bin@@ -407,8 +411,15 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all
Quoted 8 lines
Quoted 7 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 4 lines
Makefile +2
-2-$(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 +$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend + $(MAKE) -C tpl/board/$(BOARDDIR) allAssume
CONFIG_TPL_U_BOOTis not defined, thenTPL_BOOTis not defined, and this rule will probably cause a build error, doesn't it?No, I don't think there is a build error.
WEell, if CONFIG_TPL_U_BOOT is not 'y', then TPL_BOOT is not defined, which results in this make rule:
: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) all
i. e. there would be no target name befoe the semicolon.
Quoted 2 lines
Quoted 1 line
Has this code ever been tested?
Yes, I tested it on P1021MDS board, and also built for other 85xx
NAND_configwithout error.
Did you run a "MAKEALL ppc", i. e. build for all PPC board, not only NAND booting versions?
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
Makefile +6
-0+ 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.Quoted 8 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT)
Quoted 6 lines
Makefile +6
-0+ + 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.Can we not do with a single variable definition?
Quoted 1 line
I did not get it. Could you please give a recommendation?
Well, I see a pollution with such CONFIG_ settings. I don;t have a solution ready to recommend, but if you can find a way not to define so many different settings for a single purpose that wouldbe great.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction which doesn't work.
PATCH v2 3/8 Introduce the Tertiary Program loader
Quoted 15 lines · On Mon, 24 Jan 2011 13:49:19 +0100 Wolfgang Denk <[email protected]> wrote:
Quoted 15 lines
Quoted 14 lines
README FIT uImage format: · line 2137
Quoted 12 lines
README +12
-0+ 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.Can we not do with a single variable definition?
Quoted 5 lines
Quoted 1 line
I did not get it. Could you please give a recommendation?
Well, I see a pollution with such
CONFIG_settings. I don;t have a solution ready to recommend, but if you can find a way not to define so many different settings for a single purpose that wouldbe great.
They mean different things. We can't "do with a single variable definition" in the current NAND SPL. Why would TPL be any different?
Now, the naming could be clearer. Changing CONFIG_TPL_BOOT into CONFIG_TPL would make it look more like the existing SPL names. Or we could do something like:
CONFIG_HAS_SPL /* set in all of U-Boot when an SPL is used */ CONFIG_IN_SPL /* set only when building the SPL */ CONFIG_HAS_TPL /* set in all of U-Boot when a TPL is used */ CONFIG_IN_TPL /* set only when building the TPL */
-Scott
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Scott Wood,
Quoted 9 lines · In message <[email protected]> you wrote:
Now, the naming could be clearer. Changing
CONFIG_TPL_BOOTintoCONFIG_TPLwould make it look more like the existing SPL names. Or we could do something like:CONFIG_HAS_SPL /* set in all of U-Boot when an SPL is used */ CONFIG_IN_SPL /* set only when building the SPL */ CONFIG_HAS_TPL /* set in all of U-Boot when a TPL is used */ CONFIG_IN_TPL /* set only when building the TPL */
I like that much better.
Thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The moral of the story is: "Don't stop to tighten your shoe laces
during the Olympics 100m finals".
- Kevin Jones in <[email protected]>PATCH v2 3/8 Introduce the Tertiary Program loader
In reply to Wolfgang DenkQuoted 12 lines · Wolfgang Denk
Quoted 11 lines
Quoted 7 lines
Makefile LDPPFLAGS += \ · line 295
Quoted 4 lines
Makefile +3
-0+ifeq ($(CONFIG_TPL_U_BOOT),y) +TPL_BOOT = tpl +endifI don't understand what the "
TPL_BOOT" is good for, or how it's supposed to work.
TPL_BOOTworks likeNAND_SPLbut afterNAND_SPLis executed. It is a middle stage boot loader to balance the 4K nand spl limitation which can not include ddr spd code and the 256K L2 SRAM size which can not accommodate the final uboot image on some Freescale Qoriq P1 platforms.
Quoted 4 lines
Yes, I understand what you are atempting to do.
What I do not understand is what the
TPL_BOOTvariable in theMakefileis good for. I cannot understand the current use.
Well, it was used to generate the tpl image under tpl/ directory. Maybe TPL_BOOT is a bad name here, I just thought it was too simple to use TPL.
Quoted 23 lines
Quoted 14 lines
The main purpose of tpl is to initialize the ddr with spd code in l2
sram then load the final uboot image to ddr. The reason to call tpl is
because it runs after spl, the Second Program Loader. My original patch
usedCONFIG_MIDDLE_STAGE_SRAM_BOOTbut you recommended to use CONFIG_SYS_2ND_STAGE_BOOT(http://lists.denx.de/pipermail/u-boot/2010-August/075653.html). However, 2ND STAGE is not correct here since it runs after SPL.Quoted 7 lines
Quoted 7 lines
ifeq ($(CONFIG_NAND_U_BOOT),y)
NAND_SPL=nand_spl
U_BOOT_NAND= $(obj)u-boot-nand.binMakefile +0
-0@@ -407,8 +411,15 @@ $(obj)u-boot.lds: $(LDSCRIPT) $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) allQuoted 8 lines
Quoted 7 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 4 lines
Makefile +2
-2-$(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 +$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend + $(MAKE) -C tpl/board/$(BOARDDIR) allAssume
CONFIG_TPL_U_BOOTis not defined, thenTPL_BOOTis not defined, and this rule will probably cause a build error, doesn't it?No, I don't think there is a build error.
Quoted 7 lines
WEell, if
CONFIG_TPL_U_BOOTis not 'y', thenTPL_BOOTis not defined, which results in this make rule:: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) alli. e. there would be no target name befoe the semicolon.
If TPL_BOOT here is not defined, the reset(after semicolon) will not be executed, just like NAND_SPL and ONENAND_IPL etc.
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Has this code ever been tested?
Yes, I tested it on P1021MDS board, and also built for other 85xx
NAND_configwithout error.Did you run a "MAKEALL ppc", i. e. build for all PPC board, not only NAND booting versions?
No, I didn't. I will do it and let you know. But I did pass the build for other 85xx non-nand booting version.
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
README FIT uImage format: · line 2137
Quoted 12 lines
README +12
-0+ 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.Can we not do with a single variable definition?
Quoted 6 lines
Quoted 1 line
I did not get it. Could you please give a recommendation?
Well, I see a pollution with such
CONFIG_settings. I don;t have a solution ready to recommend, but if you can find a way not to define so many different settings for a single purpose that wouldbe great.
Will apply Scott's recommendation.
Thanks.
Haiying
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Haiying Wang,
Quoted 5 lines · In message <1295906076.2051.127.camel@haiying-laptop> you wrote:
Quoted 3 lines
What I do not understand is what the
TPL_BOOTvariable in theMakefileis good for. I cannot understand the current use.Well, it was used to generate the tpl image under tpl/ directory. Maybe
TPL_BOOTis a bad name here, I just thought it was too simple to use TPL.
It's not the name. But you use it ina few places here, buth then hard encode "tpl" in a number of other paces there. Which means that you cannot change TPL_BOOT to any other value, or building would break. So why do we need this variable?
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 2 lines
+$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend
Makefile +1
-0+ $(MAKE) -C tpl/board/$(BOARDDIR) allAssume
CONFIG_TPL_U_BOOTis not defined, thenTPL_BOOTis not defined, and this rule will probably cause a build error, doesn't it?No, I don't think there is a build error.
Quoted 8 lines
Quoted 7 lines
WEell, if
CONFIG_TPL_U_BOOTis not 'y', thenTPL_BOOTis not defined, which results in this make rule:: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) alli. e. there would be no target name befoe the semicolon.
If
TPL_BOOThere is not defined, the reset(after semicolon) will not be executed, just likeNAND_SPLandONENAND_IPLetc.
Sorry, I cannot follow - which reset? which semicolon?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Quantum Mechanics is God's version of "Trust me."
PATCH v2 3/8 Introduce the Tertiary Program loader
Quoted 7 lines · Wolfgang Denk
Dear Haiying Wang,
Quoted 4 lines · In message <1295906076.2051.127.camel@haiying-laptop> you wrote:
Quoted 3 lines
What I do not understand is what the
TPL_BOOTvariable in theMakefileis good for. I cannot understand the current use.
Quoted 6 lines
Quoted 1 line
Well, it was used to generate the tpl image under tpl/ directory. Maybe
TPL_BOOTis a bad name here, I just thought it was too simple to use TPL.It's not the name. But you use it ina few places here, buth then hard encode "tpl" in a number of other paces there. Which means that you cannot change
TPL_BOOTto any other value, or building would break. So why do we need this variable?
It follows the same usage of NAND_SPL.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 5 lines
Makefile $(obj)u-boot.lds: $(LDSCRIPT) · line 415
Quoted 2 lines
+$(TPL_BOOT): $(TIMESTAMP_FILE) $(VERSION_FILE) depend
Makefile +1
-0+ $(MAKE) -C tpl/board/$(BOARDDIR) allAssume
CONFIG_TPL_U_BOOTis not defined, thenTPL_BOOTis not defined, and this rule will probably cause a build error, doesn't it?No, I don't think there is a build error.
WEell, if
CONFIG_TPL_U_BOOTis not 'y', thenTPL_BOOTis not defined, which results in this make rule:
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) alli. e. there would be no target name befoe the semicolon.
If
TPL_BOOThere is not defined, the reset(after semicolon) will not be executed, just likeNAND_SPLandONENAND_IPLetc.Sorry, I cannot follow - which reset? which semicolon?
Sorry, :%s/reset/rest/. The semicolon is the same one in your previous comments. I meant the part:
: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) all
If it is as you thought, then how the platforms will be built without NAND_SPL or ONENAND_IPL is not defined?
Haiying
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Haiying Wang,
Quoted 6 lines · In message <1295907459.2051.158.camel@haiying-laptop> you wrote:
Quoted 5 lines
It's not the name. But you use it ina few places here, buth then hard encode "tpl" in a number of other paces there. Which means that you cannot change
TPL_BOOTto any other value, or building would break. So why do we need this variable?It follows the same usage of
NAND_SPL.
Ah. I see. Well, so NAND_SPL needs fixing as well :-(
Quoted 6 lines
Quoted 1 line
Sorry, I cannot follow - which reset? which semicolon?
Sorry, :%s/reset/rest/. The semicolon is the same one in your previous comments. I meant the part:
: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) all
Ah, I see what you mean. But that's a colon (':') - a semicolon if a ';'.
Quoted 2 lines
If it is as you thought, then how the platforms will be built without
NAND_SPLorONENAND_IPLis not defined?
I have to admit that I wasnot aware that NAND_SPL was usign all teh same constructs. We should clean all this up.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de For every complex problem, there is a solution that is simple, neat, and wrong. - Mark Twain
PATCH v2 3/8 Introduce the Tertiary Program loader
Quoted 11 lines · On Mon, 24 Jan 2011 23:29:45 +0100 Wolfgang Denk <[email protected]> wrote:
Dear Haiying Wang,
Quoted 6 lines · In message <1295907459.2051.158.camel@haiying-laptop> you wrote:
Quoted 5 lines
It's not the name. But you use it ina few places here, buth then hard encode "tpl" in a number of other paces there. Which means that you cannot change
TPL_BOOTto any other value, or building would break. So why do we need this variable?It follows the same usage of
NAND_SPL.Ah. I see. Well, so
NAND_SPLneeds fixing as well :-(
Agreed, it seems like just hardcoding the target name would work fine, be clearer, and avoid relying on unportable make behavior.
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Sorry, I cannot follow - which reset? which semicolon?
Sorry, :%s/reset/rest/. The semicolon is the same one in your previous comments. I meant the part:
: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C tpl/board/$(BOARDDIR) allAh, I see what you mean. But that's a colon (':') - a semicolon if a ';'.
You called it a semicolon first. :-)
-Scott
PATCH v2 3/8 Introduce the Tertiary Program loader
In reply to Wolfgang DenkDear Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Haiying Wang,
Quoted 6 lines · In message <1295907459.2051.158.camel@haiying-laptop> you wrote:
Quoted 5 lines
It's not the name. But you use it ina few places here, buth then hard encode "tpl" in a number of other paces there. Which means that you cannot change
TPL_BOOTto any other value, or building would break. So why do we need this variable?It follows the same usage of
NAND_SPL.Ah. I see. Well, so
NAND_SPLneeds fixing as well :-(
I fixed the NAND_SPL in this way. If it is OK for you, I will generate the patches accordingly for TPL as well. Thanks.
BTW, the "./MAKEALL powerpc " worked for my previous patch.
Haiying
From: Haiying Wang <[email protected]>
Date: Wed, 26 Jan 2011 16:03:39 -0500
Subject: [PATCH] Fix NAND_SPL in Makefile
--- Makefile | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
Makefile +8 -8
@@ -287,11 +287,6 @@ 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_NAND_U_BOOT),y) -NAND_SPL = nand_spl -U_BOOT_NAND = $(obj)u-boot-nand.bin -endif - ifeq ($(CONFIG_ONENAND_U_BOOT),y) ONENAND_IPL = onenand_ipl U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
@@ -320,7 +315,11 @@ BOARD_SIZE_CHECK = endif # Always append ALL so that arch config.mk's can add custom ones -ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND) +ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_ONENAND) + +ifeq ($(CONFIG_NAND_U_BOOT),y) +ALL += $(obj)u-boot-nand.bin +endif all: $(ALL)
@@ -401,10 +400,11 @@ $(LDSCRIPT): depend $(obj)u-boot.lds: $(LDSCRIPT) $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ -$(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) depend +$(obj)nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk $(MAKE) -C nand_spl/board/$(BOARDDIR) all -$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin + +$(obj)u-boot-nand.bin: $(obj)nand_spl $(obj)u-boot.bin cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin $(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
Signature · 1 line
1.7.3.1.50.g1e633
PATCH v2 3/8 Introduce the Tertiary Program loader
Dear Haiying Wang,
Quoted 4 lines · In message <1296076056.1985.47.camel@haiying-laptop> you wrote:
I fixed the
NAND_SPLin this way. If it is OK for you, I will generate the patches accordingly for TPL as well. Thanks.
BTW, the "./MAKEALL powerpc " worked for my previous patch.
This looks good to me. Thanks a lot.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de CAUTION: The Mass of This Product Contains the Energy Equivalent of 85 Million Tons of TNT per Net Ounce of Weight.