[U-Boot,4/4] mx7ulp_evk: Use imx_ddr_size()
diff mbox series

Message ID 20190718180425.29472-4-festevam@gmail.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series
  • [U-Boot,1/4] imx: Place imx_ddr_size() into a separate file
Related show

Commit Message

Fabio Estevam July 18, 2019, 6:04 p.m. UTC
Use imx_ddr_size() to retrieve the total DDR size instead
of passing a hardcoded memory size.

imx_ddr_size() calculates the memory size based on the actual
MMDC registers values and is useful to detect misconfigurations,
so switch to this more robust approach.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 board/freescale/mx7ulp_evk/mx7ulp_evk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Oct. 14, 2019, 12:40 p.m. UTC | #1
> Use imx_ddr_size() to retrieve the total DDR size instead
> of passing a hardcoded memory size.
> imx_ddr_size() calculates the memory size based on the actual
> MMDC registers values and is useful to detect misconfigurations,
> so switch to this more robust approach.
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Patch
diff mbox series

diff --git a/board/freescale/mx7ulp_evk/mx7ulp_evk.c b/board/freescale/mx7ulp_evk/mx7ulp_evk.c
index 7527263577..c939514a5f 100644
--- a/board/freescale/mx7ulp_evk/mx7ulp_evk.c
+++ b/board/freescale/mx7ulp_evk/mx7ulp_evk.c
@@ -17,7 +17,7 @@  DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = PHYS_SDRAM_SIZE;
+	gd->ram_size = imx_ddr_size();
 
 	return 0;
 }