In order to see the SPD (detailed memory information) data, the user currently has to manually load the needed kernel driver. Which driver to load depends on the memory type. Depending on the driver user, the devices may even have to be instantiated manually and this is a non-trivial multi-step task. Plus you need to be root to do it.

I would like to attempt to automatize all this at least in the most common and simple cases like Intel x86 desktop. The idea would be to figure out the memory type and the I2C address of the SPD EEPROMs based on DMI data. If the DMI data is of good quality then it should be possible to automatically figure out which driver to use and to instantiate the devices at boot time.

If this works then running "decode-dimms" (or any other equivalent tool) should just work after boot without any preparatory work, for all users.

I plan to start implementing this for DDR3 memory and the i2c-i801 SMBus controller driver because that's what I have on my workstation. If it works, doing the same for DDR4 shouldn't be too difficult. Once this works for the i2c-i801, it should be pretty trivial to do the same with other SMBus controller drivers, for example i2c-piix4.

Excluded from the scope are large server systems with multiple SMBus controllers or multiplexed SMBus. Also excluded are OF/DT systems as I would expect SPD EEPROMs to be declared in the device tree so they would already be instantiated without further effort.

Looking for hackers with the skills:

i2c-tools kernel smbus dmi

This project is part of:

Hack Week 18

Activity

  • over 1 year ago: jdelvare started this project.
  • about 2 years ago: a_faerber liked this project.
  • about 2 years ago: jdelvare added keyword "i2c-tools" to this project.
  • about 2 years ago: jdelvare added keyword "kernel" to this project.
  • about 2 years ago: jdelvare added keyword "smbus" to this project.
  • about 2 years ago: jdelvare added keyword "dmi" to this project.
  • about 2 years ago: jdelvare originated this project.

  • Comments

    • jdelvare
      5 months ago by jdelvare | Reply

      For the record, this hack week project was successful. Relevant upstream kernel commits:

      commit 9e0afe3910ff7e5493c5d8ebe3b499994b5e0272
      Author: Jean Delvare <jdelvare@suse.de>
      Date:   Tue Dec 3 11:20:37 2019 +0100
      
          firmware: dmi: Remember the memory type
      
      commit 7c2378800cf7ac87e2663afa7f39d102871f0c28
      Author: Jean Delvare <jdelvare@suse.de>
      Date:   Tue Dec 3 11:20:37 2019 +0100
      
          firmware: dmi: Add dmi_memdev_handle
      
      commit 5ace60859e84113b7a185c117fbf2c429d381b59
      Author: Jean Delvare <jdelvare@suse.de>
      Date:   Mon Mar 16 11:22:24 2020 +0100
      
          i2c: smbus: Add a way to instantiate SPD EEPROMs automatically
      
      commit 01590f361e94a01e9b9868fa81d4079d255c681f
      Author: Jean Delvare <jdelvare@suse.de>
      Date:   Mon Mar 16 11:24:48 2020 +0100
      
          i2c: i801: Instantiate SPD EEPROMs automatically
      

      So the feature is supported since kernel v5.8. Next step is to extend support to systems with 5-8 memory slots (still on a single SMBus segment), and to add support to other SMBus controller drivers.

    Similar Projects

    Test mainline kernel on an older Qualcomm SOC (msm89xx), explore current Qualcomm mainlining kernel effort by pvorel

    Project Description

    Qualcomm concentrate ...


    work on sunxi a64 cpufreq driver (for teres-1, pine64) by mbrugger

    With the teres-1 [1] laptop we have a first arm...


    DRM driver for USB-based SiS graphics cards by tdz

    Back in the late 90s to early 2000s, SiS graphi...


    Separate kernel module signature to a independent file by joeyli

    [comment]: # (Please use the project descriptio...


    Support for BIOS-based error log in dmidecode by jdelvare

    [comment]: # (Please use the project descriptio...