[U-Boot] [PATCH 1/5] warp: Use imx_ddr_size() for calculating the DDR size

From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- board/warp/warp.c | 2 +- include/configs/warp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/warp/warp.c b/board/warp/warp.c index 49dfdb6..0bc0a6a 100644 --- a/board/warp/warp.c +++ b/board/warp/warp.c @@ -46,7 +46,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; } diff --git a/include/configs/warp.h b/include/configs/warp.h index 4a8e270..12c7c38 100644 --- a/include/configs/warp.h +++ b/include/configs/warp.h @@ -43,7 +43,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE SZ_512M
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR

From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Cc: Heiko Schocher hs@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- board/aristainetos/aristainetos.c | 2 +- include/configs/aristainetos-common.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/aristainetos/aristainetos.c b/board/aristainetos/aristainetos.c index e95ec81..d1e6850 100644 --- a/board/aristainetos/aristainetos.c +++ b/board/aristainetos/aristainetos.c @@ -102,7 +102,7 @@ iomux_v3_cfg_t const usdhc1_pads[] = {
int dram_init(void) { - gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); + gd->ram_size = imx_ddr_size();
return 0; } diff --git a/include/configs/aristainetos-common.h b/include/configs/aristainetos-common.h index d87d40c..640227b 100644 --- a/include/configs/aristainetos-common.h +++ b/include/configs/aristainetos-common.h @@ -17,7 +17,6 @@
#define CONFIG_MACH_TYPE 4501 #define CONFIG_MMCROOT "/dev/mmcblk0p1" -#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (64 * SZ_1M)

Hello Fabio,
Am 23.07.2016 um 18:23 schrieb Fabio Estevam:
From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Cc: Heiko Schocher hs@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
board/aristainetos/aristainetos.c | 2 +- include/configs/aristainetos-common.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
Thanks!
Acked-by: Heiko Schocher hs@denx.de
bye, Heiko
diff --git a/board/aristainetos/aristainetos.c b/board/aristainetos/aristainetos.c index e95ec81..d1e6850 100644 --- a/board/aristainetos/aristainetos.c +++ b/board/aristainetos/aristainetos.c @@ -102,7 +102,7 @@ iomux_v3_cfg_t const usdhc1_pads[] = {
int dram_init(void) {
- gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
gd->ram_size = imx_ddr_size();
return 0; }
diff --git a/include/configs/aristainetos-common.h b/include/configs/aristainetos-common.h index d87d40c..640227b 100644 --- a/include/configs/aristainetos-common.h +++ b/include/configs/aristainetos-common.h @@ -17,7 +17,6 @@
#define CONFIG_MACH_TYPE 4501 #define CONFIG_MMCROOT "/dev/mmcblk0p1" -#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (64 * SZ_1M)

On 23/07/2016 18:23, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Cc: Heiko Schocher hs@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
board/aristainetos/aristainetos.c | 2 +- include/configs/aristainetos-common.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/aristainetos/aristainetos.c b/board/aristainetos/aristainetos.c index e95ec81..d1e6850 100644 --- a/board/aristainetos/aristainetos.c +++ b/board/aristainetos/aristainetos.c @@ -102,7 +102,7 @@ iomux_v3_cfg_t const usdhc1_pads[] = {
int dram_init(void) {
- gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
gd->ram_size = imx_ddr_size();
return 0;
} diff --git a/include/configs/aristainetos-common.h b/include/configs/aristainetos-common.h index d87d40c..640227b 100644 --- a/include/configs/aristainetos-common.h +++ b/include/configs/aristainetos-common.h @@ -17,7 +17,6 @@
#define CONFIG_MACH_TYPE 4501 #define CONFIG_MMCROOT "/dev/mmcblk0p1" -#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (64 * SZ_1M)
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Cc: Martin Donnelly martin.donnelly@ge.com Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- board/ge/bx50v3/bx50v3.c | 2 +- include/configs/ge_bx50v3.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index d45ed44..e9729f8 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -60,7 +60,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; } diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 4de2460..7a54546 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -32,8 +32,6 @@ #define CONFIG_MXC_UART_BASE UART3_BASE #define CONFIG_CONSOLE_DEV "ttymxc2"
-#define PHYS_SDRAM_SIZE (2u * 1024 * 1024 * 1024) - #define CONFIG_SUPPORT_EMMC_BOOT

On 23/07/2016 18:23, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Cc: Martin Donnelly martin.donnelly@ge.com Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
board/ge/bx50v3/bx50v3.c | 2 +- include/configs/ge_bx50v3.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index d45ed44..e9729f8 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -60,7 +60,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;
} diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 4de2460..7a54546 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -32,8 +32,6 @@ #define CONFIG_MXC_UART_BASE UART3_BASE #define CONFIG_CONSOLE_DEV "ttymxc2"
-#define PHYS_SDRAM_SIZE (2u * 1024 * 1024 * 1024)
#define CONFIG_SUPPORT_EMMC_BOOT
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@nxp.com
novena uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Marek Vasut marex@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- include/configs/novena.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/novena.h b/include/configs/novena.h index 2382951..57d8c3e 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -57,7 +57,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE 0xF0000000
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR

