[U-Boot] [PATCH] socfpga: stratix10: fix sdram_calculate_size

Dalon Westergreen dwesterg at gmail.com
Mon Sep 10 20:41:11 UTC 2018


Incorrect type of size variable results in 0 being
returned for sdram sizes greater than or equal to
4GB.

Signed-off-by: Dalon Westergreen <dwesterg at gmail.com>
---
 drivers/ddr/altera/sdram_s10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ddr/altera/sdram_s10.c b/drivers/ddr/altera/sdram_s10.c
index 48f4f47b14..dad0147b64 100644
--- a/drivers/ddr/altera/sdram_s10.c
+++ b/drivers/ddr/altera/sdram_s10.c
@@ -375,7 +375,7 @@ unsigned long sdram_calculate_size(void)
 {
 	u32 dramaddrw = hmc_readl(DRAMADDRW);
 
-	u32 size = 1 << (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
+	unsigned long  size = 1 << (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
 			 DRAMADDRW_CFG_BANK_GRP_ADDR_WIDTH(dramaddrw) +
 			 DRAMADDRW_CFG_BANK_ADDR_WIDTH(dramaddrw) +
 			 DRAMADDRW_CFG_ROW_ADDR_WIDTH(dramaddrw) +
-- 
2.17.1



More information about the U-Boot mailing list