[U-Boot] [PATCH] arm: zynq: Wire automatic ddr detection for Zynq and ZynqMP case

Michal Simek michal.simek at xilinx.com
Wed Apr 11 14:13:49 UTC 2018


When static memory configuration is used U-Boot has capability to detect
memory size in setup range. Enable this feature for static
configuration.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 board/xilinx/zynq/board.c    | 3 ++-
 board/xilinx/zynqmp/zynqmp.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 838ac0f4c4ea..2f4679e21135 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -184,7 +184,8 @@ int dram_init(void)
 #else
 int dram_init(void)
 {
-	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+	gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+				    CONFIG_SYS_SDRAM_SIZE);
 
 	zynq_ddrc_init();
 
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 0d1bd5412b16..3c4cf80b233f 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -377,7 +377,8 @@ int dram_init(void)
 #else
 int dram_init(void)
 {
-	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+	gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+				    CONFIG_SYS_SDRAM_SIZE);
 
 	return 0;
 }
-- 
2.17.0



More information about the U-Boot mailing list