Skip to content

arm64: dts: Sort out CM5 and I/O board I2C ports #6441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm4io.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-2.0

i2c_csi_dsi0: &i2c0 { // Note: For CAM0 and DISP0 connectors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the pinout, but CM5 only has 2 MIPI PHY ports, so do CAM0 and DISP0 actually connect to anything other than the I2C?

I'm sure Dominic made a comment in passing yesterday that CAM0 and DISP0 pins on the CM were repurposed for USB3.

Copy link
Contributor Author

@pelwell pelwell Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the connectivity table I ended up with:

CM5        CM4IO        CM5IO
---        -----        -----
DPHY0      CAM1         CAMDISP0
DPHY1      DISP1        CAMDISP1
GPIO0/1    CAM0, DISP0  CAMDISP1
GPIO38/39  CAM1, DISP1  CAMDISP0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that CAM0 and DISP0 are not usable for cameras or displays, which is the better of the two options because that I2C port is effectively shared with ID_SC and ID_SD. The i2c_csi_dsi0 parameter is there for compatibility with any existing I2C setup. i2c_csi_dsi1 (and its alias i2c_csi_dsi) is assigned to CAM1 and DISP1.

};

i2c_csi_dsi1: &i2c6 { // Note: For CAM1, DISP1, on-board RTC, and fan controller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And seeing as CAM1 and DISP1 share an I2C port, if the above is true about the MIPI wiring, that means we can't run two identical cameras or displays on CM5 with CM4IO (fine on CM5IO).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe that's correct.

pinctrl-0 = <&rp1_i2c6_38_39>;
pinctrl-names = "default";
clock-frequency = <100000>;
symlink = "i2c-6";
};

i2c_csi_dsi: &i2c_csi_dsi1 { }; // The connector that needs no jumper to enable

&aliases {
/delete-property/ i2c11;

Check failure on line 16 in arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm4io.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please, no spaces at the start of a line
i2c10 = &i2c_csi_dsi;

Check failure on line 17 in arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm4io.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: please, no spaces at the start of a line
};

// The RP1 USB3 interfaces are not usable on CM4IO

&rp1_usb0 {
status = "disabled";
};

&rp1_usb1 {
status = "disabled";
};
17 changes: 1 addition & 16 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5-cm4io.dts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@
/dts-v1/;

#include "bcm2712-rpi-cm5.dtsi"

// The RP1 USB3 interfaces are not usable on CM4IO

&rp1_usb0 {
status = "disabled";
};

&rp1_usb1 {
status = "disabled";
};

/ {
__overrides__ {
i2c_csi_dsi = <&i2c_csi_dsi>, "status";
};
};
#include "bcm2712-rpi-cm4io.dtsi"
7 changes: 1 addition & 6 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5-cm5io.dts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
/dts-v1/;

#include "bcm2712-rpi-cm5.dtsi"

/ {
__overrides__ {
i2c_csi_dsi = <&i2c_csi_dsi>, "status";
};
};
#include "bcm2712-rpi-cm5io.dtsi"
13 changes: 0 additions & 13 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,6 @@ aux: &dummy {};

#include "bcm2712-rpi.dtsi"

i2c_csi_dsi0: &i2c6 { // Note: This is for MIPI0 connector only
pinctrl-0 = <&rp1_i2c6_38_39>;
pinctrl-names = "default";
clock-frequency = <100000>;
symlink = "i2c-6";
};

i2c_csi_dsi1: &i2c0 { // Note: This is for MIPI1 connector
symlink = "i2c-11";
};

i2c_csi_dsi: &i2c_csi_dsi1 { }; // An alias for compatibility

cam1_reg: &cam0_reg { // Shares CAM_GPIO with cam0_reg
};

Expand Down
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5io.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0

i2c_csi_dsi1: &i2c0 { // Note: This is for CAM/DISP 1 connector
symlink = "i2c-11";
};

i2c_csi_dsi0: &i2c6 { // Note: This is for CAM/DISP 0 connector
pinctrl-0 = <&rp1_i2c6_38_39>;
pinctrl-names = "default";
clock-frequency = <100000>;
symlink = "i2c-6";
};

i2c_csi_dsi: &i2c_csi_dsi0 { }; // The connector that needs no jumper to enable
17 changes: 1 addition & 16 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5l-cm4io.dts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@
/dts-v1/;

#include "bcm2712-rpi-cm5l.dtsi"

// The RP1 USB3 interfaces are not usable on CM4IO

&rp1_usb0 {
status = "disabled";
};

&rp1_usb1 {
status = "disabled";
};

/ {
__overrides__ {
i2c_csi_dsi = <&i2c_csi_dsi>, "status";
};
};
#include "bcm2712-rpi-cm4io.dtsi"
7 changes: 1 addition & 6 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5l-cm5io.dts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
/dts-v1/;

#include "bcm2712-rpi-cm5l.dtsi"

/ {
__overrides__ {
i2c_csi_dsi = <&i2c_csi_dsi>, "status";
};
};
#include "bcm2712-rpi-cm5io.dtsi"
4 changes: 0 additions & 4 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5l.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

/ {
model = "Raspberry Pi Compute Module 5 Lite";

__overrides__ {
i2c_csi_dsi = <&i2c_csi_dsi>, "status";
};
};

&sd_io_1v8_reg {
Expand Down
Loading