From 510f794c894321fe65e62bb6fd9f21fa2569dcec Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 00:42:28 +0000
Subject: [PATCH 1/6] pm9g45: ARM relocation support

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 board/ronetix/pm9g45/config.mk | 1 -
 board/ronetix/pm9g45/pm9g45.c  | 9 ++++++++-
 include/configs/pm9g45.h       | 6 ++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
 delete mode 100644 board/ronetix/pm9g45/config.mk

diff --git a/board/ronetix/pm9g45/config.mk b/board/ronetix/pm9g45/config.mk
deleted file mode 100644
index 9d3c5ae..0000000
--- a/board/ronetix/pm9g45/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x73f00000
diff --git a/board/ronetix/pm9g45/pm9g45.c b/board/ronetix/pm9g45/pm9g45.c
index f3d48f2..79b7c9d 100644
--- a/board/ronetix/pm9g45/pm9g45.c
+++ b/board/ronetix/pm9g45/pm9g45.c
@@ -159,9 +159,16 @@ int board_init(void)
 
 int dram_init(void)
 {
+	/* dram_init must store complete ramsize in gd->ram_size */
+	gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM,
+				PHYS_SDRAM_SIZE);
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
 	gd->bd->bi_dram[0].start = PHYS_SDRAM;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
-	return 0;
 }
 
 #ifdef CONFIG_RESET_PHY_R
diff --git a/include/configs/pm9g45.h b/include/configs/pm9g45.h
index 3ed6b56..8822012 100644
--- a/include/configs/pm9g45.h
+++ b/include/configs/pm9g45.h
@@ -39,6 +39,8 @@
 /* ARM asynchronous clock */
 #define CONFIG_SYS_AT91_MAIN_CLOCK	12000000 /* from 12 MHz crystal */
 #define CONFIG_SYS_HZ			1000
+#define CONFIG_SYS_TEXT_BASE	0x73f00000
+#define CONFIG_AT91FAMILY
 
 #define CONFIG_ARCH_CPU_INIT
 
@@ -175,6 +177,10 @@
 #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024,\
 					0x1000)
 
+#define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM
+#define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+				GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_STACKSIZE		(32*1024)	/* regular stack */
 
 #ifdef CONFIG_USE_IRQ

From 37ee3ccce77a5ff8b791d61b04931385af015f99 Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 12:42:38 +0200
Subject: [PATCH 2/6] pm9g45: enable cache command

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 include/configs/pm9g45.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/pm9g45.h b/include/configs/pm9g45.h
index 8822012..ec51ccf 100644
--- a/include/configs/pm9g45.h
+++ b/include/configs/pm9g45.h
@@ -81,6 +81,7 @@
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_IMLS
 
+#define CONFIG_CMD_CACHE
 #define CONFIG_CMD_PING		1
 #define CONFIG_CMD_DHCP		1
 #define CONFIG_CMD_NAND		1

From 9a2a05a4a3674be55fe28b130112754395a43c7a Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 12:41:59 +0200
Subject: [PATCH 3/6] pm9263: ARM relocation support

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 board/ronetix/pm9263/config.mk | 1 -
 board/ronetix/pm9263/pm9263.c  | 9 ++++++++-
 include/configs/pm9263.h       | 6 ++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
 delete mode 100644 board/ronetix/pm9263/config.mk

diff --git a/board/ronetix/pm9263/config.mk b/board/ronetix/pm9263/config.mk
deleted file mode 100644
index e554a45..0000000
--- a/board/ronetix/pm9263/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x23f00000
diff --git a/board/ronetix/pm9263/pm9263.c b/board/ronetix/pm9263/pm9263.c
index 4dc0237..ec9f865 100644
--- a/board/ronetix/pm9263/pm9263.c
+++ b/board/ronetix/pm9263/pm9263.c
@@ -378,9 +378,16 @@ int board_init(void)
 
 int dram_init(void)
 {
+	/* dram_init must store complete ramsize in gd->ram_size */
+	gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM,
+				PHYS_SDRAM_SIZE);
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
 	gd->bd->bi_dram[0].start = PHYS_SDRAM;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
