diff mbox

[U-Boot,v2,2/3] mx6sxsabreauto: Avoid hardcoded RAM size

Message ID 1465496913-19741-2-git-send-email-vanessa.maegima@nxp.com
State Accepted
Commit 432a8a55478d431e036e695c3f8b9d9e2536f744
Delegated to: Stefano Babic
Headers show

Commit Message

Vanessa Maegima June 9, 2016, 6:28 p.m. UTC
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.

Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>
---
Changes since v1:
- remove typo in function name

 board/freescale/mx6sxsabreauto/mx6sxsabreauto.c | 2 +-
 include/configs/mx6sxsabreauto.h                | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Fabio Estevam June 9, 2016, 6:32 p.m. UTC | #1
On Thu, Jun 9, 2016 at 3:28 PM, Vanessa Maegima <vanessa.maegima@nxp.com> wrote:
> 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.
>
> Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
diff mbox

Patch

diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
index 886373c..0ba1508 100644
--- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
+++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
@@ -106,7 +106,7 @@  static int port_exp_direction_output(unsigned gpio, int value)
 
 int dram_init(void)
 {
-	gd->ram_size = PHYS_SDRAM_SIZE;
+	gd->ram_size = imx_ddr_size();
 
 	return 0;
 }
diff --git a/include/configs/mx6sxsabreauto.h b/include/configs/mx6sxsabreauto.h
index d771f9d..439579d 100644
--- a/include/configs/mx6sxsabreauto.h
+++ b/include/configs/mx6sxsabreauto.h
@@ -103,7 +103,6 @@ 
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS		1
 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
-#define PHYS_SDRAM_SIZE			SZ_2G
 
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR