summaryrefslogtreecommitdiff
path: root/cpu/mpc8xxx/ddr
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2009-07-01 16:51:59 -0500
committerKumar Gala <galak@kernel.crashing.org>2009-07-01 23:21:43 -0500
commite66f38da8434425aca8df08d06d9ef41b3478d3b (patch)
treea330ace8bf35966aa76b215dc49e0a24baea3ab3 /cpu/mpc8xxx/ddr
parent6af015b86b86d94de7ca1b23a3890bc93a50c2ab (diff)
downloadu-boot-imx-e66f38da8434425aca8df08d06d9ef41b3478d3b.zip
u-boot-imx-e66f38da8434425aca8df08d06d9ef41b3478d3b.tar.gz
u-boot-imx-e66f38da8434425aca8df08d06d9ef41b3478d3b.tar.bz2
fsl_ddr: Fix DDR3 calculation of rank density with 8GB or more
The calculate for rank density in compute_ranksize() for DDR3 used all integers for the expression, so the result was also a 32-bit integer, even though the 'bsize' variable is a u64. Fix the expression to calculate a true 64-bit value. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'cpu/mpc8xxx/ddr')
-rw-r--r--cpu/mpc8xxx/ddr/ddr3_dimm_params.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpu/mpc8xxx/ddr/ddr3_dimm_params.c b/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
index 8d686ac..13d234e 100644
--- a/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
+++ b/cpu/mpc8xxx/ddr/ddr3_dimm_params.c
@@ -68,7 +68,7 @@ compute_ranksize(const ddr3_spd_eeprom_t *spd)
if ((spd->organization & 0x7) < 4)
nbit_sdram_width = (spd->organization & 0x7) + 2;
- bsize = 1 << (nbit_sdram_cap_bsize - 3
+ bsize = 1ULL << (nbit_sdram_cap_bsize - 3
+ nbit_primary_bus_width - nbit_sdram_width);
debug("DDR: DDR III rank density = 0x%08x\n", bsize);