diff mbox series

[U-Boot] ARM: socfpga: Pull DRAM size from DT

Message ID 20180529163752.29289-1-marex@denx.de
State Accepted
Commit 297b653bbffe4e3bcc9534d70bd92e11545a7c4a
Delegated to: Marek Vasut
Headers show
Series [U-Boot] ARM: socfpga: Pull DRAM size from DT | expand

Commit Message

Marek Vasut May 29, 2018, 4:37 p.m. UTC
Pull the DRAM size from DT instead of hardcoding it into U-Boot.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
---
 arch/arm/mach-socfpga/misc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

See, Chin Liang May 31, 2018, 9:53 a.m. UTC | #1
On Tue, 2018-05-29 at 18:37 +0200, Marek Vasut wrote:
> Pull the DRAM size from DT instead of hardcoding it into U-Boot.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Chin Liang See <chin.liang.see@intel.com>
> Cc: Dinh Nguyen <dinguyen@kernel.org>
> ---
>  arch/arm/mach-socfpga/misc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-
> socfpga/misc.c
> index fca86507f1..bc6097cb1f 100644
> --- a/arch/arm/mach-socfpga/misc.c
> +++ b/arch/arm/mach-socfpga/misc.c
> @@ -40,7 +40,9 @@ struct bsel bsel_str[] = {
>  
>  int dram_init(void)
>  {
> -	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1,
> PHYS_SDRAM_1_SIZE);
> +	if (fdtdec_setup_memory_size() != 0)
> +		return -EINVAL;
> +
>  	return 0;
>  }
>  


Reviewed-by: Chin Liang See <chin.liang.see@intel.com>

Thanks
Chin Liang
diff mbox series

Patch

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index fca86507f1..bc6097cb1f 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -40,7 +40,9 @@  struct bsel bsel_str[] = {
 
 int dram_init(void)
 {
-	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
+	if (fdtdec_setup_memory_size() != 0)
+		return -EINVAL;
+
 	return 0;
 }