diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-06-29 22:24:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 22:24:21 -0700 |
commit | c9d00c85af88085df1427e72dea11b836f409cd3 (patch) | |
tree | 03a8ccdeec82ca32059946417442264d46f85109 /modules/devices/spd-decode.c | |
parent | 6ee860482e11f0fb042e2da874b095d80106c4f3 (diff) | |
parent | 91a833a52e0c8b025969b88a9671e99ed8a1bf5e (diff) |
Merge pull request #382 from bp0/mem9
Memory Devices: Fix DMI to SPD matching
Diffstat (limited to 'modules/devices/spd-decode.c')
-rw-r--r-- | modules/devices/spd-decode.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c index 6250be9d..164ad9dc 100644 --- a/modules/devices/spd-decode.c +++ b/modules/devices/spd-decode.c @@ -62,6 +62,7 @@ static const char *ram_types[] = {"Unknown", "Direct Rambus", "Rambus", #include "spd-vendors.c" +struct dmi_mem_socket; typedef struct { unsigned char bytes[512]; unsigned char dev[32]; /* %1d-%04d\0 */ @@ -92,7 +93,9 @@ typedef struct { int week, year; gboolean ddr4_no_ee1004; - gboolean claimed_by_dmi; + + struct dmi_mem_socket *dmi_socket; + int match_score; } spd_data; #define spd_data_new() g_new0(spd_data, 1) @@ -569,22 +572,47 @@ static gchar *decode_ddr3_sdram_extra(unsigned char *bytes) { int ranks = 1 + ((bytes[7] >> 3) & 0x7); int pins = 4 << (bytes[7] & 0x7); + int die_count = (bytes[33] >> 4) & 0x7; + int ts = !!(bytes[32] & 0x80); /* expected to continue an [SPD] section */ return g_strdup_printf("%s=%d\n" "%s=%d\n" - "%s=%s %s %s\n" + "%s=%d %s\n" + "%s=[%02x] %s\n" + "%s=%s%s%s\n" + "%s=" + "%s%s%s%s%s%s%s%s" + "%s%s%s%s%s%s%s\n" "[%s]\n" - "tCL=%.2f\n" + "tCL=%.0f\n" "tRCD=%.3fns\n" "tRP=%.3fns\n" "tRAS=%.3fns\n", _("Ranks"), ranks, _("IO Pins per Chip"), pins, + _("Die count"), die_count, die_count ? "" : _("(Unspecified)"), + _("Thermal Sensor"), bytes[32], ts ? _("Present") : _("Not present"), _("Supported Voltages"), - (bytes[6] & 4) ? "1.25V" : "", - (bytes[6] & 2) ? "1.35V" : "", + (bytes[6] & 4) ? "1.25V " : "", + (bytes[6] & 2) ? "1.35V " : "", (bytes[6] & 1) ? "" : "1.5V", + _("Supported CAS Latencies"), + (bytes[15] & 0x40) ? "18 " : "", + (bytes[15] & 0x20) ? "17 " : "", + (bytes[15] & 0x10) ? "16 " : "", + (bytes[15] & 0x08) ? "15 " : "", + (bytes[15] & 0x04) ? "14 " : "", + (bytes[15] & 0x02) ? "13 " : "", + (bytes[15] & 0x01) ? "12 " : "", + (bytes[14] & 0x80) ? "11 " : "", + (bytes[14] & 0x40) ? "10 " : "", + (bytes[14] & 0x20) ? "9 " : "", + (bytes[14] & 0x10) ? "8 " : "", + (bytes[14] & 0x08) ? "7 " : "", + (bytes[14] & 0x04) ? "6 " : "", + (bytes[14] & 0x02) ? "5 " : "", + (bytes[14] & 0x01) ? "4" : "", _("Timings"), tcl, trcd, trp, tras ); } @@ -1079,6 +1107,7 @@ static GSList *decode_dimms2(GSList *eeprom_list, gboolean use_sysfs, int max_si s->spd_rev_minor = bytes[1] & 0xf; break; } + s->vendor = vendor_match(s->vendor_str, NULL); s->dram_vendor = vendor_match(s->dram_vendor_str, NULL); dimm_list = g_slist_append(dimm_list, s); } |