My device has a opencore-i2c that in turn exports multiple i2c/smbus interfaces. I have an x86_64 system, and I am able to add i2c devices that sit on the SMB0, SMB1 since the names SMB0 and SMB1 are known the system.
I having difficulty in declaring i2c devices that are behind the FPGA. FROM DSDT, I see declaration of SMB0 as follows
Device (SMB0)
{
Name (_ADR, 0x001F0004) // _ADR: Address
}
This corresponds to the lspci output below which has SMBus at 00:1f.4
root# lspci | grep -i smbus
00:12.0 System peripheral: Intel Corporation DNV SMBus Contoller - Host (rev 11)
00:1f.4 SMBus: Intel Corporation DNV SMBus controller (rev 11)
root#
However in case of ocores, a single PCI device publishes multiple i2c-bus to the kernel once the driver is loaded. So, any pointers on how to publish this information via ACPI so that the i2c devices on those buses can be auto-enumerated after OCORE driver is loaded.
Reference: https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-ocores.c
In the above example, an i2c-adapter is created for each pci-function. The Device-Tree is expected to pass the address of the PCI-Resource, and the driver instantiates a single instance of the i2c-adapter.
In my case, the code is modified such that the base-address, and "number of i2c busses" on the given platform is passed as parameter.
The driver then then instantiates i2c busses with calls to i2c_add_numbered_adapter based on number of buses to create.
The offsets to communicate with the device are calculated as offsets from the "BAR" register.