public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Yann Vernier <yann.vernier@orsoc.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] cm4008: Fix ROM relocation.
Date: Wed, 4 Jul 2012 15:21:04 +0200	[thread overview]
Message-ID: <4ff54e86.1369980a.7b50.0f12@mx.google.com> (raw)

Changed CONFIG_SYS_TEXT_BASE to actual address (required for
board_init_f) and moved it into cm4008.h, along with a warning that it
must match PHYS_FLASH_1 (since lowlevel_init relocates there).

Signed-off-by: Yann Vernier <yann.vernier@orsoc.se>
---
 arch/arm/cpu/arm920t/ks8695/lowlevel_init.S |    9 +++++++--
 board/cm4008/config.mk                      |    1 -
 include/configs/cm4008.h                    |    3 +++
 3 files changed, 10 insertions(+), 3 deletions(-)
 delete mode 100644 board/cm4008/config.mk

diff --git a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
index e9f1227..8986e58 100644
--- a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
+++ b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
@@ -92,11 +92,16 @@ lowlevel_init:
 	 * ram from address 0, and flash at 32MB.
 	 */
 	ldr	r1, =(KS8695_IO_BASE+KS8695_MEM_CTRL0)
+        /* Remap flash memory to 768MB size, such that it covers
+           both 0 (boot) and 512MB (run) regions */
 	ldr	r2, =0xbfc00040
 	str	r2, [r1]		/* large flash map */
-	ldr	pc, =(highflash+0x02000000-0x00f00000)	/* jump to high flash address */
+        /* Relies on PHYS_FLASH_1==CONFIG_SYS_TEXT_BASE */
+	ldr	pc, =(highflash)	/* jump to high flash address */
 highflash:
-	ldr	r2, =0x8fe00040
+        /* Move ROM to high address, and reconfigure to 4MiB size */
+	ldr	r2, =(((PHYS_FLASH_1+0x3f0000)<<(22-16))|  \
+                      (PHYS_FLASH_1>>(16-12))|0x40)
 	str	r2, [r1]		/* remap flash range */
 
 	/*
diff --git a/board/cm4008/config.mk b/board/cm4008/config.mk
deleted file mode 100644
index 0d5923b..0000000
--- a/board/cm4008/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x00f00000
diff --git a/include/configs/cm4008.h b/include/configs/cm4008.h
index 81e4de4..7c2e113 100644
--- a/include/configs/cm4008.h
+++ b/include/configs/cm4008.h
@@ -118,6 +118,9 @@
 
 #define CONFIG_SYS_INIT_SP_ADDR	0x00020000 /* lowest 128k of RAM */
 
+/* CONFIG_SYS_TEXT_BASE and PHYS_FLASH_1 must match for both
+   relocation in lowlevel_init.S and function array in board.c */
+#define CONFIG_SYS_TEXT_BASE    0x02000000
 #define PHYS_FLASH_1		0x02000000 /* Flash Bank #1 */
 #define PHYS_FLASH_SECT_SIZE    0x00020000 /* 128 KB sectors (x1) */
 #define CONFIG_SYS_FLASH_BASE		PHYS_FLASH_1
-- 
1.7.10

             reply	other threads:[~2012-07-04 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 13:21 Yann Vernier [this message]
2012-07-05  9:58 ` [U-Boot] [PATCH 2/3] cm4008: Fix ROM relocation Andreas Bießmann

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=4ff54e86.1369980a.7b50.0f12@mx.google.com \
    --to=yann.vernier@orsoc.se \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox