Using raspi cam v2 with cm3

Hi,

i am trying to use a raspberry pi camera v2 with the csi-2 interface of the cm3.

On the cm3 io board i would need an adapter, since the flat cable used with the pi camera has a different connector than the io board. Is there any readily available adapter for this?

I then proceeded to setup the cm3 with a raspberry pi cm4 io board and said raspi cam. The corresponding device tree for cm3 on cm4 io lists the CSI ports as disabled. If i enable them, i still get no mention of mipi, csi or /dev/video* devices after bootup.

Could someone please advise how to set up the raspberry pi camera v2 on a cm3 with cm4 io board? (Using 2 lanes mipi csi)

Well i got a little further. I recompiled the rockchip-bsp kernel to contain the imx219 driver.

The following device-tree makes /dev/video devices pop up:

#include "rk3566-radxa-rock-3-compute-module.dtsi"

/ {
	model = "Radxa CM3 RPI CM4 IO";
	compatible = "radxa,radxa-cm3-rpi-cm4-io", "rockchip,rk3566";

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwren>;
		regulator-name = "vcc_sd";
		regulator-always-on;
	};
};

&gpio_leds {
	pi-led-green {
		gpios = <&gpio4 4 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "timer";
		default-state = "on";
		pinctrl-0 = <&pi_led>;
	};

	pwr-led-red {
		gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "none";
		default-state = "on";
		pinctrl-0 = <&pwr_led>;
	};
};

&sdmmc0 {
	max-frequency = <150000000>;
	supports-sd;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	sd-uhs-sdr104;
	vmmc-supply = <&vcc_sd>;
	vqmmc-supply = <&vccio_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
	status = "okay";
};

&pcie2x1 {
	reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
	vpcie3v3-supply = <&vcc3v3_sys>;
	pinctrl-0 = <&pcie20m2_pins>;
	status = "okay";
};

&pinctrl {
	leds {
		pi_led: pi-led {
			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		pwr_led: pwr-led {
			rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sdcard {
		sdmmc_pwren: sdmmc-pwren {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&i2c2 {
		pinctrl-0 = <0x1d9>;
		status = "okay";
        imx219_1: sensor@10 {
        	status = "okay";
            compatible = "sony,imx219";
            reg = <0x10>; //i2c addr
            clocks = <&cru CLK_CAM0_OUT>; //0x1f -> cru ,214 -> CLK_CIF_OUT
            pinctrl-names = "rockchip,camera_default";
            pinctrl-0 = <&cam_clkout0>;

            power-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;

            rockchip,camera-module-index = <0>;
            rockchip,camera-module-name = "IMX219 1";

            port {
                imx219_out2: endpoint {
                    remote-endpoint = <&dphy1_in>;
                    data-lanes = <1 2>;
                };
            };
        };
};

&i2c0 {
		status = "okay";
        imx219_2: sensor@10 {
        	status = "okay";
            compatible = "sony,imx219";
            reg = <0x10>; //i2c addr
            clocks = <&cru CLK_CAM1_OUT>; //0x1f -> cru ,214 -> CLK_CIF_OUT
            pinctrl-names = "rockchip,camera_default";
            pinctrl-0 = <&cam_clkout1>;

            power-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;

            rockchip,camera-module-index = <1>;
            rockchip,camera-module-name = "IMX219 2";

            port {
                imx219_out1: endpoint {
                    remote-endpoint = <&dphy2_in>;
                    data-lanes = <1 2>;
                };
            };
        };
};

&csi2_dphy0 {
         status = "disabled";
};

&csi2_dphy1 {
        status = "okay";
        /*
        * dphy1 only used for split mode,
        * can be used  concurrently  with dphy2
        * full mode and split mode are mutually exclusive
        */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_in: endpoint@1 {
                                        reg = <1>;
                                        remote-endpoint = <&imx219_out1>;
                                        data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_out: endpoint@1 {
                                        reg = <1>;
                                        remote-endpoint = <&isp0_in>;
                        };
                };
        };
};

&csi2_dphy2 {
        status = "okay";
        /*
        * dphy2 only used for split mode,
        * can be used  concurrently  with dphy1
        * full mode and split mode are mutually exclusive
        */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy2_in: endpoint@1 {
                                        reg = <1>;
                                        remote-endpoint = <&imx219_out2>;
                                        data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy2_out: endpoint@1 {
                                        reg = <1>;
                                        remote-endpoint = <&mipi_csi2_input>;
                        };
                };
        };
};

&csi2_dphy_hw {
      status = "okay";
};

&mipi_csi2 {
    status = "okay";

    ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                    reg = <0>;
                    #address-cells = <1>;
                    #size-cells = <0>;

                    mipi_csi2_input: endpoint@1 {
                                    reg = <1>;
                                    remote-endpoint = <&dphy2_out>;
                                    data-lanes = <1 2>;
                    };
            };

            port@1 {
                    reg = <1>;
                    #address-cells = <1>;
                    #size-cells = <0>;

                    mipi_csi2_output: endpoint@0 {
                                    reg = <0>;
                                    remote-endpoint = <&cif_mipi_in>;
                                    data-lanes = <1 2>;
                    };
            };
    };
};

&rkcif_mipi_lvds {
        status = "okay";
        port {
                cif_mipi_in: endpoint {
                        remote-endpoint = <&mipi_csi2_output>;
                        data-lanes = <1 2>;
                };
        };
};

&rkcif_mipi_lvds_sditf {
        status = "okay";
        port {
                mipi_lvds_sditf: endpoint {
                        remote-endpoint = <&isp1_in>;
                        data-lanes = <1 2>;
                };
        };
};

&rkisp {
        status = "okay";
};

&rkisp_mmu {
        status = "okay";
};

&rkisp_vir0 {
        status = "okay";
        port {
                #address-cells = <1>;
                #size-cells = <0>;

                isp0_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy1_out>;
                };
        };
};

&rkisp_vir1 {
        status = "okay";

        port {
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <0>;

                isp1_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&mipi_lvds_sditf>;
                };
        };
};

