i2c-tools/i2c-tools-hackweek-9-dependencies.diff
Jean Delvare fec73db6cf - i2c-tools-hackweek-9-dependencies.diff: Backport 2 helper
functions needed by the following patch.
- i2c-tools-hackweek-9-improve-DDR3-support.diff: Improve DDR3
  support. This was my hackweek 9 project.

OBS-URL: https://build.opensuse.org/package/show/Base:System/i2c-tools?expand=0&rev=27
2013-04-18 08:03:17 +00:00

35 lines
837 B
Diff

Subject: decode-dimms: Backport two functions
Upstream: yes, r6079 (partial), r6093 (partial), r6095 (partial)
Backport functions as_ddr() and ddr_core_timings() which are needed
by the hackweek 9 code.
---
eeprom/decode-dimms | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/eeprom/decode-dimms
+++ b/eeprom/decode-dimms
@@ -826,6 +826,22 @@ sub decode_sdr_sdram($)
(($bytes->[35] >> 7) ? -$temp : $temp) . " ns");
}
+sub as_ddr($$)
+{
+ my ($gen, $ctime) = @_;
+
+ return " as DDR" . ($gen == 1 ? "" : $gen) . "-" .
+ int(2000 / $ctime);
+}
+
+sub ddr_core_timings($$$$$)
+{
+ my ($cas, $ctime, $trcd, $trp, $tras) = @_;
+
+ return $cas . "-" . ceil($trcd/$ctime) . "-" . ceil($trp/$ctime) .
+ "-" . ceil($tras/$ctime);
+}
+
# Parameter: EEPROM bytes 0-127 (using 3-62)
sub decode_ddr_sdram($)
{