Search code examples
linuxlinux-kerneli2ceepromsmbus

Unable to access SPD information on AMD EPYC


Background

I'm trying to access the Serial Presence Detect Data via i2c on CentOS 7 Linux. I'm mainly looking for the SPD Revision located in byte 1 and is consistent on DDR3 and DDR4 charts. The SPD Revision can not be found through dmidecode, lshw, or any other standard linux package and is undetectable in some cases by Passmark's Memtestx86 which has led me down this path. I've also made a python implementation using the smbus2 library but it bases it's data on the same kernel module i2c-dev.

To give an idea of what I'm expecting, here's an output from a DDR3 DIMM on an Intel Celeron processor using the i2c approach.

[root@localhost ~]# lsmod | grep i2c
i2c_dev                13985  0 
i2c_i801               22736  0 
i2c_algo_bit           13413  2 igb,i915
# yum install i2c-tools
[root@localhost ~]# i2cdetect -l
i2c-0   i2c         i915 gmbus ssc                      I2C adapter
i2c-1   i2c         i915 gmbus vga                      I2C adapter
i2c-2   i2c         i915 gmbus panel                    I2C adapter
i2c-3   i2c         i915 gmbus dpc                      I2C adapter
i2c-4   i2c         i915 gmbus dpb                      I2C adapter
i2c-5   i2c         i915 gmbus dpd                      I2C adapter
i2c-6   i2c         DPDDC-B                             I2C adapter
i2c-7   smbus       SMBus I801 adapter at e000          SMBus adapter
[root@localhost ~]# i2cdetect -y 7
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Note that this particular DIMM has an SPD Revision of 1.3.

[root@localhost ~]# i2cdump -y 7 0x50
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 92 13 0b 03 04 21 02 01 03 11 01 08 0a 00 fe 00    ?????!???????.?.
10: 69 78 69 30 69 11 18 81 20 08 3c 3c 00 f0 83 05    ixi0i??? ?<<.???
20: 00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 00    .........?......
30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 11 41 00    ............??A.
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 86 f1 02 20 11 01 10 00 02 7c 07    .....??? ???.?|?
80: 4d 33 53 54 2d 34 47 4d 53 43 4c 50 43 2d 50 20    M3ST-4GMSCLPC-P 
90: 20 20 00 00 80 2c 4d 30 53 32 2d 32 30 30 33 30      ..?,M0S2-20030
a0: 39 30 31 30 00 00 00 00 00 00 00 00 00 00 00 00    9010............
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
[root@localhost ~]# 

Problem

Now I'm trying to run a similar test on a different motherboard but I'm unable to detect the SPD data. The motherboard and processor are included in the dmesg log below.

[root@localhost ~]# modprobe i2c-dev
[root@localhost ~]# i2cdetect -l
i2c-0   i2c         igb BB                              I2C adapter
i2c-1   i2c         igb BB                              I2C adapter
i2c-2   smbus       SMBus PIIX4 adapter port 0 at 0b00  SMBus adapter
i2c-3   smbus       SMBus PIIX4 adapter port 2 at 0b00  SMBus adapter
i2c-4   smbus       SMBus PIIX4 adapter port 3 at 0b00  SMBus adapter
i2c-5   smbus       SMBus PIIX4 adapter port 4 at 0b00  SMBus adapter
[root@localhost ~]# i2cdetect -y 2
...
[root@localhost ~]# i2cdetect -y 3
...
[root@localhost ~]# i2cdetect -y 4
...
[root@localhost ~]# i2cdetect -y 5
...

from dmesg

...
[    0.000000] DMI: Supermicro Super Server/H12SSW-AN6, BIOS 2.4 02/23/2022
...
[    1.447669] smpboot: CPU0: AMD EPYC 7402P 24-Core Processor (fam: 17, model: 31, stepping: 00)
...
[  233.696793] i2c /dev entries driver
[  265.088648] i2c i2c-2: SMBus Timeout!
[  265.091939] i2c i2c-2: Failed reset at end of transaction (01)
[  265.095368] i2c i2c-2: Failed! (01)
...
[  302.537291] i2c i2c-3: Failed! (01)
...
[  303.721286] i2c i2c-4: Failed! (01)
...
[  304.841296] i2c i2c-5: Failed! (01)
...

What I've done so far

FYI, all my tested systems are running off kernel version 3.10.0-1160.71.1.el7.x86_64.

Based on what I've included above, I suspect that there is a missing kernel module in CentOS 7 preventing me from interfacing with those relevant i2c devices but can't be entirely certain. Maybe it's an oversight by the kernel developers? Maybe it works on a newer kernel.

After what little I could find about my particular issue, I stumbled upon this https://developer.amd.com/e-sms/ which took me to https://github.com/amd/apml_modules/ but I don't think these modules will solve my issue.


Solution

  • In case anyone else stumbles upon this question in the future, I recommend watching this video presentation by Jean Delvare. He essentially explains the discrepancy in system readability after DDR3 and leaving our options far and few in between.

    Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)

    There are no obvious Linux solutions and your best bet will probably be dmidecode as i2c. PassMark's RAMMon and Memtest86 both displayed "SPD Not Detected" errors. I was able to successfully read DDR4 on my Windows PC using Thaiphoon Burner Freeware Version Thaiphoon Burner Micron DDR4