Re: [U-Boot] [PATCH] armv8/ls1043aqds: Add support for >2GB memory

2016-01-27 Thread york sun
On 01/03/2016 07:12 PM, shh@gmail.com wrote:
> From: Shaohui Xie 
> 
> This patch also exposes the complete DDR region(s) to Linux.
> 
> Signed-off-by: Shaohui Xie 
> ---
>  board/freescale/ls1043aqds/ddr.c| 19 ---
>  board/freescale/ls1043aqds/ls1043aqds.c | 10 ++
>  include/configs/ls1043aqds.h|  2 +-
>  3 files changed, 27 insertions(+), 4 deletions(-)

Applied to u-boot-fsl-qoriq master. Awaiting upstream.

Thanks.

York


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] armv8/ls1043aqds: Add support for >2GB memory

2016-01-04 Thread shh.xie
From: Shaohui Xie 

This patch also exposes the complete DDR region(s) to Linux.

Signed-off-by: Shaohui Xie 
---
 board/freescale/ls1043aqds/ddr.c| 19 ---
 board/freescale/ls1043aqds/ls1043aqds.c | 10 ++
 include/configs/ls1043aqds.h|  2 +-
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/board/freescale/ls1043aqds/ddr.c b/board/freescale/ls1043aqds/ddr.c
index 42d9068..3d3c533 100644
--- a/board/freescale/ls1043aqds/ddr.c
+++ b/board/freescale/ls1043aqds/ddr.c
@@ -132,9 +132,22 @@ void dram_init_banksize(void)
 * The address needs to add the offset of its bank.
 */
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
-   gd->bd->bi_dram[0].size = gd->ram_size;
+   if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) {
+   gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE;
+   gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE;
+   gd->bd->bi_dram[1].size = gd->ram_size -
+ CONFIG_SYS_DDR_BLOCK1_SIZE;
 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
-   gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
-   gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
+   gd->secure_ram = gd->bd->bi_dram[1].start +
+gd->secure_ram -
+CONFIG_SYS_DDR_BLOCK1_SIZE;
+   gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
 #endif
+   } else {
+   gd->bd->bi_dram[0].size = gd->ram_size;
+#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
+   gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
+   gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
+#endif
+   }
 }
diff --git a/board/freescale/ls1043aqds/ls1043aqds.c 
b/board/freescale/ls1043aqds/ls1043aqds.c
index d6696ca..576fa46 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -303,6 +303,16 @@ int board_init(void)
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
+   u64 base[CONFIG_NR_DRAM_BANKS];
+   u64 size[CONFIG_NR_DRAM_BANKS];
+
+   /* fixup DT for the two DDR banks */
+   base[0] = gd->bd->bi_dram[0].start;
+   size[0] = gd->bd->bi_dram[0].size;
+   base[1] = gd->bd->bi_dram[1].start;
+   size[1] = gd->bd->bi_dram[1].size;
+
+   fdt_fixup_memory_banks(blob, base, size, 2);
ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 398f1c3..02247b3 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -33,7 +33,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_DIMM_SLOTS_PER_CTLR 1
 /* Physical Memory Map */
 #define CONFIG_CHIP_SELECTS_PER_CTRL   4
-#define CONFIG_NR_DRAM_BANKS   1
+#define CONFIG_NR_DRAM_BANKS   2
 
 #define CONFIG_DDR_SPD
 #define SPD_EEPROM_ADDRESS 0x51
-- 
2.1.0.27.g96db324

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot