Skip to contentSkip to conversation

arm: a320evb: fixes for relocation support

PATCH Superseded ratbert.chuang at gmail.com 2 participants 3 messages Nov 1, 2010 – Jan 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 arm: a320evb: fixes for relocation support

From: Po-Yu Chuang <[email protected]>

- add CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR
- do not update gd->bd in dram_init() because bd is unavailable then

---
 board/faraday/a320evb/a320evb.c |    3 +--
 include/configs/a320evb.h       |   10 +++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)
board/faraday/a320evb/a320evb.c +1 -2
index 85b11b9..b9343e4 100644
@@ -46,8 +46,7 @@ int dram_init(void)
 
 	actual_size = get_ram_size((void *)sdram_base, expected_size);
 
-	gd->bd->bi_dram[0].start = sdram_base;
-	gd->bd->bi_dram[0].size  = actual_size;
+	gd->ram_size = actual_size;
 
 	if (expected_size != actual_size)
 		printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
include/configs/a320evb.h +7 -3
index 0284d40..97bf8b9 100644
@@ -138,15 +138,19 @@
 #define PHYS_SDRAM_1		0x10000000	/* SDRAM Bank #1 */
 #define PHYS_SDRAM_1_SIZE	0x04000000	/* 64 MB */
 
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+					GENERATED_GBL_DATA_SIZE)
+
 /*
  * Load address and memory test area should agree with
  * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself.
  */
-#define CONFIG_SYS_LOAD_ADDR		0x12000000
+#define CONFIG_SYS_LOAD_ADDR		(PHYS_SDRAM_1 + 0x2000000)
 
 /* memtest works on 63 MB in DRAM */
-#define CONFIG_SYS_MEMTEST_START	0x10000000
-#define CONFIG_SYS_MEMTEST_END		0x13F00000
+#define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
+#define CONFIG_SYS_MEMTEST_END		(PHYS_SDRAM_1 + 0x3F00000)
 
 #define CONFIG_SYS_TEXT_BASE		0
 
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH v2 2/2 arm: a320evb: fixes for relocation support

From: Po-Yu Chuang <[email protected]>

* add CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR
* do not update gd->bd in dram_init() because bd is unavailable then
* move CONFIG_SYS_TEXT_BASE from config.mk to a320evb.h
* remove config.mk

---
v2:
rebase
remove config.mk

 board/faraday/a320evb/a320evb.c |    3 +--
 board/faraday/a320evb/config.mk |   35 -----------------------------------
 include/configs/a320evb.h       |   14 ++++++++++----
 3 files changed, 11 insertions(+), 41 deletions(-)
 delete mode 100644 board/faraday/a320evb/config.mk
board/faraday/a320evb/a320evb.c +1 -2
index 85b11b9..b9343e4 100644
@@ -46,8 +46,7 @@ int dram_init(void)
 
 	actual_size = get_ram_size((void *)sdram_base, expected_size);
 
-	gd->bd->bi_dram[0].start = sdram_base;
-	gd->bd->bi_dram[0].size  = actual_size;
+	gd->ram_size = actual_size;
 
 	if (expected_size != actual_size)
 		printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
board/faraday/a320evb/config.mk deleted +0 -35
deleted file mode 100644
index b751d0d..0000000
@@ -1,35 +0,0 @@
-#
-# (C) Copyright 2009 Faraday Technology
-# Po-Yu Chuang <[email protected]>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-# Faraday A320 board with FA526/FA626TE/ARM926EJ-S cpus
-#
-# see http://www.faraday-tech.com/ for more information
-
-# A320 has 1 bank of 64 MB DRAM
-#
-# 1000'0000 to 1400'0000
-#
-# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
-#
-# we load ourself to 13f8'0000
-#
-# download area is 1200'0000
-
-CONFIG_SYS_TEXT_BASE = 0x13f80000
include/configs/a320evb.h +10 -4
index f67cf06..27f137f 100644
@@ -138,15 +138,21 @@
 #define PHYS_SDRAM_1		0x10000000	/* SDRAM Bank #1 */
 #define PHYS_SDRAM_1_SIZE	0x04000000	/* 64 MB */
 
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+					GENERATED_GBL_DATA_SIZE)
+
 /*
  * Load address and memory test area should agree with
  * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself.
  */
-#define CONFIG_SYS_LOAD_ADDR		0x12000000
+#define CONFIG_SYS_LOAD_ADDR		(PHYS_SDRAM_1 + 0x2000000)
 
 /* memtest works on 63 MB in DRAM */