&rkcif_mmu {
    status = "okay";
};

&rkcif {
    status = "okay";
};

&uart1 {
	status = "disabled";
};

Topology:

media-ctl --print-topology
Media controller API version 4.19.193

Media device information
------------------------
driver          rkisp-vir0
model           rkisp0
serial          
bus info        
hw revision     0x0
driver version  4.19.193

Device topology
- entity 1: rkisp-isp-subdev (4 pads, 7 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		[fmt:SBGGR10_1X10/800x600 field:none
		 crop.bounds:(0,0)/800x600
		 crop:(0,0)/800x600]
		<- "rkisp-csi-subdev":1 [ENABLED]
		<- "rkisp_rawrd0_m":0 []
		<- "rkisp_rawrd2_s":0 []
	pad1: Sink
		<- "rkisp-input-params":0 [ENABLED]
	pad2: Source
		[fmt:YUYV8_2X8/800x600 field:none colorspace:smpte170m quantization:full-range
		 crop.bounds:(0,0)/800x600
		 crop:(0,0)/800x600]
		-> "rkisp_mainpath":0 [ENABLED]
		-> "rkisp_selfpath":0 [ENABLED]
	pad3: Source
		-> "rkisp-statistics":0 [ENABLED]

- entity 6: rkisp-csi-subdev (6 pads, 5 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "rockchip-csi2-dphy1":1 [ENABLED]
	pad1: Source
		-> "rkisp-isp-subdev":0 [ENABLED]
	pad2: Source
		-> "rkisp_rawwr0":0 [ENABLED]
	pad3: Source
	pad4: Source
		-> "rkisp_rawwr2":0 [ENABLED]
	pad5: Source
		-> "rkisp_rawwr3":0 [ENABLED]

- entity 13: rkisp_mainpath (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video0
	pad0: Sink
		<- "rkisp-isp-subdev":2 [ENABLED]

- entity 19: rkisp_selfpath (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "rkisp-isp-subdev":2 [ENABLED]

- entity 25: rkisp_rawwr0 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video2
	pad0: Sink
		<- "rkisp-csi-subdev":2 [ENABLED]

- entity 31: rkisp_rawwr2 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video3
	pad0: Sink
		<- "rkisp-csi-subdev":4 [ENABLED]

- entity 37: rkisp_rawwr3 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video4
	pad0: Sink
		<- "rkisp-csi-subdev":5 [ENABLED]

- entity 43: rkisp_rawrd0_m (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video5
	pad0: Source
		-> "rkisp-isp-subdev":0 []

- entity 49: rkisp_rawrd2_s (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video6
	pad0: Source
		-> "rkisp-isp-subdev":0 []

- entity 55: rkisp-statistics (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video7
	pad0: Sink
		<- "rkisp-isp-subdev":3 [ENABLED]

- entity 61: rkisp-input-params (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video8
	pad0: Source
		-> "rkisp-isp-subdev":1 [ENABLED]

- entity 67: rockchip-csi2-dphy1 (2 pads, 1 link)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev2
	pad0: Sink
	pad1: Source
		-> "rkisp-csi-subdev":0 [ENABLED]

However the following errors in syslog still prevent me from capturing any images:

[    1.311128] rk-pcie 3c0000000.pcie: PCIe Linking... LTSSM is 0x1
[    1.684509] rk3x-i2c fdd40000.i2c: timeout, ipd: 0x00, state: 1
[    1.684548] fan53555-regulator 0-001c: Failed to get chip ID!
[    1.684658] fan53555-regulator: probe of 0-001c failed with error -110
[    2.324453] rk-pcie 3c0000000.pcie: PCIe Linking... LTSSM is 0x0
[    2.697784] rk3x-i2c fdd40000.i2c: timeout, ipd: 0x00, state: 1
[    2.697825] rk808 0-0020: failed to read the chip id at 0x17
[    2.698026] rk808: probe of 0-0020 failed with error -110
[    2.700845] imx219 0-0010: driver version: 00.01.02
[    2.700890] imx219 0-0010: could not get module information!
[    2.700921] imx219: probe of 0-0010 failed with error -22
[    2.701114] imx219 2-0010: driver version: 00.01.02
[    2.701153] imx219 2-0010: could not get module information!
[    2.701182] imx219: probe of 2-0010 failed with error -22
[    2.702809] iommu: Adding device fdff0000.rkisp to group 8
[    2.702865] rkisp_hw fdff0000.rkisp: Linked as a consumer to fdff1a00.iommu
[    2.703147] rkisp_hw fdff0000.rkisp: is_thunderboot: 0
[    2.703180] rkisp_hw fdff0000.rkisp: max input:0x0@0fps
[    2.703218] rkisp_hw fdff0000.rkisp: can't request region for resource [mem 0xfdff0000-0xfdffffff]
[    2.704227] rkisp rkisp-vir0: rkisp driver version: v01.06.01
[    2.704370] rkisp rkisp-vir0: No memory-region-thunderboot specified
[    2.704681] rkisp rkisp-vir0: Entity type for entity rkisp-isp-subdev was not initialized!
[    2.704712] rkisp rkisp-vir0: Entity type for entity rkisp-csi-subdev was not initialized!
[    2.707002] rkisp rkisp-vir1: rkisp driver version: v01.06.01
[    2.707154] rkisp rkisp-vir1: No memory-region-thunderboot specified
[    2.707372] rkisp rkisp-vir1: Entity type for entity rkisp-isp-subdev was not initialized!
[    2.707410] rkisp rkisp-vir1: Entity type for entity rkisp-csi-subdev was not initialized!
...
[    2.869332] rkisp rkisp-vir0: clear unready subdev num: 1
[    2.869358] rockchip-csi2-dphy1: No link between dphy and sensor
[    2.870118] rockchip-csi2-dphy1: No link between dphy and sensor
[    2.870139] rkisp-vir0: update sensor failed
[    2.870158] rkisp rkisp-vir1: clear unready subdev num: 1
[    2.870539] rkisp-vir1: update sensor failed
...
[  559.237208] rkisp-vir0: nonsupport pixelformat:
[  559.241052] rockchip-csi2-dphy1: No link between dphy and sensor
[  559.241064] rkisp-vir0: update sensor info failed -19

Does anyone know what could be the cause?

There is this post from earlier:

But the only answer is more of a follow up question than an answer: What is with the power supply node for the csi interface?

This is our latest progress:
Camera 1 outputs a picture.
CSI Lanes 2 and 3 have been rerouted to cam0 on the CM4 IO board. Cam 0 is driven by csi clk 1.
i2c4 has been rerouted to cam0 on the cm4 io board. i2cdetect properly shows both cams on their respective i2c buses and claimed by th imx219 driver. (which is built into the kernel)
Somehow only cam1 is able to capture pictures. It works on both /dev/video0 and /dev/video1.
The device is running a local build of the rockchip kernel stable-4.19-rock3
Following are debug infos, if you require anything further, just let me know.

Please note that for the sake of character and consecutive-post limits aswell as file ending restrictions i was unable to attach full dmesg and v4l2 topology infos.

dmesg excerpts:

[    0.552216] imx219 2-0010: driver version: 00.01.02
[    0.576895] imx219 2-0010: Model ID 0x0219, Lot ID 0x038b40, Chip ID 0x0177
[    0.577135] imx219 4-0010: driver version: 00.01.02
[    0.601767] imx219 4-0010: Model ID 0x0219, Lot ID 0x038b40, Chip ID 0x0071
[    0.603271] iommu: Adding device fdff0000.rkisp to group 1
[    0.603336] rkisp_hw fdff0000.rkisp: Linked as a consumer to fdff1a00.iommu
[    0.603554] rkisp_hw fdff0000.rkisp: is_thunderboot: 0
[    0.603587] rkisp_hw fdff0000.rkisp: max input:0x0@0fps
[    0.603635] rkisp_hw fdff0000.rkisp: can't request region for resource [mem 0xfdff0000-0xfdffffff]
[    0.604525] rkisp rkisp-vir0: rkisp driver version: v01.06.01
[    0.604661] rkisp rkisp-vir0: No memory-region-thunderboot specified
[    0.604937] rkisp rkisp-vir0: Entity type for entity rkisp-isp-subdev was not initialized!
[    0.604979] rkisp rkisp-vir0: Entity type for entity rkisp-csi-subdev was not initialized!
[    0.607217] rockchip-csi2-dphy csi2-dphy1: dphy1 matches m00_b_imx219 4-0010:bus type 4
[    0.608054] rkisp-vir0: Async subdev notifier completed
[    0.608208] rkisp rkisp-vir1: rkisp driver version: v01.06.01
[    0.608348] rkisp rkisp-vir1: No memory-region-thunderboot specified
[    0.608565] rkisp rkisp-vir1: Entity type for entity rkisp-isp-subdev was not initialized!
[    0.608604] rkisp rkisp-vir1: Entity type for entity rkisp-csi-subdev was not initialized!
...
[   66.761816] rkisp-vir0: nonsupport pixelformat:
[   66.771996] rkisp rkisp-vir0: can not get first iq setting in stream on
[   66.772035] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[   66.772077] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[   67.029223] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[   67.029236] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1
[   71.175995] rkisp-vir0: nonsupport pixelformat:
[   71.186230] rkisp rkisp-vir0: can not get first iq setting in stream on
[   71.186270] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[   71.186310] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[   71.442552] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[   71.442565] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1
[   75.305976] rkisp-vir0: nonsupport pixelformat:
[   75.316242] rkisp rkisp-vir0: can not get first iq setting in stream on
[   75.316281] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[   75.316322] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[   75.570991] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[   75.571004] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1
[   80.629904] rkisp-vir0: nonsupport pixelformat:
[   80.640088] rkisp rkisp-vir0: can not get first iq setting in stream on
[   80.640127] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[   80.640167] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[   80.894540] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[   80.894554] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1
[  130.021324] rkisp-vir0: nonsupport pixelformat:
[  130.031647] rkisp rkisp-vir0: can not get first iq setting in stream on
[  130.031690] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[  130.031731] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[  130.288746] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[  130.288759] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1
[  134.266697] rkisp-vir0: nonsupport pixelformat:
[  134.277074] rkisp rkisp-vir0: can not get first iq setting in stream on
[  134.277116] rockchip-csi2-dphy1: dphy1, data_rate_mbps 912
[  134.277156] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:1, dphy1
[  134.534238] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream_stop stream stop, dphy1
[  134.534252] rockchip-csi2-dphy csi2-dphy1: csi2_dphy_s_stream stream on:0, dphy1

DTB:

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
 * Copyright (c) 2021 Radxa Limited.
 *
 */

/dts-v1/;

#include "rk3566-radxa-rock-3-compute-module.dtsi"

/ {
	model = "Radxa CM3 RPI CM4 IO";
	compatible = "radxa,radxa-cm3-rpi-cm4-io", "rockchip,rk3566";

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwren>;
		regulator-name = "vcc_sd";
		regulator-always-on;
	};
	        imx219_vana_2v8: 2p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vana";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
                regulator-always-on;
        };

        imx219_vdig_1v8: 1p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vdig";
                regulator-min-microvolt = <1500000>;
                regulator-max-microvolt = <1500000>;
                regulator-always-on;
        };

        imx219_vddl_1v2: 1p2v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vddl";
                regulator-min-microvolt = <1200000>;
                regulator-max-microvolt = <1200000>;
                regulator-always-on;
        };

	cam24m: cam24m {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
		clock-output-names = "cam24m";
	};

};

&gpio_leds {
	pi-led-green {
		gpios = <&gpio4 4 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "timer";
		default-state = "on";
		pinctrl-0 = <&pi_led>;
	};

	pwr-led-red {
		gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "none";
		default-state = "on";
		pinctrl-0 = <&pwr_led>;
	};
};

&sdmmc0 {
	max-frequency = <150000000>;
	supports-sd;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	sd-uhs-sdr104;
	vmmc-supply = <&vcc_sd>;
	vqmmc-supply = <&vccio_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
	status = "okay";
};

&pcie2x1 {
	reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
	vpcie3v3-supply = <&vcc3v3_sys>;
	pinctrl-0 = <&pcie20m2_pins>;
	status = "okay";
};

&pinctrl {
	leds {
		pi_led: pi-led {
			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		pwr_led: pwr-led {
			rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sdcard {
		sdmmc_pwren: sdmmc-pwren {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pinctrl {
        cam {
                camera_pwr: camera-pwr {
                        rockchip,pins =
                                /* camera power en */
                                <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
};

&gpio4 {
	cam_power {
		gpio-hog;
		gpios = <RK_PC1 GPIO_ACTIVE_HIGH>;
		output-high;
	};
};

&i2c0 {
	status = "disabled";
	};

&i2c2 {
        status = "okay";
        pinctrl-names = "default";

        pinctrl-0 = <&i2c2m1_xfer>;
        imx219_1: imx219-0@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;
                clocks = <&cru CLK_CIF_OUT>;
                clock-names = "xvclk";


                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

              
                power-domains = <&power RK3568_PD_VI>;
 
                rockchip,camera-module-index = <1>;
                rockchip,camera-module-facing = "back";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out1: endpoint {
                                remote-endpoint = <&dphy2_in>;
                                data-lanes = <3 4>;
                                                        clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                        };
                };
        };
};

&i2c4 {
        status = "okay";

        imx219_2: imx219-1@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;

                clocks = <&cru CLK_CIF_OUT>
;                clock-names = "xvclk";


                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

                power-domains = <&power RK3568_PD_VI>;

                rockchip,camera-module-index = <0>;
                rockchip,camera-module-facing = "back";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out2: endpoint {
                                remote-endpoint = <&dphy1_in>;
                                data-lanes = <1 2>;
                                 clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                         };
                };
        };
};
&csi2_dphy_hw {
        status = "okay";
};
&csi2_dphy0 {
         status = "disabled";
};

&csi2_dphy1 {
        status = "okay";

        /*
         * dphy1 only used for split mode,
         * can be used  concurrently  with dphy2
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;
                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out2>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_out: endpoint@1 {
                               reg = <1>;
                                remote-endpoint = <&isp0_in>;
                        };
                };
        };
};
&csi2_dphy2 {
        status = "okay";

        /*
         * dphy2 only used for split mode,
         * can be used  concurrently  with dphy1
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy2_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out1>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                       #size-cells = <0>;

                        dphy2_out: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&mipi_csi2_input>;
                        };
                };
        };
};

&mipi_csi2 {
        status = "okay";

        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        mipi_csi2_input: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&dphy2_out>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        mipi_csi2_output: endpoint@0 {
                                reg = <0>;
                                remote-endpoint = <&cif_mipi_in>;
                                data-lanes = <1 2>;
                        };
                };
        };
};

&rkcif {
        status = "okay";
};

&rkcif_mipi_lvds {
        status = "okay";

        port {
                cif_mipi_in: endpoint {
                        remote-endpoint = <&mipi_csi2_output>;
                        data-lanes = <1 2>;

                };
        };
};


&rkcif_mipi_lvds_sditf {
        status = "okay";
        port {
                mipi_lvds_sditf: endpoint {
                        remote-endpoint = <&isp1_in>;
                        data-lanes = <1 2>;
                };
        };
};

&rkcif_mmu {
        status = "okay";
};

&rkisp {
        status = "okay";
};

&rkisp_mmu {
        status = "okay";
};

&rkisp_vir0 {
        status = "okay";

        port {
                #address-cells = <1>;
                #size-cells = <0>;

                isp0_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy1_out>;
                };
        };
};


&rkisp_vir1 {
        status = "okay";

        port {
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <0>;

                isp1_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&mipi_lvds_sditf>;
                };
        };
};

Did you manage to make the camera work?

Please have a look at those two posts right above yours, CAM1 is now working, cam0 still is not.

imx219_1: imx219-0@10 {

port {
imx219_out1: endpoint {
remote-endpoint = <&dphy2_in>;
data-lanes = <3 4>; // change to the follow line and try again
data-lanes = <1 2>;

Yes, thank you, i have left that in during experimenting.

After further debugging and realizing the CIF driver was missing from the kconfig, we have now finally also switched to a radxa cm3 v1.3 instead of the 1.1 i was using before. The raspi cm4 io board was also reverted to a pristine one.

CAM1 (lanes 1,2 - csi clock 0) works if it is hooked up via i2c4, because i2c0 is always dead and cannot be probed. Probing it results in timeouts.

However CAM0 still does not work. It is possible to start a stream, which results in an empty output file, but will run endlessly if not manually stopped:

rock@radxa-cm3-io:~$ v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=‘NV12’ --stream-mmap=4 --set-selection=target=crop,flags=0,top=0,left=0,width=1920,height=1080 --stream-to=./out.yuv >> stream.txt
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
[ 1910.163101] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream on, src_sd: 00000000d381617c, sd_name:rockchip-csi2-dphy2
[ 1910.163160] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream ON
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 3110400 ts: 1910.367886 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 3110400 ts: 1910.401266 delta: 33.380 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 3110400 ts: 1910.434649 delta: 33.383 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 3110400 ts: 1910.468037 delta: 33.388 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 4 bytesused: 3110400 ts: 1910.501414 delta: 33.377 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 5 bytesused: 3110400 ts: 1910.534798 delta: 33.384 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 6 bytesused: 3110400 ts: 1910.568179 delta: 33.381 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 7 bytesused: 3110400 ts: 1910.601561 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 8 bytesused: 3110400 ts: 1910.634940 delta: 33.379 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 9 bytesused: 3110400 ts: 1910.668326 delta: 33.386 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 10 bytesused: 3110400 ts: 1910.701709 delta: 33.383 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 11 bytesused: 3110400 ts: 1910.735093 delta: 33.384 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 12 bytesused: 3110400 ts: 1910.768475 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 13 bytesused: 3110400 ts: 1910.801857 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 14 bytesused: 3110400 ts: 1910.835240 delta: 33.383 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 15 bytesused: 3110400 ts: 1910.868620 delta: 33.380 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 16 bytesused: 3110400 ts: 1910.902007 delta: 33.387 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 17 bytesused: 3110400 ts: 1910.935389 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 18 bytesused: 3110400 ts: 1910.968771 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 19 bytesused: 3110400 ts: 1911.002154 delta: 33.383 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 20 bytesused: 3110400 ts: 1911.035536 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 21 bytesused: 3110400 ts: 1911.068918 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 22 bytesused: 3110400 ts: 1911.102301 delta: 33.383 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 23 bytesused: 3110400 ts: 1911.135684 delta: 33.383 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 24 bytesused: 3110400 ts: 1911.169066 delta: 33.382 ms fps: 29.96 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 25 bytesused: 3110400 ts: 1911.202450 delta: 33.384 ms fps: 29.96 (ts-monotonic, ts-src-eof)
^C[ 1911.243653] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream off, src_sd: 00000000d381617c, sd_name:rockchip-csi2-dphy2
[ 1911.243694] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream OFF

If i try to get a single image from the cam afterwards, i get fifo overflows:

[ 1745.655332] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.655352] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.655372] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.655392] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.655412] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.655431] rkcif_mipi_lvds: ERROR: csi fifo overflow, intstat:0x30000, lastline:41!!
[ 1745.684305] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream off, src_sd: 00000000d381617c, sd_name:rockchip-csi2-dphy2
[ 1745.684355] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream OFF
[ 1745.685407] rockchip-csi2-dphy csi2-dphy2: csi2_dphy_s_stream_stop stream stop, dphy2
[ 1745.685417] rockchip-csi2-dphy csi2-dphy2: csi2_dphy_s_stream stream on:0, dphy2
[ 1745.685440] rockchip-csi2-dphy csi2-dphy2: csi2_dphy_s_stream stream on:0, dphy2
[ 1745.688386] rkcif_mipi_lvds: stream[0] stopping finished

This is the device list from v4l2-ctl --list-devices:

rkisp-statistics (platform: rkisp):
/dev/video12
/dev/video13
/dev/video21
/dev/video22

rkcif_mipi_lvds (platform:rkcif):
/dev/media0

rkcif (platform:rkcif_mipi_lvds):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/video4

rkisp_mainpath (platform:rkisp-vir0):
/dev/video5
/dev/video6
/dev/video7
/dev/video8
/dev/video9
/dev/video10
/dev/video11
/dev/media1

rkisp_mainpath (platform:rkisp-vir1):
/dev/video14
/dev/video15
/dev/video16
/dev/video17
/dev/video18
/dev/video19
/dev/video20
/dev/media2

This is what streamer does when trying to capture a single frame, it locks up until manually cancelled:

rock@radxa-cm3-io:~$ streamer -o 5.jpeg -c /dev/video0 > streamer files / video: JPEG (JFIF) / audio: none
[ 52.666544] rkcif_mipi_lvds: can not find output format: 0x0
[ 52.666598] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream on, src_sd: 00000000c6146c14, sd_name:rockchip-csi2-dphy2
[ 52.666658] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream ON
v4l2: oops: select timeout
^C^C - one moment please
v4l2: oops: select timeout
[ 65.524515] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream off, src_sd: 00000000c6146c14, sd_name:rockchip-csi2-dphy2
[ 65.524551] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream OFF
[ 65.524597] rockchip-mipi-csi2: ERR1: crc errors, reg: 0x1000000, cnt:1
rock@radxa-cm3-io:~$ streamer -o 5.jpeg -c /dev/video0 > streamer
files / video: JPEG (JFIF) / audio: none
[ 70.616525] rkcif_mipi_lvds: can not find output format: 0x0
[ 70.616580] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream on, src_sd: 00000000c6146c14, sd_name:rockchip-csi2-dphy2
[ 70.616642] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream ON
v4l2: oops: select timeout
v4l2: oops: select timeout
^C^C - one moment please
v4l2: oops: select timeout
[ 90.404503] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream off, src_sd: 00000000c6146c14, sd_name:rockchip-csi2-dphy2
[ 90.404539] rockchip-mipi-csi2 fdfb0000.mipi-csi2: stream OFF
[ 90.404585] rockchip-mipi-csi2: ERR1: crc errors, reg: 0x1000000, cnt:1
rock@radxa-cm3-io:~$ 0/0, video 0/16, convert 0/0

Here is an excerpt from dmesg:

[ 0.230854] rockchip-csi2-dphy csi2-dphy2: csi2 dphy2 probe successfully!
[ 0.230995] rockchip-csi2-dphy-hw fe870000.csi2-dphy-hw: csi2 dphy hw probe successfully!
[ 7.580138] imx219 2-0010: driver version: 00.01.02
[ 7.604721] imx219 2-0010: Model ID 0x0219, Lot ID 0x038b40, Chip ID 0x0177
[ 7.606001] rockchip-mipi-csi2: probe success, v4l2_dev:(null)!
[ 7.606699] rkcifhw fdfe0000.rkcif: Linked as a consumer to fdfe0800.iommu
[ 7.607336] rkcifhw fdfe0000.rkcif: can’t request region for resource [mem 0xfdfe0000-0xfdfe7fff]
[ 7.607793] rkcif rkcif_mipi_lvds: rkcif driver version: v00.01.0a
[ 7.607873] rkcif rkcif_mipi_lvds: attach to cif hw node
[ 7.609055] rkcif rkcif_mipi_lvds: Entity type for entity rockchip-mipi-csi2 was not initialized!
[ 7.609086] rockchip-mipi-csi2: Async registered subdev
[ 7.609122] rockchip-csi2-dphy csi2-dphy2: dphy2 matches m01_f_imx219 2-0010:bus
type 4
[ 7.609723] rkcif_mipi_lvds: Async subdev notifier completed
[ 7.611941] rkisp_hw fdff0000.rkisp: Linked as a consumer to fdff1a00.iommu
[ 7.612162] rkisp_hw fdff0000.rkisp: is_thunderboot: 0
[ 7.612192] rkisp_hw fdff0000.rkisp: max input:0x0@0fps
[ 7.612233] rkisp_hw fdff0000.rkisp: can’t request region for resource [mem 0xfdff0000-0xfdffffff]
[ 7.615886] rkisp rkisp-vir1: rkisp driver version: v01.06.01
[ 7.616046] rkisp rkisp-vir1: No memory-region-thunderboot specified
[ 7.616263] rkisp rkisp-vir1: Entity type for entity rkisp-isp-subdev was not initialized!
[ 7.616299] rkisp rkisp-vir1: Entity type for entity rkisp-csi-subdev was not initialized!
[ 7.734875] rkisp-vir1: Async subdev notifier completed
[ 7.734916] rkcif rkcif_mipi_lvds: clear unready subdev num: 0
[ 7.739790] rkisp rkisp-vir1: clear unready subdev num: 0

For space reasons, this is our device tree:

/dts-v1/;

#include "rk3566-radxa-rock-3-compute-module.dtsi"

/ {
	model = "Radxa CM3 RPI CM4 IO";
	compatible = "radxa,radxa-cm3-rpi-cm4-io", "rockchip,rk3566";

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwren>;
		regulator-name = "vcc_sd";
		regulator-always-on;
	};
        imx219_vana_2v8: 2p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vana";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
                regulator-always-on;
        };

        imx219_vdig_1v8: 1p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vdig";
                regulator-min-microvolt = <1500000>;
                regulator-max-microvolt = <1500000>;
                regulator-always-on;
        };

        imx219_vddl_1v2: 1p2v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vddl";
                regulator-min-microvolt = <1200000>;
                regulator-max-microvolt = <1200000>;
                regulator-always-on;
        };

	cam24m: cam24m {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
		clock-output-names = "cam24m";
	};

};

&gpio_leds {
	pi-led-green {
		gpios = <&gpio4 4 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "timer";
		default-state = "on";
		pinctrl-0 = <&pi_led>;
	};

	pwr-led-red {
		gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "none";
		default-state = "on";
		pinctrl-0 = <&pwr_led>;
	};
};

&sdmmc0 {
	max-frequency = <150000000>;
	supports-sd;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	sd-uhs-sdr104;
	vmmc-supply = <&vcc_sd>;
	vqmmc-supply = <&vccio_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
	status = "okay";
};

&pcie2x1 {
	reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
	vpcie3v3-supply = <&vcc3v3_sys>;
	pinctrl-0 = <&pcie20m2_pins>;
	status = "okay";
};

&pinctrl {
	leds {
		pi_led: pi-led {
			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		pwr_led: pwr-led {
			rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sdcard {
		sdmmc_pwren: sdmmc-pwren {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pinctrl {
        cam {
                camera_pwr: camera-pwr {
                        rockchip,pins =
                                /* camera power en */
                                <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
};

&gpio4 {
	cam_power {
		gpio-hog;
		gpios = <RK_PC1 GPIO_ACTIVE_HIGH>;
		output-high;
	};
};

&i2c2 {
        status = "okay";
        pinctrl-names = "default";

        pinctrl-0 = <&i2c2m1_xfer>;
        imx219_1: imx219-1@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;
                clocks = <&cru CLK_CAM0_OUT>;
                clock-names = "xvclk";

                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

              
                power-domains = <&power RK3568_PD_VI>;
 
                rockchip,camera-module-index = <1>;
                rockchip,camera-module-facing = "front";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out1: endpoint {
                                status = "okay";
                                remote-endpoint = <&dphy2_in>;
                                data-lanes = <1 2>;
                                clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                        };
                };
        };
};

&i2c0 {
        status = "okay";

        imx219_2: imx219-2@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;
                clocks = <&cru CLK_CAM1_OUT>;
                clock-names = "xvclk";

                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

                power-domains = <&power RK3568_PD_VI>;

                rockchip,camera-module-index = <2>;
                rockchip,camera-module-facing = "back";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out2: endpoint {
                                status = "okay";
                            
                                remote-endpoint = <&dphy1_in>;
                                data-lanes = <1 2>;
                                 clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                         };
                };
        };
};
&csi2_dphy_hw {
        status = "okay";
};
&csi2_dphy0 {
         status = "disabled";
};

&csi2_dphy1 {
        status = "okay";

        /*
         * dphy1 only used for split mode,
         * can be used  concurrently  with dphy2
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;
                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out2>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_out: endpoint@1 {
                               reg = <1>;
                                remote-endpoint = <&isp0_in>;
                        };
                };
        };
};
&csi2_dphy2 {
        status = "okay";

        /*
         * dphy2 only used for split mode,
         * can be used  concurrently  with dphy1
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy2_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out1>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                       #size-cells = <0>;

                        dphy2_out: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&mipi_csi2_input>;
                        };
                };
        };
};

&mipi_csi2 {
        status = "okay";

        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        mipi_csi2_input: endpoint@1 {
                                        reg = <1>;
                                        remote-endpoint = <&dphy2_out>;
                                        data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        mipi_csi2_output: endpoint@0 {
                                        reg = <0>;
                                        remote-endpoint = <&cif_mipi_in>;
                                        data-lanes = <1 2>;
                        };
                };
        };
};

&rkisp {
        status = "okay";
};

&rkisp_mmu {
        status = "okay";
};

&rkisp_vir0 {
        status = "okay";

        port {
                #address-cells = <1>;
                #size-cells = <0>;

                isp0_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy1_out>;
                };
        };
};


&rkisp_vir1 {
        status = "okay";

        port {
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <0>;

                isp1_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&mipi_lvds_sditf>;
                };
        };
};


&rkcif_mipi_lvds {
        status = "okay";
        port {
                cif_mipi_in: endpoint {
                        remote-endpoint = <&mipi_csi2_output>;
                        data-lanes = <1 2>;
                };
        };
};

&rkcif_mipi_lvds_sditf {
        status = "okay";
        port {
                mipi_lvds_sditf: endpoint {
                        remote-endpoint = <&isp1_in>;
                        data-lanes = <1 2>;
                };
        };
};


&rkcif_mmu {
    status = "okay";
};

&rkcif {
    status = "okay";
};

Comparing both the differential signals of D0 and D1 aswell as the CLK between the working and the failing camera during streaming does not yield any differences. We are limited to 500mhz of capture bandwidth though.

I would really appreciate any input :slight_smile:

EDIT:

On our modified rpi cm4 io board we have now got both cameras working in split mode, the following dts fixed it:

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
 * Copyright (c) 2021 Radxa Limited.
 *
 */

/dts-v1/;

#include "rk3566-radxa-rock-3-compute-module.dtsi"

/ {
	model = "Radxa CM3 RPI CM4 IO";
	compatible = "radxa,radxa-cm3-rpi-cm4-io", "rockchip,rk3566";

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwren>;
		regulator-name = "vcc_sd";
		regulator-always-on;
	};
        imx219_vana_2v8: 2p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vana";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
                regulator-always-on;
        };

        imx219_vdig_1v8: 1p8v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vdig";
                regulator-min-microvolt = <1500000>;
                regulator-max-microvolt = <1500000>;
                regulator-always-on;
        };

        imx219_vddl_1v2: 1p2v {
                compatible = "regulator-fixed";
                regulator-name = "camera_vddl";
                regulator-min-microvolt = <1200000>;
                regulator-max-microvolt = <1200000>;
                regulator-always-on;
        };

	cam24m: cam24m {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
		clock-output-names = "cam24m";
	};

};

&gpio_leds {
	pi-led-green {
		gpios = <&gpio4 4 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "timer";
		default-state = "on";
		pinctrl-0 = <&pi_led>;
	};

	pwr-led-red {
		gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "none";
		default-state = "on";
		pinctrl-0 = <&pwr_led>;
	};
};

&sdmmc0 {
	max-frequency = <150000000>;
	supports-sd;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	sd-uhs-sdr104;
	vmmc-supply = <&vcc_sd>;
	vqmmc-supply = <&vccio_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
	status = "okay";
};

&pcie2x1 {
	reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
	vpcie3v3-supply = <&vcc3v3_sys>;
	pinctrl-0 = <&pcie20m2_pins>;
	status = "okay";
};

&pinctrl {
	leds {
		pi_led: pi-led {
			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		pwr_led: pwr-led {
			rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sdcard {
		sdmmc_pwren: sdmmc-pwren {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pinctrl {
        cam {
                camera_pwr: camera-pwr {
                        rockchip,pins =
                                /* camera power en */
                                <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
};

&gpio4 {
	cam_power {
		gpio-hog;
		gpios = <RK_PC1 GPIO_ACTIVE_HIGH>;
		output-high;
	};
};

&i2c2 {
        status = "okay";
        pinctrl-names = "default";

        pinctrl-0 = <&i2c2m1_xfer>;
        imx219_1: imx219-1@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;
                clocks = <&cru CLK_CAM0_OUT>;
                clock-names = "xvclk";

                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

              
                power-domains = <&power RK3568_PD_VI>;
 
                rockchip,camera-module-index = <1>;
                rockchip,camera-module-facing = "front";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out1: endpoint {
                                status = "okay";
                                remote-endpoint = <&dphy2_in>;
                                data-lanes = <1 2>;
                                clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                        };
                };
        };
};

&i2c0 {
        status = "okay";

        imx219_2: imx219-2@10 {
                status = "okay";
                compatible = "sony,imx219";
                reg = <0x10>;
                clocks = <&cru CLK_CAM1_OUT>;
                clock-names = "xvclk";

                VANA-supply = <&imx219_vana_2v8>;
                VDIG-supply = <&imx219_vdig_1v8>;
                VDDL-supply = <&imx219_vddl_1v2>;

                power-domains = <&power RK3568_PD_VI>;

                rockchip,camera-module-index = <2>;
                rockchip,camera-module-facing = "back";
                rockchip,camera-module-name = "TongJu";
                rockchip,camera-module-lens-name = "CHT842-MD";
                port {
                        imx219_out2: endpoint {
                                status = "okay";
                            
                                remote-endpoint = <&dphy1_in>;
                                data-lanes = <1 2>;
                                 clock-noncontinuous;
                   		link-frequencies = /bits/ 64 <456000000>;
                         };
                };
        };
};
&csi2_dphy_hw {
        status = "okay";
};
&csi2_dphy0 {
         status = "disabled";
};

&csi2_dphy1 {
        status = "okay";

        /*
         * dphy1 only used for split mode,
         * can be used  concurrently  with dphy2
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;
                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out2>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_out: endpoint@1 {
                               reg = <1>;
                                remote-endpoint = <&isp0_in>;
                        };
                };
        };
};
&csi2_dphy2 {
        status = "okay";

        /*
         * dphy2 only used for split mode,
         * can be used  concurrently  with dphy1
         * full mode and split mode are mutually exclusive
         */
        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy2_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&imx219_out1>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                       #size-cells = <0>;

                        dphy2_out: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&isp1_in>;
                        };
                };
        };
};


&rkisp {
        status = "okay";
};

&rkisp_mmu {
        status = "okay";
};

&rkisp_vir0 {
        status = "okay";

        port {
                #address-cells = <1>;
                #size-cells = <0>;

                isp0_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy1_out>;
                };
        };
};


&rkisp_vir1 {
        status = "okay";

        port {
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <0>;

                isp1_in: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&dphy2_out>;
                };
        };
};


&rkcif_mmu {
    status = "okay";
};

&rkcif {
    status = "okay";
};

Rerouting the other camera through dphy1 and directly into isp1 instead of taking the long route through csi_mipi and lvds and lvds_sditf seems to have done the trick.

1 Like

Hi, I managed to use two OV5647 by creating a device tree overlay with the help of this topic. But two cameras can not work at the same time. Is this a normal behavior or can you use two cameras simultaneously?