Skip to contentSkip to conversation

i.MX31: Fix Litekit board to use new ARM relocation support.

PATCH New Magnus Lilja 2 participants 4 messages Oct 16, 2010 – Oct 19, 2010 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i.MX31: Fix Litekit board to use new ARM relocation support.

Tested on hardware. Boots Linux nicely.

---
 board/logicpd/imx31_litekit/config.mk       |    2 +-
 board/logicpd/imx31_litekit/imx31_litekit.c |   10 ++++++++--
 include/configs/imx31_litekit.h             |    7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
board/logicpd/imx31_litekit/config.mk +1 -1
index d34dc02..a12c182 100644
@@ -1 +1 @@
-TEXT_BASE = 0x87f00000
+TEXT_BASE = 0xa0000000
board/logicpd/imx31_litekit/imx31_litekit.c +8 -2
index 2ac622d..a07ba0e 100644
@@ -31,12 +31,18 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init (void)
 {
-	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+	gd->ram_size = PHYS_SDRAM_1_SIZE;
 
 	return 0;
 }
 
+void
+dram_init_banksize (void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+}
+
 int board_init (void)
 {
 	__REG(CSCR_U(0)) = 0x0000cf03; /* CS0: Nor Flash */
include/configs/imx31_litekit.h +7 -0
index 4904856..c21d74e 100644
@@ -147,6 +147,13 @@
 #define PHYS_SDRAM_1		CSD0_BASE
 #define PHYS_SDRAM_1_SIZE	(128 * 1024 * 1024)
 
+#undef CONFIG_SYS_ARM_WITHOUT_RELOC
+#define CONFIG_SYS_SDRAM_BASE		CSD0_BASE
+#define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
+#define CONFIG_SYS_INIT_RAM_END		IRAM_SIZE
+#define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)
+
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
Signature · 1 line
1.6.4.2
#1 lore raw

PATCH 1/1 i.MX31: Fix Litekit board to use new ARM relocation support.

Quoted 4 lines · Magnus Lilja

Tested on hardware. Boots Linux nicely.

---

Hi Magnus,

board/logicpd/imx31_litekit/imx31_litekit.c DECLARE_GLOBAL_DATA_PTR; · line 34

Quoted 7 lines
board/logicpd/imx31_litekit/imx31_litekit.c +1 -2
@@ -31,12 +31,18 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init (void)
 {
-	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+	gd->ram_size = PHYS_SDRAM_1_SIZE;

Any reason to not use get_ram_size() ?

Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 i.MX31: Fix Litekit board to use new ARM relocation support.

Hi Stefano,

Quoted 10 lines · Stefano Babic
Quoted 4 lines · Magnus Lilja

Tested on hardware. Boots Linux nicely.

---

Hi Magnus,

Quoted 2 lines
(quoted diff) +0 -0
@@ -31,12 +31,18 @@ DECLARE_GLOBAL_DATA_PTR;
 
Quoted 7 lines

board/logicpd/imx31_litekit/imx31_litekit.c DECLARE_GLOBAL_DATA_PTR; · line 34

Quoted 5 lines
board/logicpd/imx31_litekit/imx31_litekit.c +1 -2
 int dram_init (void)
 {
-	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+	gd->ram_size = PHYS_SDRAM_1_SIZE;

Any reason to not use get_ram_size() ?

Yes, lowlevel_init.S for the litekit board doesn't support autodetection of ram size. I suppose the SDRAM controller needs to be reprogrammed with the actual ool/row settings depending on the RAM size.

Also, I prefer making one change in each patch so this patch updates the Litekit board to use the new relocation stuff.

Regards, Magnus

#3 lore raw

PATCH 1/1 i.MX31: Fix Litekit board to use new ARM relocation support.

In reply to Magnus Lilja
Quoted 8 lines · Magnus Lilja

Tested on hardware. Boots Linux nicely.

---
 board/logicpd/imx31_litekit/config.mk       |    2 +-
 board/logicpd/imx31_litekit/imx31_litekit.c |   10 ++++++++--
 include/configs/imx31_litekit.h             |    7 +++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================