Skip to contentSkip to conversation

fsl_ddr: Fix DDR3 calculation of rank density with 8GB or more

PATCH New Kumar Gala 1 participant 2 messages Jul 2, 2009

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 fsl_ddr: Fix DDR3 calculation of rank density with 8GB or more

From: Timur Tabi <[email protected]>

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.

---
 cpu/mpc8xxx/ddr/ddr3_dimm_params.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu/mpc8xxx/ddr/ddr3_dimm_params.c +1 -1
index 62c4df7..f0cd0d9 100644
@@ -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%16Lx\n", (u64) bsize);
Signature · 1 line
1.6.0.6
author Applied
#1 lore raw

PATCH 1/1 fsl_ddr: Fix DDR3 calculation of rank density with 8GB or more

Quoted 9 lines · Kumar Gala

From: Timur Tabi <[email protected]>

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.

Quoted 4 lines

---
cpu/mpc8xxx/ddr/ddr3_dimm_params.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)

applied

- k