mx6sxsabresd: Avoid hardcoded RAM size
authorVanessa Maegima <vanessa.maegima@nxp.com>
Thu, 9 Jun 2016 18:28:33 +0000 (15:28 -0300)
committerStefano Babic <sbabic@denx.de>
Tue, 12 Jul 2016 15:58:49 +0000 (17:58 +0200)
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>
board/freescale/mx6sxsabresd/mx6sxsabresd.c
include/configs/mx6sxsabresd.h

index 25e009ee9bcbe26f11b5f5f4be8824d56fb7dff7..8d95c51aaf83db54b8df51063ce40e0cc8ccc7c6 100644 (file)
@@ -64,7 +64,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-       gd->ram_size = PHYS_SDRAM_SIZE;
+       gd->ram_size = imx_ddr_size();
 
        return 0;
 }
index 183a7595cbebeba11077de26932443c8313ee56d..9281fee5f9ff35d371b4d873b5f014d0a5bb9c76 100644 (file)
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS           1
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
-#define PHYS_SDRAM_SIZE                        SZ_1G
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR