Me again Thanks for all the support so far, I’ve encountered another issue where I can’t seem to get things to behave as expected.
Preface: I have wired an M24256 (ST 24c256) to a suitable bus (i2c3 on my Verdin development board - other i2c busses already have EEPROMs on them, this bus has no devices as indicated by i2c-detect).
I am able to get the eeprom to work and appear properly in SysFS manually, e.g. echo 24c256 0x50 > /sys/bus/i2c/devices/i2c-2/new_device
will create a 2-0050
device entry containing an eeprom
file which can be read and written to access the EEPROM.
However, I am trying to get this to work automatically via devicetree configuration. I know it should be possible because there are several 24c02
EEPROM nodes already present in the Verdin tree.
No matter what configuration values I try, the system is not correctly binding the AT24 driver to this device. Here is my DTS file being applied by torizoncore-builder:
// M24256 EEPROM (Motherboard) DTS.
/dts-v1/;
/plugin/;
// Note this will need to be adjusted according to
// the target I2C bus.
// I2C4 is I2C_1 (pins 12/14) on the Verdin dev board.
// I2C3 is I2C_2 (pins 95/93) on the Verdin dev board.
// Chip can appear at 0x50-57 depending on pin strapping,
// and 0x58 is the identification page.
&i2c3 {
m24256: at24@50 {
compatible = "st,24c256", "atmel,24c256";
pagesize = <64>;
size = <32768>;
reg = <0x50>;
status = "okay";
};
};
On reboot, there is now a node at /sys/bus/i2c/devices/2-0050/
(this is missing without the DTS being included) but it is not bound to any driver and no eeprom
file is present. dmesg | grep at24
only reveals entries for the 24c02 eeproms have been registered, not my 24c256. i2c-detect 2
confirms it’s not bound either - shows 50
instead of UU
The only way I can get it to bind and start working as expected is echo 2-0050 > /sys/bus/i2c/drivers/at24/bind
to manually force the driver to bind this address.
Note I have tried a number of variations of the compatible
line, none of which seem to have had any success.
Feels like I’m missing something obvious but I’m at a loss and the search terms I’ve tried using to find answers are too generic to net anything suitable to my issue.
Is there some magic that happens behind the scenes to make the various Toradex 24c02s “just work”? (Carrier board, SoM, DSI adapter all automatically bind the correct driver and have the SysFS eeprom
file)
As an interesting (but aside) data point we have also connected a 1-wire EEPROM to the development board via a bridge chip and it worked without any fuss as soon as I added the DTS entries.