fsl_ddr: Fix DDR3 calculation of rank density with 8GB or more
authorTimur Tabi <timur@freescale.com>
Wed, 1 Jul 2009 21:51:59 +0000 (16:51 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 2 Jul 2009 04:21:43 +0000 (23:21 -0500)
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>
cpu/mpc8xxx/ddr/ddr3_dimm_params.c

index 8d686ac5d9191e881d1e1d2e23dc73f148fc3a44..13d234e9331542eb8d56780cf971ac0bdd26ead0 100644 (file)
@@ -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);