aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-06-29 02:05:06 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-06-29 17:58:52 -0700
commit3e3d9bb7c4b099628e6eeb2b48c777984d7b1c56 (patch)
tree9d10b2c3159d8609cdb04c8498428a965357c11f
parentd0b6b27f579462915a7f13776622df7f25f0dc1b (diff)
Memory Devices: fix spd revision for ddr and ddr2
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r--modules/devices/spd-decode.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c
index 8cb74cb1..1ec5bf3b 100644
--- a/modules/devices/spd-decode.c
+++ b/modules/devices/spd-decode.c
@@ -1053,14 +1053,18 @@ static GSList *decode_dimms2(GSList *eeprom_list, gboolean use_sysfs, int max_si
s->spd_size = spd_size;
s->type = ram_type;
spd_ram_types |= (1 << ram_type-1);
- if (ram_type == SDR_SDRAM) {
- /* SDR */
- s->spd_rev_major = 0;
- s->spd_rev_minor = bytes[62];
- } else {
- /* DDR, DDR2, DDR3, DDR4 */
+ switch (ram_type) {
+ case SDR_SDRAM:
+ case DDR_SDRAM:
+ case DDR2_SDRAM:
+ s->spd_rev_major = bytes[62] >> 4;
+ s->spd_rev_minor = bytes[62] & 0xf;
+ break;
+ case DDR3_SDRAM:
+ case DDR4_SDRAM:
s->spd_rev_major = bytes[1] >> 4;
s->spd_rev_minor = bytes[1] & 0xf;
+ break;
}
s->dram_vendor = vendor_match(s->dram_vendor_str, NULL);
dimm_list = g_slist_append(dimm_list, s);