-	return 0;
 }
 
 #ifdef CONFIG_RESET_PHY_R
diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index 619af2d..c9e7489 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -44,6 +44,8 @@
 #define CONFIG_PM9263		1	/* on a Ronetix PM9263 Board	*/
 #define CONFIG_ARCH_CPU_INIT
 #undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
+#define CONFIG_SYS_TEXT_BASE	0
+#define CONFIG_AT91FAMILY
 
 /* clocks */
 #define CONFIG_SYS_MOR_VAL						\
@@ -401,6 +403,10 @@
  */
 #define CONFIG_SYS_MALLOC_LEN	ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 0x1000)
 
+#define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM
+#define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+				GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_STACKSIZE		(32 * 1024)	/* regular stack */
 
 #ifdef CONFIG_USE_IRQ

From 6e110d295f70cc0821eedcce2adc67dd0f15d5f6 Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 12:42:09 +0200
Subject: [PATCH 4/6] pm9263: enable cache command

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 include/configs/pm9263.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index c9e7489..96e12f2 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -214,6 +214,7 @@
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
 
+#define CONFIG_CMD_CACHE
 #define CONFIG_CMD_PING		1
 #define CONFIG_CMD_DHCP		1
 #define CONFIG_CMD_NAND		1

From 4f81bf4368ced9b0469e1b387637d01cc510dba6 Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 12:41:30 +0200
Subject: [PATCH 5/6] pm9261: ARM relocation support

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 board/ronetix/pm9261/config.mk | 1 -
 board/ronetix/pm9261/pm9261.c  | 9 ++++++++-
 include/configs/pm9261.h       | 6 ++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
 delete mode 100644 board/ronetix/pm9261/config.mk

diff --git a/board/ronetix/pm9261/config.mk b/board/ronetix/pm9261/config.mk
deleted file mode 100644
index 975522a..0000000
--- a/board/ronetix/pm9261/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x23f00000
\ No newline at end of file
diff --git a/board/ronetix/pm9261/pm9261.c b/board/ronetix/pm9261/pm9261.c
index 53d8c48..e0f44dd 100644
--- a/board/ronetix/pm9261/pm9261.c
+++ b/board/ronetix/pm9261/pm9261.c
@@ -281,9 +281,16 @@ int board_eth_init(bd_t *bis)
 
 int dram_init(void)
 {
+	/* dram_init must store complete ramsize in gd->ram_size */
+	gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM,
+				PHYS_SDRAM_SIZE);
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
 	gd->bd->bi_dram[0].start = PHYS_SDRAM;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
-	return 0;
 }
 
 #ifdef CONFIG_RESET_PHY_R
diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index 7fcc9ba..c7f0be9 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -45,6 +45,8 @@
 #define CONFIG_PM9261		1	/* on a Ronetix PM9261 Board	*/
 #define CONFIG_ARCH_CPU_INIT
 #undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
+#define CONFIG_SYS_TEXT_BASE	0
+#define CONFIG_AT91FAMILY
 
 /* clocks */
 /* CKGR_MOR - enable main osc. */
@@ -370,6 +372,10 @@
 #define CONFIG_SYS_MALLOC_LEN		\
 		ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 0x1000)
 
+#define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM
+#define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
+				GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_STACKSIZE		(32 * 1024)	/* regular stack */
 
 #ifdef CONFIG_USE_IRQ

From 6741b5310f81ae5ae0132ad85b09fb31d6377b6c Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Sun, 12 Dec 2010 12:41:36 +0200
Subject: [PATCH 6/6] pm9261: enable cache command

Signed-off-by: Asen Dimov <dimov@ronetix.at>
---
 include/configs/pm9261.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index c7f0be9..26e5049 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -203,6 +203,7 @@
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
 
+#define CONFIG_CMD_CACHE
 #define CONFIG_CMD_PING		1
 #define CONFIG_CMD_DHCP		1
 #define CONFIG_CMD_NAND		1