All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] ppc/85xx: Introduce RESET_VECTOR_ADDRESS to handle non-standard link address
Date: Wed,  9 Sep 2009 15:22:35 -0500	[thread overview]
Message-ID: <1252527755-14866-1-git-send-email-galak@kernel.crashing.org> (raw)

Some board ports place TEXT_BASE at a location that would cause the
RESET_VECTOR_ADDRESS not to be at 0xfffffffc when we link.  By default
we assume RESET_VECTOR_ADDRESS will be 0xfffffffc if the board doesn't
explicitly set it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* Updated to add RESET_VECTOR_ADDRESS to top level config.mk to match how we
  handle TEXT_BASE

 board/freescale/mpc8536ds/config.mk |    2 ++
 board/freescale/mpc8572ds/config.mk |    2 ++
 board/freescale/p1_p2_rdb/config.mk |    2 ++
 board/freescale/p2020ds/config.mk   |    2 ++
 config.mk                           |    4 ++++
 cpu/mpc85xx/u-boot.lds              |   10 +++++++---
 6 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/board/freescale/mpc8536ds/config.mk b/board/freescale/mpc8536ds/config.mk
index f030876..c1d0525 100644
--- a/board/freescale/mpc8536ds/config.mk
+++ b/board/freescale/mpc8536ds/config.mk
@@ -26,3 +26,5 @@
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff80000
 endif
+
+RESET_VECTOR_ADDRESS = 0xeffffffc
diff --git a/board/freescale/mpc8572ds/config.mk b/board/freescale/mpc8572ds/config.mk
index 08b61f0..67394c9 100644
--- a/board/freescale/mpc8572ds/config.mk
+++ b/board/freescale/mpc8572ds/config.mk
@@ -26,3 +26,5 @@
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff80000
 endif
+
+RESET_VECTOR_ADDRESS = 0xeffffffc
diff --git a/board/freescale/p1_p2_rdb/config.mk b/board/freescale/p1_p2_rdb/config.mk
index abd64bb..a56b536 100644
--- a/board/freescale/p1_p2_rdb/config.mk
+++ b/board/freescale/p1_p2_rdb/config.mk
@@ -27,3 +27,5 @@
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff80000
 endif
+
+RESET_VECTOR_ADDRESS = 0xeffffffc
diff --git a/board/freescale/p2020ds/config.mk b/board/freescale/p2020ds/config.mk
index 439fa8f..4fcd69c 100644
--- a/board/freescale/p2020ds/config.mk
+++ b/board/freescale/p2020ds/config.mk
@@ -26,3 +26,5 @@
 ifndef TEXT_BASE
 TEXT_BASE = 0xeff80000
 endif
+
+RESET_VECTOR_ADDRESS = 0xeffffffc
diff --git a/config.mk b/config.mk
index 8852157..8cfd60c 100644
--- a/config.mk
+++ b/config.mk
@@ -128,6 +128,10 @@ ifneq ($(TEXT_BASE),)
 CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
 endif
 
+ifneq ($(RESET_VECTOR_ADDRESS),)
+CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
+endif
+
 ifneq ($(OBJTREE),$(SRCTREE))
 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
 endif
diff --git a/cpu/mpc85xx/u-boot.lds b/cpu/mpc85xx/u-boot.lds
index d6e22a7..17753c3 100644
--- a/cpu/mpc85xx/u-boot.lds
+++ b/cpu/mpc85xx/u-boot.lds
@@ -20,6 +20,10 @@
  * MA 02111-1307 USA
  */
 
+#ifndef RESET_VECTOR_ADDRESS
+#define RESET_VECTOR_ADDRESS (0xfffffffc)
+#endif
+
 OUTPUT_ARCH(powerpc)
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
@@ -116,17 +120,17 @@ SECTIONS
   . = ALIGN(256);
   __init_end = .;
 
-  .bootpg ADDR(.text) + 0x7f000 :
+  .bootpg RESET_VECTOR_ADDRESS - 0xffc :
   {
     cpu/mpc85xx/start.o	(.bootpg)
   } :text = 0xffff
 
-  .resetvec ADDR(.text) + 0x7fffc :
+  .resetvec RESET_VECTOR_ADDRESS :
   {
     *(.resetvec)
   } :text = 0xffff
 
-  . = ADDR(.text) + 0x80000;
+  . = RESET_VECTOR_ADDRESS + 0x4;
 
   __bss_start = .;
   .bss (NOLOAD)       :
-- 
1.6.0.6

             reply	other threads:[~2009-09-09 20:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 20:22 Kumar Gala [this message]
2009-09-09 20:47 ` [U-Boot] [PATCH v2] ppc/85xx: Introduce RESET_VECTOR_ADDRESS to handle non-standard link address Wolfgang Denk
2009-09-10  1:58   ` Kumar Gala

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=1252527755-14866-1-git-send-email-galak@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --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.