Skip to contentSkip to conversation

mx6qsabreauto: Avoid hardcoded RAM size

PATCH New Vanessa Maegima 3 participants 4 messages Jun 8, 2016 – Jun 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx6qsabreauto: Avoid hardcoded RAM size

Instead of passing the total RAM size via PHYS_SDRAM_SIZE option, we should better use imx_ddr_size() function, which automatically determines the RAM size.

---
 board/freescale/mx6qsabreauto/mx6qsabreauto.c | 2 +-
 include/configs/mx6qsabreauto.h               | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
board/freescale/mx6qsabreauto/mx6qsabreauto.c +1 -1
index d63a979..a3ed4cd 100644
@@ -64,7 +64,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
+	gd->ram_size = imx_ddr_size();
 
 	return 0;
 }
include/configs/mx6qsabreauto.h +0 -1
index 6039fc4..200e468 100644
@@ -13,7 +13,6 @@
 #define CONFIG_MXC_UART_BASE	UART4_BASE
 #define CONFIG_CONSOLE_DEV		"ttymxc3"
 #define CONFIG_MMCROOT			"/dev/mmcblk0p2"
-#define PHYS_SDRAM_SIZE		(2u * 1024 * 1024 * 1024)
 
 /* USB Configs */
 #define CONFIG_USB_EHCI
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 mx6qsabreauto: Avoid hardcoded RAM size

Hi Vanessa,

Quoted 15 lines · Vanessa Maegima

Instead of passing the total RAM size via PHYS_SDRAM_SIZE option, we should better use imx_ddr_size() function, which automatically determines the RAM size.

---
 board/freescale/mx6qsabreauto/mx6qsabreauto.c | 2 +-
 include/configs/mx6qsabreauto.h               | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
board/freescale/mx6qsabreauto/mx6qsabreauto.c +0 -0
index d63a979..a3ed4cd 100644

board/freescale/mx6qsabreauto/mx6qsabreauto.c DECLARE_GLOBAL_DATA_PTR; · line 68

Quoted 6 lines
board/freescale/mx6qsabreauto/mx6qsabreauto.c +1 -1
@@ -64,7 +64,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
+	gd->ram_size = imx_ddr_size();
 

Right - this board was not yet updated.

Quoted 8 lines
board/freescale/mx6qsabreauto/mx6qsabreauto.c +0 -0
 	return 0;
 }
include/configs/mx6qsabreauto.h +0 -0
index 6039fc4..200e468 100644

include/configs/mx6qsabreauto.h line 18

Quoted 7 lines
include/configs/mx6qsabreauto.h +0 -1
@@ -13,7 +13,6 @@
 #define CONFIG_MXC_UART_BASE	UART4_BASE
 #define CONFIG_CONSOLE_DEV		"ttymxc3"
 #define CONFIG_MMCROOT			"/dev/mmcblk0p2"
-#define PHYS_SDRAM_SIZE		(2u * 1024 * 1024 * 1024)
 
 /* USB Configs */
 #define CONFIG_USB_EHCI

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 1/1 mx6qsabreauto: Avoid hardcoded RAM size

In reply to Vanessa Maegima
Quoted 6 lines · Vanessa Maegima

Instead of passing the total RAM size via PHYS_SDRAM_SIZE option, we should better use imx_ddr_size() function, which automatically determines the RAM size.

---

Applied to -next, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================