Skip to contentSkip to conversation

vexpress64: use 2nd DRAM bank only on juno

PATCH New Ryan Harkin 2 participants 3 messages Oct 23, 2015 – Oct 26, 2015 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vexpress64: use 2nd DRAM bank only on juno

This patch makes the 2nd DRAM bank available on Juno only and not on other vexpress64 targets, eg. the FVP models.

The commit below added a 2nd bank of NOR flash for Juno, but also for all vexpress64 targets:

commit 2d0cee1ca2b9d977fa3214896bb2e30cfec77059
Author: Liviu Dudau <[email protected]>
Date: Mon Oct 19 11:08:31 2015 +0100

vexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.

Juno comes with 8GB RAM, but U-Boot only passes 2GB to the kernel. Declare a secondary memory bank and set the sizes correctly.

Unfortunately, I only fully tested on Juno R0, R1 and the FVP Foundation model. Whilst FVP Base AEMV8 models run U-Boot OK, they fail to boot the kernel.

---
 board/armltd/vexpress64/vexpress64.c |  2 ++
 include/configs/vexpress_aemv8a.h    | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
board/armltd/vexpress64/vexpress64.c +2 -0
index f4e8084..22d7e6c 100644
@@ -44,8 +44,10 @@ void dram_init_banksize(void)
 {
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+#ifdef PHYS_SDRAM_2
 	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
 	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+#endif
 }
 
 /*
include/configs/vexpress_aemv8a.h +10 -3
index 0f2f1a3..18ab915 100644
@@ -168,15 +168,22 @@
 #define CONFIG_SYS_LOAD_ADDR		(V2M_BASE + 0x10000000)
 
 /* Physical Memory Map */
-#define CONFIG_NR_DRAM_BANKS		2
 #define PHYS_SDRAM_1			(V2M_BASE)	/* SDRAM Bank #1 */
-#define PHYS_SDRAM_2			(0x880000000)
 /* Top 16MB reserved for secure world use */
 #define DRAM_SEC_SIZE		0x01000000
 #define PHYS_SDRAM_1_SIZE	0x80000000 - DRAM_SEC_SIZE
-#define PHYS_SDRAM_2_SIZE	0x180000000
 #define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM_1
 
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_NR_DRAM_BANKS		2
+#define PHYS_SDRAM_2			(0x880000000)
+#define PHYS_SDRAM_2_SIZE		0x180000000
+#define CONFIG_NR_DRAM_BANKS_LIST	{ PHYS_SDRAM_1 , PHYS_SDRAM_2}
+#else
+#define CONFIG_NR_DRAM_BANKS		1
+#define CONFIG_NR_DRAM_BANKS_LIST	{ PHYS_SDRAM_1 }
+#endif
+
 /* Enable memtest */
 #define CONFIG_CMD_MEMTEST
 #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
Signature · 1 line
2.1.4
maintainer
#1 lore raw

PATCH 1/1 vexpress64: use 2nd DRAM bank only on juno

Quoted 15 lines · Ryan Harkin

This patch makes the 2nd DRAM bank available on Juno only and not on other vexpress64 targets, eg. the FVP models.

The commit below added a 2nd bank of NOR flash for Juno, but also for all vexpress64 targets:

commit 2d0cee1ca2b9d977fa3214896bb2e30cfec77059
Author: Liviu Dudau <[email protected]>
Date: Mon Oct 19 11:08:31 2015 +0100

vexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.

Juno comes with 8GB RAM, but U-Boot only passes 2GB to the kernel. Declare a secondary memory bank and set the sizes correctly.

Quoted 8 lines

Unfortunately, I only fully tested on Juno R0, R1 and the FVP Foundation model. Whilst FVP Base AEMV8 models run U-Boot OK, they fail to boot the kernel.

Hi Ryan,

Thanks for testing this on FVPs. Only a small question on the patch, otherwise:

Best regards,
Liviu

Quoted 34 lines
---
 board/armltd/vexpress64/vexpress64.c |  2 ++
 include/configs/vexpress_aemv8a.h    | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
board/armltd/vexpress64/vexpress64.c +2 -0
index f4e8084..22d7e6c 100644
@@ -44,8 +44,10 @@ void dram_init_banksize(void)
 {
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+#ifdef PHYS_SDRAM_2
 	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
 	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+#endif
 }
 
 /*
include/configs/vexpress_aemv8a.h +0 -2
index 0f2f1a3..18ab915 100644
@@ -168,15 +168,22 @@
 #define CONFIG_SYS_LOAD_ADDR		(V2M_BASE + 0x10000000)
 
 /* Physical Memory Map */
-#define CONFIG_NR_DRAM_BANKS		2
 #define PHYS_SDRAM_1			(V2M_BASE)	/* SDRAM Bank #1 */
-#define PHYS_SDRAM_2			(0x880000000)
 /* Top 16MB reserved for secure world use */

include/configs/vexpress_aemv8a.h line 181

Quoted 10 lines
include/configs/vexpress_aemv8a.h +5 -1
 #define DRAM_SEC_SIZE		0x01000000
 #define PHYS_SDRAM_1_SIZE	0x80000000 - DRAM_SEC_SIZE
