[Arm-dev] No access to HAT i2c EEPROM

Tue Jun 16 00:59:29 UTC 2020
Stephan GUILLOUX <stephan.guilloux at free.fr>

Ok. Found it.

Our application is started via SYSTEMCTL at boot time.

In its starting script, I found (simplified view):

|       dtoverlay i2c-gpio i2c_gpio_sda=0 i2c_gpio_scl=1|

|       echo "24c32 0x50" > /sys/class/i2c-adapter/xxx/new_device|

|       hexdump -C /sys/class/i2c-adapter/i2c-3/3-0050/eeprom
|

|On 5.4.42, after the call to DTOVERLAY, the path "xxx" changes from 
"i2c-3" to "i2c-11" ...|

|Then, the ECHO fails, the HEXDUMP too and so on.
|

|
|

|2 years back, we took this part of code from EEPFLASH.SH 
(||https://github.com/raspberrypi/hats/tree/master/eepromutils)|

|This tool was updated 10 months back, to avoid conflicts on RPI4 
(||https://github.com/raspberrypi/hats/commit/42c532fcb2febf4fe57bde6511c31fc0d4515627), 
and now, it's written like|

|       dtoverlay i2c-gpio i2c_gpio_sda=0 i2c_gpio_scl=1 bus=10|

|
|

|This gave my an idea. If I force "bus=3", all works as expected, and 
I'm able to read the EEPROM.
|

|So, ... On 5.4.42, I would say that some i2c-related kernel module has 
changed its behavior, when "bus" parameter is not set, to avoid some 
conflict on RPI4 ...|

|
|

||

|
|

|Stephan.
|

|
|

||

||On 16-Jun-20 01:07, Stephan GUILLOUX wrote:

> Some progress.
>
> I reinstalled a SD and updated manually all the kernel RPMS that I can 
> find.
>
> Only last kernel has this change (5.4.28 is still ok).
>
>
>
> On 15-Jun-20 22:59, Stephan GUILLOUX wrote:
>
>> Hello all,
>>
>>
>> Maybe some will be able to help a bit.
>>
>> I'm running 2 Raspberries 3B+, with the same old CentOS image, 
>> freshly prepared.
>>
>> Both run raspberrypi2-kernel 4.19.xx
>>
>> Both Raspberry have a hat, with a valid EEPROM.
>>
>>
>> On both, the application I'm in charge of, has R/W access to
>>
>> /sys/class/i2c-adapter/i2c-3/3-0050/eeprom
>>
>>
>> On one Raspberry, I update the kernel and only the kernel (yum update 
>> raspberrypi2-kernel) and I come to 5.4.42.
>>
>> After reboot, the whole content of /sys/class has changed, regarding 
>> I2C.
>>
>> 4.19.94:
>>
>> [root at Raspberry-DD7BD7 OLD ~]$ ls -al /sys/bus/i2c/devices/
>> total 0
>> drwxr-xr-x. 2 root root 0 Jan  1  1970 .
>> drwxr-xr-x. 4 root root 0 Jan  1  1970 ..
>> lrwxrwxrwx. 1 root root 0 Jan  1  1970 3-0050 -> 
>> ../../../devices/platform/ffffffff.i2c/i2c-3/3-0050
>> lrwxrwxrwx. 1 root root 0 Jan  1  1970 i2c-3 -> 
>> ../../../devices/platform/ffffffff.i2c/i2c-3
>> [root at Raspberry-DD7BD7 OLD ~]$ ls -al /sys/bus/i2c/devices/3-0050/eeprom
>>
>> 5.4.42:
>>
>> [root at CertifBox-8AC500 OLD ~]$ ls -al /sys/class/i2c-adapter/
>> total 0
>> drwxr-xr-x.  2 root root 0 Jan  1  1970 .
>> drwxr-xr-x. 54 root root 0 Jan  1  1970 ..
>> lrwxrwxrwx.  1 root root 0 Jun 15 22:53 i2c-11 -> 
>> ../../devices/platform/ffffffff.i2c/i2c-11
>> [root at CertifBox-8AC500 OLD ~]$
>>
>>
>> Any idea where I can find this EEPROM file ?
>>
>> A module option, maybe ?
>>
>>
>> Regards,
>>
>> Stephan.
>>
>>
>>
>>
>> _______________________________________________
>> Arm-dev mailing list
>> Arm-dev at centos.org
>> https://lists.centos.org/mailman/listinfo/arm-dev
> _______________________________________________
> Arm-dev mailing list
> Arm-dev at centos.org
> https://lists.centos.org/mailman/listinfo/arm-dev