On 07/23/2016 06:23 PM, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
novena uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Marek Vasut marex@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Acked-by: Marek Vasut marex@denx.de
include/configs/novena.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/novena.h b/include/configs/novena.h index 2382951..57d8c3e 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -57,7 +57,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE 0xF0000000
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR

On 23/07/2016 18:23, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
novena uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Marek Vasut marex@denx.de Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
include/configs/novena.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/novena.h b/include/configs/novena.h index 2382951..57d8c3e 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -57,7 +57,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE 0xF0000000
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@nxp.com
cgtqmx6eval uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Otavio Salvador otavio@ossystems.com.br Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- include/configs/cgtqmx6eval.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h index dd03936..127a28a 100644 --- a/include/configs/cgtqmx6eval.h +++ b/include/configs/cgtqmx6eval.h @@ -251,7 +251,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR

On Sat, Jul 23, 2016 at 1:23 PM, Fabio Estevam festevam@gmail.com wrote:
From: Fabio Estevam fabio.estevam@nxp.com
cgtqmx6eval uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Otavio Salvador otavio@ossystems.com.br Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Acked-by: Otavio Salvador otavio@ossystems.com.br

On 23/07/2016 18:23, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
cgtqmx6eval uses the imx_ddr_size() function to calculate the DDR size in runtime, so there is no need to define PHYS_SDRAM_SIZE.
Remove the unneeded definition.
Cc: Otavio Salvador otavio@ossystems.com.br Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
include/configs/cgtqmx6eval.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h index dd03936..127a28a 100644 --- a/include/configs/cgtqmx6eval.h +++ b/include/configs/cgtqmx6eval.h @@ -251,7 +251,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic

On 23/07/2016 18:23, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@nxp.com
imx_ddr_size() can be used to calculate the DDR size in runtime.
By using this function we no longer need to define PHYS_SDRAM_SIZE.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
board/warp/warp.c | 2 +- include/configs/warp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/warp/warp.c b/board/warp/warp.c index 49dfdb6..0bc0a6a 100644 --- a/board/warp/warp.c +++ b/board/warp/warp.c @@ -46,7 +46,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;
} diff --git a/include/configs/warp.h b/include/configs/warp.h index 4a8e270..12c7c38 100644 --- a/include/configs/warp.h +++ b/include/configs/warp.h @@ -43,7 +43,6 @@ /* Physical Memory Map */ #define CONFIG_NR_DRAM_BANKS 1 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR -#define PHYS_SDRAM_SIZE SZ_512M
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
Applied to u-boot-imx, thanks !
Best regards, Stefano Babic
participants (5)
-
Fabio Estevam
-
Heiko Schocher
-
Marek Vasut
-
Otavio Salvador
-
Stefano Babic