-#define CONFIG_SYS_MEMTEST_START	0x10000000
-#define CONFIG_SYS_MEMTEST_END		0x13F00000
+#define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
+#define CONFIG_SYS_MEMTEST_END		(PHYS_SDRAM_1 + 0x3F00000)
+
+#define CONFIG_SYS_TEXT_BASE		0
 
 /*-----------------------------------------------------------------------
  * Static memory controller configuration
@@ -215,7 +221,7 @@
 
 /* environments */
 #define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR			0x00060000
+#define CONFIG_ENV_ADDR			(PHYS_FLASH_1 + 0x60000)
 #define CONFIG_ENV_SIZE			0x20000
 
 #endif	/* __CONFIG_H */
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH v2 2/2 arm: a320evb: fixes for relocation support

Le 20/12/2010 10:07, Po-Yu Chuang a ?crit :

Quoted 104 lines

From: Po-Yu Chuang<[email protected]>

* add CONFIG_SYS_SDRAM_BASE and CONFIG_SYS_INIT_SP_ADDR
* do not update gd->bd in dram_init() because bd is unavailable then
* move CONFIG_SYS_TEXT_BASE from config.mk to a320evb.h
* remove config.mk

---
v2:
rebase
remove config.mk

  board/faraday/a320evb/a320evb.c |    3 +--
  board/faraday/a320evb/config.mk |   35 -----------------------------------
  include/configs/a320evb.h       |   14 ++++++++++----
  3 files changed, 11 insertions(+), 41 deletions(-)

delete mode 100644 board/faraday/a320evb/config.mk

board/faraday/a320evb/a320evb.c +1 -2
index 85b11b9..b9343e4 100644
@@ -46,8 +46,7 @@ int dram_init(void)
 
  	actual_size = get_ram_size((void *)sdram_base, expected_size);
 
-	gd->bd->bi_dram[0].start = sdram_base;
-	gd->bd->bi_dram[0].size  = actual_size;
+	gd->ram_size = actual_size;
 
  	if (expected_size != actual_size)
  		printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
board/faraday/a320evb/config.mk deleted +0 -35
deleted file mode 100644
index b751d0d..0000000
@@ -1,35 +0,0 @@
-#
-# (C) Copyright 2009 Faraday Technology
-# Po-Yu Chuang<[email protected]>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-# Faraday A320 board with FA526/FA626TE/ARM926EJ-S cpus
-#
-# see http://www.faraday-tech.com/ for more information
-
-# A320 has 1 bank of 64 MB DRAM
-#
-# 1000'0000 to 1400'0000
-#
-# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
-#
-# we load ourself to 13f8'0000
-#
-# download area is 1200'0000
-
-CONFIG_SYS_TEXT_BASE = 0x13f80000
include/configs/a320evb.h +9 -3
index f67cf06..27f137f 100644
@@ -138,15 +138,21 @@
  #define PHYS_SDRAM_1		0x10000000	/* SDRAM Bank #1 */
  #define PHYS_SDRAM_1_SIZE	0x04000000	/* 64 MB */
 
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+					GENERATED_GBL_DATA_SIZE)
+
  /*
   * Load address and memory test area should agree with
   * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself.
   */
-#define CONFIG_SYS_LOAD_ADDR		0x12000000
+#define CONFIG_SYS_LOAD_ADDR		(PHYS_SDRAM_1 + 0x2000000)
 
  /* memtest works on 63 MB in DRAM */
-#define CONFIG_SYS_MEMTEST_START	0x10000000
-#define CONFIG_SYS_MEMTEST_END		0x13F00000
+#define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
+#define CONFIG_SYS_MEMTEST_END		(PHYS_SDRAM_1 + 0x3F00000)
+
+#define CONFIG_SYS_TEXT_BASE		0
 
  /*-----------------------------------------------------------------------
   * Static memory controller configuration

include/configs/a320evb.h line 227

Quoted 8 lines
include/configs/a320evb.h +1 -1
@@ -215,7 +221,7 @@
 
  /* environments */
  #define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR			0x00060000
+#define CONFIG_ENV_ADDR			(PHYS_FLASH_1 + 0x60000)
  #define CONFIG_ENV_SIZE			0x20000
 
  #endif	/* __CONFIG_H */

As this is a fix, applied to u-boot-arm.

Amicalement,

Signature · 1 line
Albert.