From patchwork Sun Nov 19 12:35:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 839317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yfrsn5v2Bz9rvt for ; Sun, 19 Nov 2017 23:35:25 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbdKSMfY (ORCPT ); Sun, 19 Nov 2017 07:35:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:48210 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbdKSMfY (ORCPT ); Sun, 19 Nov 2017 07:35:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 07216AAB9 for ; Sun, 19 Nov 2017 12:35:23 +0000 (UTC) Date: Sun, 19 Nov 2017 13:35:22 +0100 From: Jean Delvare To: Linux I2C Subject: [PATCH 4/6] decode-dimms: Decode physical characteristics of DDR4 Message-ID: <20171119133522.1f2046af@endymion> In-Reply-To: <20171119133309.67d4c596@endymion> References: <20171119133309.67d4c596@endymion> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Print the physical characteristics of unbuffered, registered and load-reduced DDR4 SDRAM modules. --- eeprom/decode-dimms | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) --- i2c-tools.orig/eeprom/decode-dimms 2017-11-17 11:25:15.453970328 +0100 +++ i2c-tools/eeprom/decode-dimms 2017-11-17 11:27:11.401380668 +0100 @@ -1404,6 +1404,7 @@ sub ddr3_mtb_ftb($$$$) return $byte1 * $mtb + $byte2 * $ftb / 1000; } +# Also works for DDR4 sub ddr3_reference_card($$) { my ($rrc, $ext) = @_; @@ -1727,7 +1728,7 @@ use constant DDR4_UNBUFFERED => 1; use constant DDR4_REGISTERED => 2; use constant DDR4_LOAD_REDUCED => 4; -# Parameter: EEPROM bytes 0-383 (using 1-125) +# Parameter: EEPROM bytes 0-383 (using 1-130) sub decode_ddr4_sdram($) { my $bytes = shift; @@ -1915,6 +1916,25 @@ sub decode_ddr4_sdram($) printl("Thermal Sensor", $bytes->[14] & 0x80 ? "TSE2004 compliant" : "No"); + +# type-specific settings + if ($module_types[$bytes->[3] & 0x0f]->{family} == DDR4_UNBUFFERED || + $module_types[$bytes->[3] & 0x0f]->{family} == DDR4_REGISTERED || + $module_types[$bytes->[3] & 0x0f]->{family} == DDR4_LOAD_REDUCED) { + prints("Physical Characteristics"); + + my $height = $bytes->[128] & 0x1f; + printl("Module Height", + $height == 0x00 ? "15 mm or less" : + $height == 0x1f ? "more than 45 mm" : + sprintf("%u mm", $height + 15)); + printl("Module Thickness", + sprintf("%d mm front, %d mm back", + ($bytes->[129] & 0x0f) + 1, + (($bytes->[129] >> 4) & 15) + 1)); + printl("Module Reference Card", + ddr3_reference_card($bytes->[130], $bytes->[128])); + } } # Parameter: EEPROM bytes 0-127 (using 4-5)