-#define PHYS_SDRAM_2_SIZE	0x180000000
 #define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM_1
 
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_NR_DRAM_BANKS		2
+#define PHYS_SDRAM_2			(0x880000000)
+#define PHYS_SDRAM_2_SIZE		0x180000000
+#define CONFIG_NR_DRAM_BANKS_LIST	{ PHYS_SDRAM_1 , PHYS_SDRAM_2}

Here

include/configs/vexpress_aemv8a.h line 184

Quoted 3 lines
include/configs/vexpress_aemv8a.h +3 -0
+#else
+#define CONFIG_NR_DRAM_BANKS		1
+#define CONFIG_NR_DRAM_BANKS_LIST	{ PHYS_SDRAM_1 }

And here. I could not find any other instance of CONFIG_NR_DRAM_BANKS_LIST usage. Is that something that has splilled from Linaro's version?

Best regards,
Liviu

Quoted 8 lines
include/configs/vexpress_aemv8a.h +2 -0
+#endif
+
 /* Enable memtest */
 #define CONFIG_CMD_MEMTEST
 #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
Signature · 1 line
2.1.4
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?
#2 lore raw

PATCH 1/1 vexpress64: use 2nd DRAM bank only on juno

Quoted 81 lines · Liviu Dudau
Quoted 15 lines · Ryan Harkin

This patch makes the 2nd DRAM bank available on Juno only and not on other vexpress64 targets, eg. the FVP models.

The commit below added a 2nd bank of NOR flash for Juno, but also for all vexpress64 targets:

commit 2d0cee1ca2b9d977fa3214896bb2e30cfec77059
Author: Liviu Dudau <[email protected]>
Date: Mon Oct 19 11:08:31 2015 +0100

vexpress64: Juno: Declare all 8GB of RAM and make them visible to the kernel.

Juno comes with 8GB RAM, but U-Boot only passes 2GB to the kernel. Declare a secondary memory bank and set the sizes correctly.

Quoted 8 lines

Unfortunately, I only fully tested on Juno R0, R1 and the FVP Foundation model. Whilst FVP Base AEMV8 models run U-Boot OK, they fail to boot the kernel.

Hi Ryan,

Thanks for testing this on FVPs. Only a small question on the patch, otherwise:

Best regards,
Liviu

Quoted 34 lines
---
 board/armltd/vexpress64/vexpress64.c |  2 ++
 include/configs/vexpress_aemv8a.h    | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
board/armltd/vexpress64/vexpress64.c +2 -0
index f4e8084..22d7e6c 100644
@@ -44,8 +44,10 @@ void dram_init_banksize(void)
 {
      gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
      gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+#ifdef PHYS_SDRAM_2
      gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
      gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+#endif
 }
 
 /*
include/configs/vexpress_aemv8a.h +0 -2
index 0f2f1a3..18ab915 100644
@@ -168,15 +168,22 @@
 #define CONFIG_SYS_LOAD_ADDR         (V2M_BASE + 0x10000000)
 
 /* Physical Memory Map */
-#define CONFIG_NR_DRAM_BANKS         2
 #define PHYS_SDRAM_1                 (V2M_BASE)      /* SDRAM Bank #1 */
-#define PHYS_SDRAM_2                 (0x880000000)
 /* Top 16MB reserved for secure world use */

include/configs/vexpress_aemv8a.h line 181

Quoted 10 lines
include/configs/vexpress_aemv8a.h +5 -1
 #define DRAM_SEC_SIZE                0x01000000
 #define PHYS_SDRAM_1_SIZE    0x80000000 - DRAM_SEC_SIZE
-#define PHYS_SDRAM_2_SIZE    0x180000000
 #define CONFIG_SYS_SDRAM_BASE        PHYS_SDRAM_1
 
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_NR_DRAM_BANKS         2
+#define PHYS_SDRAM_2                 (0x880000000)
+#define PHYS_SDRAM_2_SIZE            0x180000000
+#define CONFIG_NR_DRAM_BANKS_LIST    { PHYS_SDRAM_1 , PHYS_SDRAM_2}

Here

Quoted 6 lines

include/configs/vexpress_aemv8a.h line 184

Quoted 3 lines
include/configs/vexpress_aemv8a.h +3 -0
+#else
+#define CONFIG_NR_DRAM_BANKS         1
+#define CONFIG_NR_DRAM_BANKS_LIST    { PHYS_SDRAM_1 }

And here. I could not find any other instance of CONFIG_NR_DRAM_BANKS_LIST usage. Is that something that has splilled from Linaro's version?

Ooops, yes, this is a mistake.

I originally changed vexpress.c to use a list of DRAM banks, a bit like the NOR banks code, but then I realised that I was adding unnecessary complexity to the code when a simple check for PHYS_SDRAM_2 was sufficient.

I'll respin without those two defines.

Quoted 22 lines

Best regards,
Liviu

Quoted 8 lines
include/configs/vexpress_aemv8a.h +2 -1
+#endif
+
 /* Enable memtest */
 #define CONFIG_CMD_MEMTEST
 #define CONFIG_SYS_MEMTEST_START     PHYS_SDRAM_1
--

2.1.4

--
====================

| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?