Hello everyone,
how to fix the I2C device names under Ubuntu 20.04.3 LTS (focal)???
The i2c devices are randomly assigned and not ordered by hardware id’s.
Between two boot actions:
…
root@eofmc:/lib/udev/rules.d# ls -la /sys/bus/i2c/devices/
total 0
drwxr-xr-x 2 root root 0 Nov 7 18:20 .
drwxr-xr-x 4 root root 0 Nov 7 18:20 …
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-0 -> …/…/…/devices/pci0000:00/0000:00:17.0/i2c_designware.0/i2c-0
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-1 -> …/…/…/devices/pci0000:00/0000:00:1f.1/i2c-1
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-2 -> …/…/…/devices/pci0000:00/0000:00:17.1/i2c_designware.1/i2c-2
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-3 -> …/…/…/devices/pci0000:00/0000:00:17.2/i2c_designware.2/i2c-3
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-4 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-4
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-5 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-5
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-6 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-6
lrwxrwxrwx 1 root root 0 Nov 7 18:20 i2c-7 -> …/…/…/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1/i2c-7
…
root@eofmc:/mnt/ssd/projects# ls -la /sys/bus/i2c/devices/
total 0
drwxr-xr-x 2 root root 0 Nov 7 18:54 .
drwxr-xr-x 4 root root 0 Nov 7 18:54 …
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-0 -> …/…/…/devices/pci0000:00/0000:00:17.0/i2c_designware.0/i2c-0
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-1 -> …/…/…/devices/pci0000:00/0000:00:17.1/i2c_designware.1/i2c-1
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-2 -> …/…/…/devices/pci0000:00/0000:00:17.2/i2c_designware.2/i2c-2
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-3 -> …/…/…/devices/pci0000:00/0000:00:1f.1/i2c-3
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-4 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-4
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-5 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-5
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-6 -> …/…/…/devices/pci0000:00/0000:00:02.0/i2c-6
lrwxrwxrwx 1 root root 0 Nov 7 18:54 i2c-7 -> …/…/…/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1/i2c-7
Baozhu
November 8, 2021, 6:05am
#2
@britus-eragon thank you for your feedback, we will fix it in the further BIOS version.
Hi Baozhu,
thank you for your reply. This is not a good news. If I don’t want to write additional code, such as auto-detection via all existing I2C interfaces, the board is currently useless for my project.
BTW: I have a Odyssey Blue J4105 with 128GB and SD Slot.
When can I expect a new BIOS version?
Is the BIOS open source?
How safe and stable is a BIOS update?
Best regards
Thank you for your reply. So, do you have a rule set for this problem. I already had this idea. Unfortunately, my rules don’t work.
SUBSYSTEM==“pci”, KERNELS==“0000:00:17.0” ACTION==“add” NAME=“i2c_designware.0”
SUBSYSTEM==“pci”, KERNELS==“0000:00:17.1” ACTION==“add” NAME=“i2c_designware.1”
SUBSYSTEM==“pci”, KERNELS==“0000:00:17.2” ACTION==“add” NAME=“i2c_designware.2”
SUBSYSTEM==“platform”, KERNELS==“i2c_designware.0” ACTION==“add” NAME=“i2c-0” SYMLINK+=“i2c.0”
SUBSYSTEM==“platform”, KERNELS==“i2c_designware.1” ACTION==“add” NAME=“i2c-1” SYMLINK+=“i2c.1”
SUBSYSTEM==“platform”, KERNELS==“i2c_designware.2” ACTION==“add” NAME=“i2c-2” SYMLINK+=“i2c.2”
Hi,
So I think I have the problem solved. After several boot cycles the I2C seems to be fixed for the designware chip, but the second part (symlinks) will not work
Part-1 ---------------
ACTION==“add” SUBSYSTEMS==“pci” KERNELS==“0000:00:17.0” ATTRS{vendor}==“0x8086” ATTRS{class}==“0x118000” ATTRS{device}==“0x31b4” NAME=“i2c_designware.0”
ACTION==“add” SUBSYSTEMS==“pci” KERNELS==“0000:00:17.1” ATTRS{vendor}==“0x8086” ATTRS{class}==“0x118000” ATTRS{device}==“0x31b6” NAME=“i2c_designware.1”
ACTION==“add” SUBSYSTEMS==“pci” KERNELS==“0000:00:17.2” ATTRS{vendor}==“0x8086” ATTRS{class}==“0x118000” ATTRS{device}==“0x31b8” NAME=“i2c_designware.2”
Part-2 ----------------------------------------
ACTION==“add”, SUBSYSTEM==“platform” KERNEL==“i2c_designware.0” SYMLINK+=“i2c-adc”
ACTION==“add”, SUBSYSTEM==“platform” KERNEL==“i2c_designware.1” SYMLINK+=“i2c-rly”
ACTION==“add”, SUBSYSTEM==“platform” KERNEL==“i2c_designware.2” SYMLINK+=“i2c-dac”
hmmm event not. after the 10th boot, the devices not ordered. now I’m at a loss.