From: ying.zhang at freescale.com <ying.zhang@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] powerpc/mpc85xx: support application without resetvec segment in the linker script
Date: Mon, 20 May 2013 14:07:23 +0800 [thread overview]
Message-ID: <1369030048-26130-1-git-send-email-ying.zhang@freescale.com> (raw)
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>
---
README | 5 +++++
arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 14 ++++++++++++++
arch/powerpc/cpu/mpc85xx/u-boot.lds | 8 ++++++++
3 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/README b/README
index 3d81092..ef95e4e 100644
--- a/README
+++ b/README
@@ -3978,6 +3978,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..d595b89 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -26,6 +26,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,9 +75,16 @@ 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
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) :
--
1.7.0.4
next reply other threads:[~2013-05-20 6:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 6:07 ying.zhang at freescale.com [this message]
2013-05-20 6:07 ` [U-Boot] [PATCH 2/6] powerpc/mpc85xx: modify the functionality clear_bss and the end address of the BSS ying.zhang at freescale.com
2013-05-21 19:37 ` Scott Wood
2013-05-22 1:57 ` Zhang Ying-B40530
2013-05-20 6:07 ` [U-Boot] [PATCH 3/6] common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL ying.zhang at freescale.com
2013-05-23 15:36 ` Tom Rini
2013-06-21 20:47 ` [U-Boot] [U-Boot, " Andy Fleming
2013-05-20 6:07 ` [U-Boot] [PATCH 4/6] Makefile: move the common makefile line to public area ying.zhang at freescale.com
2013-05-24 16:04 ` Tom Rini
2013-06-06 8:51 ` Zhang Ying-B40530
2013-06-06 13:41 ` Tom Rini
2013-06-21 20:48 ` [U-Boot] [U-Boot, " Andy Fleming
2013-05-20 6:07 ` [U-Boot] [PATCH 5/6] spl: Make CONFIG_SPL_BUILD contain more functionality ying.zhang at freescale.com
2013-05-21 19:42 ` Scott Wood
2013-05-22 2:15 ` Zhang Ying-B40530
2013-05-22 15:45 ` Scott Wood
2013-05-23 1:26 ` Zhang Ying-B40530
2013-05-28 22:34 ` Scott Wood
2013-05-29 2:11 ` Zhang Ying-B40530
2013-05-29 22:54 ` Scott Wood
2013-05-24 16:07 ` Tom Rini
2013-05-24 16:11 ` Tom Rini
2013-05-24 19:08 ` Scott Wood
2013-05-24 19:18 ` Tom Rini
2013-05-27 7:43 ` Zhang Ying-B40530
2013-05-20 6:07 ` [U-Boot] [PATCH 6/6] powerpc/p1022ds: boot from SD Card with SPL ying.zhang at freescale.com
2013-05-23 2:29 ` Zhang Ying-B40530
2013-06-21 20:46 ` [U-Boot] [U-Boot, 1/6] powerpc/mpc85xx: support application without resetvec segment in the linker script Andy Fleming
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=1369030048-26130-1-git-send-email-ying.zhang@freescale.com \
--to=ying.zhang@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.