4

Disclaimer, I am far, very far, from a CentOS/Linux expert and I have been having a difficult time finding any of this out on my own, using Google fu. I am working on a product that goes into a PCIe slot in a PC running CentOS. On the side channel of the PCIe interconnect there is a SMBus (i.e., I2C) that is used to gather the Vital Product Data (VPD) table. I am trying to find a way to test this interface, but have failed miserably thus far. I know there are a few tools to try and read the VPD and I2C device, which are:

LM-Tools (I2C), installed by using sudo yum install i2c-tools dmidecode, installed by using sudo yum install dmidecode

The tools in dmidecode has a "vpddecode" which doesn't return anything and I suspect is looking for something in memory, but I really don't know. the LM-Tools has the i2cdetect, but trying to execute "sudo i2cdetect -y 0" does not work and reports:

Error: Could not open file /dev/i2c-2 or /dev/i2c/2: No such file or directory

If I look under /dev, there are no items with i2c in it. So, I am thinking I need to a load a module or something?

So, my questions are:

  1. Will these tools be able to communicate with my device that is on the PCIe SMBus?
  2. If these utilities will work with my device on the PCIe SMBus, what actions do I need to take in order for them to work?
  3. If these utilities will not work with my device on the PCIe SMBus, what utilities will work?

Any help is greatly appreciated. I have google, but my google fu mostly brings up info for LM modules to read temps and items like that, even if I try to filter them out.

Thanks, Mark

2 Answers 2

5

As far as I know, SMBus controllers are represented as I²C devices under Linux. (Since SMBus is a subset of I²C, those devices will not support all I²C commands but only those related to SMBus.) Thus, having the SMBus controller of your mainboard visible as /dev/i2c-X device is necessary for any userspace program to communicate with your PCIe SMBus device.

In order to have /dev/i2c-X devices, you have to load the i2c-dev module. You can do this manually by executing modprobe i2c-dev on the shell or by adding a line containing just the module name to the /etc/modules file. The latter will load the module automatically on every system start.

Additionally, you need to load a driver for the particular SMBus controller on your mainboard (if it is not loaded automatically). I do not know which mainboard (chipset) you have. The SMBus controller of most Intel chipsets is supported by the i2c-i801 Linux kernel module.

If you have loaded both modules, there should be one or more I²C buses available to you system. For each bus, there is a /dev/i2c-X device and an entry under /sys/bus/i2c/devices/ with the same name.

In order to narrow down which bus belongs to you PCIe device, you can try:

$ grep . /sys/bus/i2c/devices/i2c-*/name

This will give you a list of all buses and print the driver name for each bus. Since you have i2c-tools installed, you can also use i2cdetect -l to get a similar list.

Edit: There seems to be an ACPI-related issue with i2c-i801 and Intel C220 chipsets on some mainboards rendering the SMBus module unusable.

1
  • Thanks, dasup. This certainly does help my cause. I still have a long ways to go, but at least I can follow some tracks.
    – lordhog
    Commented Aug 22, 2014 at 2:32
0

Pass acpi_enforce_resources=lax in the command line will resolve the ACPI resource conflict.

i2c /dev entries driver
ACPI Warning: SystemIO range 0x0000000000003000-0x000000000000301F conflicts with OpRegion 0x0000000000003000-0x000000000000300F (_SB_.PCI0.SBUS.SMBI) (20150930/utaddress-254)
ACPI: This conflict may cause random problems and system instability
ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver i801_smbus 0000:00:1f.3: SMBus using PCI interrupt

Check of resource interference between native drivers and ACPI OperationRegions (SystemIO and System Memory only). IO ports and memory declared in ACPI might be used by the ACPI subsystem in arbitrary AML code and can interfere with legacy drivers. acpi_enforce_resources= can be set to:

  • strict (default) (2) -> further driver trying to access the resources will not load
  • lax (1) -> further driver trying to access the resources will load, but you get a system message that something might go wrong...

  • no (0) -> ACPI Operation Region resources will not be registered

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .