Patchwork [U-Boot,01/10,v5] powerpc/mpc85xx: support application without resetvec segment in the linker script

login
register
mail settings
Submitter ying.zhang@freescale.com
Date June 20, 2013, 8:04 a.m.
Message ID <1371715468-21120-1-git-send-email-ying.zhang@freescale.com>
Download mbox | patch
Permalink /patch/252803/
State Superseded
Delegated to: Andy Fleming
Headers show

Comments

ying.zhang@freescale.com - June 20, 2013, 8:04 a.m.
From: Ying Zhang <b40530@freescale.com>

For SD/SPI 2-stage bootloader, the On-Chip Rom code loads the SPL into L2 SRAM,
then jump to it to begin execution. After that, the SPL loads the final uboot
image into DDR, then jump to it to begin execution. The segment .resetvec in
the SPL and in final U-boot is useless.

So, add new symbols CONFIG_SYS_MPC85XX_NO_RESETVEC for this application.
If CONFIG_SYS_MPC85XX_NO_RESETVEC is set, the segment .resetvec is excluded
and the segment .bootpg is placed in the previous 4K of the segment .text.

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
Compared with the original version, Changed as below:
1. Split from "boot from SD card/SPI flash with SPL".
2. No change.
3. No change.
4. No change.

 README                                  |    5 +++++
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |   19 +++++++++++++++----
 arch/powerpc/cpu/mpc85xx/u-boot.lds     |    8 ++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)
Wolfgang Denk - June 21, 2013, 5:36 a.m.
Dear ying.zhang@freescale.com,

In message <1371715468-21120-1-git-send-email-ying.zhang@freescale.com> you wrote:
>
> --- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> +++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> @@ -1,8 +1,5 @@
>  /*
> - * (C) Copyright 2006
> - * Wolfgang Denk, DENX Software Engineering, wd@denx.de
> - *
> - * Copyright 2009 Freescale Semiconductor, Inc.
> + * Copyright 2013 Freescale Semiconductor, Inc.

Please never, ever modify existing copyright headers in any such way!!

You MUST keeep existing entries (unless they are clearly wrong).



NAK!

Best regards,

Wolfgang Denk
Tom Rini - June 27, 2013, 10:01 p.m.
On Fri, Jun 21, 2013 at 07:36:09AM +0200, Wolfgang Denk wrote:
> Dear ying.zhang@freescale.com,
> 
> In message <1371715468-21120-1-git-send-email-ying.zhang@freescale.com> you wrote:
> >
> > --- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> > +++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> > @@ -1,8 +1,5 @@
> >  /*
> > - * (C) Copyright 2006
> > - * Wolfgang Denk, DENX Software Engineering, wd@denx.de
> > - *
> > - * Copyright 2009 Freescale Semiconductor, Inc.
> > + * Copyright 2013 Freescale Semiconductor, Inc.
> 
> Please never, ever modify existing copyright headers in any such way!!
> 
> You MUST keeep existing entries (unless they are clearly wrong).
> 
> 
> 
> NAK!

Please address this NAK and make sure it's not also happening in the
rest of the series.  Thanks!
Andy Fleming - June 27, 2013, 10:16 p.m.
On Thu, Jun 27, 2013 at 5:01 PM, Tom Rini <trini@ti.com> wrote:

> On Fri, Jun 21, 2013 at 07:36:09AM +0200, Wolfgang Denk wrote:
> > Dear ying.zhang@freescale.com,
> >
> > In message <1371715468-21120-1-git-send-email-ying.zhang@freescale.com>
> you wrote:
> > >
> > > --- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> > > +++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
> > > @@ -1,8 +1,5 @@
> > >  /*
> > > - * (C) Copyright 2006
> > > - * Wolfgang Denk, DENX Software Engineering, wd@denx.de
> > > - *
> > > - * Copyright 2009 Freescale Semiconductor, Inc.
> > > + * Copyright 2013 Freescale Semiconductor, Inc.
> >
> > Please never, ever modify existing copyright headers in any such way!!
> >
> > You MUST keeep existing entries (unless they are clearly wrong).
> >
> >
> >
> > NAK!
>
> Please address this NAK and make sure it's not also happening in the
> rest of the series.  Thanks!
>


Unfortunately, this went in with the last batch:

commit 5df572f0131cf5e0abd8ce4e8f57841b790c40d4
Author: Ying Zhang <b40530@freescale.com>
Date:   Mon May 20 14:07:23 2013 +0800

    powerpc/mpc85xx: support application without resetvec segment in the
linker


Fortunately, while the change history on this patch says "No change", the
copyright screwup WAS a change, and does NOT exist in the committed version
of the patch.

Sometimes two wrongs do make a right. :)

Andy

Patch

diff --git a/README b/README
index cd0336c..2a7e4c1 100644
--- a/README
+++ b/README
@@ -4074,6 +4074,11 @@  Low Level (hardware related) configuration options:
 		that is executed before the actual U-Boot. E.g. when
 		compiling a NAND SPL.
 
+- CONFIG_SYS_MPC85XX_NO_RESETVEC
+		Only for 85xx systems. If this variable is specified, the section
+		.resetvec is not kept and the section .bootpg is placed in the
+		previous 4k of the .text section.
+
 - CONFIG_ARCH_MAP_SYSMEM
 		Generally U-Boot (and in particular the md command) uses
 		effective address. It is therefore not necessary to regard
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index f2b7bff..c613e58 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -1,8 +1,5 @@ 
 /*
- * (C) Copyright 2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de
- *
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2013 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -26,6 +23,13 @@ 
 #include "config.h"	/* CONFIG_BOARDDIR */
 
 OUTPUT_ARCH(powerpc)
+#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
+PHDRS
+{
+	text PT_LOAD;
+	bss PT_LOAD;
+}
+#endif
 SECTIONS
 {
 	. = CONFIG_SPL_TEXT_BASE;
@@ -68,10 +72,17 @@  SECTIONS
 #else
 #error unknown NAND controller
 #endif
+#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
+	.bootpg ADDR(.text) - 0x1000 :
+	{
+		KEEP(*(.bootpg))
+	} :text = 0xffff
+#else
 	.resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
 		KEEP(*(.resetvec))
 	} = 0xffff
 
+#endif
 	/*
 	 * Make sure that the bss segment isn't linked at 0x0, otherwise its
 	 * address won't be updated during relocation fixups.
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds
index 0503dce..2643563 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds
@@ -95,6 +95,13 @@  SECTIONS
   . = ALIGN(256);
   __init_end = .;
 
+#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
+  .bootpg ADDR(.text) - 0x1000 :
+  {
+    KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg))
+  } :text = 0xffff
+  . = ADDR(.text) + 0x80000;
+#else
   .bootpg RESET_VECTOR_ADDRESS - 0xffc :
   {
     arch/powerpc/cpu/mpc85xx/start.o	(.bootpg)
@@ -117,6 +124,7 @@  SECTIONS
 #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
   . |= 0x10;
 #endif
+#endif
 
   __bss_start = .;
   .bss (NOLOAD)       :