Patchwork [2/6] DDR3: Fix core timings rounding

login
register
mail settings
Submitter Jean Delvare
Date April 10, 2013, 8:18 p.m.
Message ID <20130410221832.34f38cd2@endymion.delvare>
Download mbox | patch
Permalink /patch/235470/
State Not Applicable
Headers show

Comments

Jean Delvare - April 10, 2013, 8:18 p.m.
DDR3: Round core timings up, not down.
---
 eeprom/decode-dimms |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

--- i2c-tools.orig/eeprom/decode-dimms	2013-04-10 14:29:35.349802212 +0200
+++ i2c-tools/eeprom/decode-dimms	2013-04-10 14:30:19.753833437 +0200
@@ -1390,10 +1390,10 @@  sub decode_ddr3_sdram($)
 	my $trp;
 	my $tras;
 
-	$taa  = int($bytes->[16] / $bytes->[12]);
-	$trcd = int($bytes->[18] / $bytes->[12]);
-	$trp  = int($bytes->[20] / $bytes->[12]);
-	$tras = int(((($bytes->[21] & 0x0f) << 8) + $bytes->[22]) / $bytes->[12]);
+	$taa  = ceil($bytes->[16] / $bytes->[12]);
+	$trcd = ceil($bytes->[18] / $bytes->[12]);
+	$trp  = ceil($bytes->[20] / $bytes->[12]);
+	$tras = ceil(((($bytes->[21] & 0x0f) << 8) + $bytes->[22]) / $bytes->[12]);
 
 	printl("tCL-tRCD-tRP-tRAS", join("-", $taa, $trcd, $trp, $tras));