EEPROM driver
The EEPROM connected to the BMC is an AT24C256. This is already supported by a kernel driver: drivers/misc/eeprom/at24.c. It is enabled with EEPROM_AT24.
If we have enabled this driver correctly and probe the i2c bus then there will be an entry in /sys/bus/i2c/devices/ with a file containing the EEPROM data. This file can then be passed to our IPMI FRU parser and then updated in the appropriate fru-manager DBus object.
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/misc-devices/eeprom
[2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/misc/eeprom/at24.c
Signature · 1 line
Patrick Williams
Hey Patrick,
Quoted 8 lines · Patrick Williams
The EEPROM connected to the BMC is an AT24C256. This is already supported by a kernel driver:
drivers/misc/eeprom/at24.c. It is enabled withEEPROM_AT24.If we have enabled this driver correctly and probe the i2c bus then there will be an entry in
/sys/bus/i2c/devices/with a file containing the EEPROM data. This file can then be passed to our IPMI FRU parser and then updated in the appropriate fru-manager DBus object.
IIRC it lives on i2c1 - the second bus. We should be able to add it to the device tree and have the kernel load the driver at boot; this is working for the rtc device that sits on i2c0.
However, I'm currently hunting down an interrupt issue with the i2c bus driver when we enable anything more than the first bus. I'll let you know when we have that working.
Cheers,
Joel
Quoted 9 lines · Joel Stanley
Quoted 4 lines
If we have enabled this driver correctly and probe the i2c bus then there will be an entry in
/sys/bus/i2c/devices/with a file containing the EEPROM data. This file can then be passed to our IPMI FRU parser and then updated in the appropriate fru-manager DBus object.IIRC it lives on i2c1 - the second bus. We should be able to add it to the device tree and have the kernel load the driver at boot; this is working for the rtc device that sits on i2c0.
Joel,
There is a slight philosophical question embedded in your response:
Do we want devices to generally be required to be added to the device tree
or do we want to have a userspace app that probes the i2c bus for devices based on hotplug events?
Other questions that come to mind:
For device tree entries are you just suggesting that the i2c master would be in the device tree or all the end devices?
Is there an easy way for us to pre-populate a device tree at build time for elements we know about a particular BMC / machine combination? We may need to incorporate elements from both the bmc-bsp layer and the machine-bsp layer.
Signature · 1 line
Patrick Williams
Quoted 2 lines · Patrick Williams
Do we want devices to generally be required to be added to the device tree
or do we want to have a userspace app that probes the i2c bus for devices based on hotplug events?
For the devices that are fixed in a system, such as devices on the i2c bus, we would encode them in the device tree.
Quoted 2 lines
For device tree entries are you just suggesting that the i2c master would be in the device tree or all the end devices?
Both. The device tree describes the relationship between the i2c bus and the devices that hang off of each bus. We also encode interrupt numbers, i2c addresses, and any other information that might be configurable in the driver.
Quoted 4 lines
Is there an easy way for us to pre-populate a device tree at build time for elements we know about a particular BMC / machine combination? We may need to incorporate elements from both the bmc-bsp layer and the machine-bsp layer.
We will encode this information in the layer that describes the PCB that the BMC is attached to. Guessing at your naming scheme, I imagine this would be the machine-bsp layer?
Do we have a wiki page that describes the the bitbake layers and how they relate to each other?
Cheers,
Joel