diff options
author | Dalon Westergreen <dwesterg@gmail.com> | 2018-09-11 10:06:14 -0700 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-09-15 03:17:01 +0200 |
commit | 02d8d3259133ea7af6031e4a780bdac1462ae057 (patch) | |
tree | 6a9a97977fcfd5cea58790329e7867d2e3d28d0d /drivers | |
parent | 3570469742aec30fed0b423708df346176fa9438 (diff) |
socfpga: stratix10: fix sdram_calculate_size
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@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ddr/altera/sdram_s10.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ddr/altera/sdram_s10.c b/drivers/ddr/altera/sdram_s10.c index 48f4f47b14..a48567c109 100644 --- a/drivers/ddr/altera/sdram_s10.c +++ b/drivers/ddr/altera/sdram_s10.c @@ -371,11 +371,11 @@ int sdram_mmr_init_full(unsigned int unused) * Calculate SDRAM device size based on SDRAM controller parameters. * Size is specified in bytes. */ -unsigned long sdram_calculate_size(void) +phys_size_t sdram_calculate_size(void) { u32 dramaddrw = hmc_readl(DRAMADDRW); - u32 size = 1 << (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) + + phys_size_t 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) + |