public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 3/6] DDR3: Store time bases, don't print them
Date: Wed, 10 Apr 2013 22:19:16 +0200	[thread overview]
Message-ID: <20130410221916.68177bc1@endymion.delvare> (raw)
In-Reply-To: <20130410221330.213ca5be-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>

DDR3: Don't print the medium and fine time bases, they aren't directly
useful to the user. Simply store them for later use.
---
 eeprom/decode-dimms |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- i2c-tools.orig/eeprom/decode-dimms	2013-04-10 14:30:19.753833437 +0200
+++ i2c-tools/eeprom/decode-dimms	2013-04-10 15:37:24.481817216 +0200
@@ -1335,6 +1335,7 @@ sub decode_ddr3_sdram($)
 	my $bytes = shift;
 	my $temp;
 	my $ctime;
+	my ($ftb, $mtb);
 
 	my @module_types = ("Undefined", "RDIMM", "UDIMM", "SO-DIMM",
 			    "Micro-DIMM", "Mini-RDIMM", "Mini-UDIMM",
@@ -1346,18 +1347,17 @@ sub decode_ddr3_sdram($)
 					$module_types[$bytes->[3]] :
 					sprintf("Reserved (0x%.2X)", $bytes->[3]));
 
+# time bases
+	if (($bytes->[9] & 0x0f) == 0 || $bytes->[11] == 0) {
+		print STDERR "Invalid time base divisor, can't decode\n";
+		return;
+	}
+	$ftb = ($bytes->[9] >> 4) / ($bytes->[9] & 0x0f);
+	$mtb = $bytes->[10] / $bytes->[11];
+
 # speed
 	prints("Memory Characteristics");
 
-	my $dividend = ($bytes->[9] >> 4) & 15;
-	my $divisor  = $bytes->[9] & 15;
-	printl("Fine time base", sprintf("%.3f", $dividend / $divisor) . " ps");
-
-	$dividend = $bytes->[10];
-	$divisor  = $bytes->[11];
-	my $mtb = $dividend / $divisor;
-	printl("Medium time base", tns3($mtb));
-
 	$ctime = $bytes->[12] * $mtb;
 	my $ddrclk = 2 * (1000 / $ctime);
 	my $tbits = 1 << (($bytes->[8] & 7) + 3);

-- 
Jean Delvare

  parent reply	other threads:[~2013-04-10 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 20:13 [PATCH 0/6] decode-dimms: Fix and improve DDR3 support Jean Delvare
     [not found] ` <20130410221330.213ca5be-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-04-10 20:17   ` [PATCH 1/6] DDR3: Fix tRAS value Jean Delvare
2013-04-10 20:18   ` [PATCH 2/6] DDR3: Fix core timings rounding Jean Delvare
2013-04-10 20:19   ` Jean Delvare [this message]
2013-04-10 20:20   ` [PATCH 4/6] DDR3: Use fine time base Jean Delvare
2013-04-10 20:22   ` [PATCH 5/6] DDR3: Repeat core timings as time values Jean Delvare
2013-04-10 20:22   ` [PATCH 6/6] DDR3: Print core timings at all supported standard speeds Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130410221916.68177bc1@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox