Skip to content

Conversation

@pelwell
Copy link
Contributor

@pelwell pelwell commented Oct 16, 2024

Older Pis arrange that the camera I2C ports appear as /dev/i2c-10. Add aliases so that on the Pi 5 family, i2c_csi_dsi0 becomes i2c-10 and i2c_csi_dsi1 becomes i2c-11. Only the I2C buses that appear on the 40-pin header, i.e. I2C0 to I2C3, get a low bus number.

Also add hints for our udev rules about which symlinks to create for backwards-compatibility with the previous bus numbers. Note that lower numbers have priority, so i2c-0 on CM5 masks i2c-11, forcing i2c-11 to be a symlink to i2c-0, not vice versa.

Older Pis arrange that the camera I2C ports appear as /dev/i2c-10. Add
aliases so that on the Pi 5 family, i2c_csi_dsi0 becomes i2c-10 and
i2c_csi_dsi1 becomes i2c-11. Only the I2C buses that appear on the
40-pin header, i.e. I2C0 to I2C3, get a low bus number.

Also add hints for our udev rules about which symlinks to create for
backwards-compatibility with the previous bus numbers. Note that
lower numbers have priority, so i2c-0 on CM5 masks i2c-11, forcing
i2c-11 to be a symlink to i2c-0, not vice versa.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell
Copy link
Contributor Author

pelwell commented Oct 16, 2024

A suitably updated /lib/udev/rules.d/60-i2c-tools.rules would be:

SUBSYSTEM=="i2c-dev",KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660", PROGRAM="/bin/sh -c '\
        DTNODE=/sys/class/i2c-dev/%k/device/of_node; \
        if [ -e $$DTNODE/symlink ]; then \
            cat $$DTNODE/symlink; \
        else \
            exit 1; \
        fi \
'", SYMLINK+="%c"

@pelwell
Copy link
Contributor Author

pelwell commented Oct 16, 2024

This is Pi 5 with this PR and the above udev rule:

$ ls -l /dev/i2c*
crw-rw---- 1 root i2c 89, 13 Oct 16 15:57 /dev/i2c-13
crw-rw---- 1 root i2c 89, 14 Oct 16 15:57 /dev/i2c-14
$ i2cdetect -l
i2c-13  i2c             107d508200.i2c                          I2C adapter
i2c-14  i2c             107d508280.i2c                          I2C adapter

$ sudo dtparam i2c_csi_dsi0
$ ls -l /dev/i2c*
crw-rw---- 1 root i2c  89, 10 Oct 16 15:58 /dev/i2c-10
crw-rw---- 1 root i2c  89, 13 Oct 16 15:57 /dev/i2c-13
crw-rw---- 1 root i2c  89, 14 Oct 16 15:57 /dev/i2c-14
lrwxrwxrwx 1 root root      6 Oct 16 15:58 /dev/i2c-6 -> i2c-10
$ i2cdetect -l
i2c-10  i2c             Synopsys DesignWare I2C adapter         I2C adapter
i2c-13  i2c             107d508200.i2c                          I2C adapter
i2c-14  i2c             107d508280.i2c                          I2C adapter

$ sudo dtparam i2c_csi_dsi1
$ ls -l /dev/i2c*
crw-rw---- 1 root i2c  89, 10 Oct 16 15:58 /dev/i2c-10
crw-rw---- 1 root i2c  89, 11 Oct 16 15:58 /dev/i2c-11
crw-rw---- 1 root i2c  89, 13 Oct 16 15:57 /dev/i2c-13
crw-rw---- 1 root i2c  89, 14 Oct 16 15:57 /dev/i2c-14
lrwxrwxrwx 1 root root      6 Oct 16 15:58 /dev/i2c-4 -> i2c-11
lrwxrwxrwx 1 root root      6 Oct 16 15:58 /dev/i2c-6 -> i2c-10
$ i2cdetect -l
i2c-10  i2c             Synopsys DesignWare I2C adapter         I2C adapter
i2c-11  i2c             Synopsys DesignWare I2C adapter         I2C adapter
i2c-13  i2c             107d508200.i2c                          I2C adapter
i2c-14  i2c             107d508280.i2c                          I2C adapter

@pelwell pelwell merged commit 36faab6 into raspberrypi:rpi-6.6.y Oct 17, 2024
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 18, 2024
See: raspberrypi/linux#6421

kernel: Fixes for video-mux with Pi5
See: raspberrypi/linux#6410

kernel: OV5647 link frequency control
See: raspberrypi/linux#6423

kernel: CQE incremental fixes part 2
See: raspberrypi/linux#6419
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 18, 2024
See: raspberrypi/linux#6421

kernel: Fixes for video-mux with Pi5
See: raspberrypi/linux#6410

kernel: OV5647 link frequency control
See: raspberrypi/linux#6423

kernel: CQE incremental fixes part 2
See: raspberrypi/linux#6419
pelwell added a commit to pelwell/linux that referenced this pull request Oct 24, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: raspberrypi#6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit to pelwell/linux that referenced this pull request Oct 24, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: raspberrypi#6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this pull request Oct 30, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this pull request Nov 4, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this pull request Nov 4, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 5, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 6, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 8, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 11, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 18, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 18, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this pull request Nov 25, 2024
There is a difference in I2C usage between CM4IO and CM5IO. Present a
simple, consistent view of the world by moving the assignment of the
bus IDs into carrier-specific files.

CM5 has reduced connectivity on CM4IO - the DPHYs are connected to
CAM1 and DISP1. Keep i2c-10 for use with that pair, as is the case for
CM4 on CM4IO.

Fixes: 36faab6 ("dts: bcm2712-rpi: Add aliases for the CSI/DSI I2Cs")
See: #6421

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant