NANO multi CSI without I2C HUB

Hi

I made a custom board using NANO module.
L4T is 32.5.
There is no I2C HUB on the custom board.
The camera is trying to connect the IMX219(x2).
Without I2C Hub, I am trying to connect I2C like this:

board CAM CSI NAME CSI Signal I2C I2C PIN
NANO Devkit IMX219 #1 CSI0 CSI_A CAM_I2C 213, 215
NANO Devkit IMX219 #2 CSI2 CSI_E CAM_I2C 213, 215
Custom IMX219 #1 CSI0 CSI_A CAM_I2C 213, 215
Custom IMX219 #2 CSI2 CSI_E I2C0 185, 187

I am referring to file tegra210-camera-rbpcv2-dual-imx219.dtsi

	cam_i2cmux {
		i2c_0: i2c@0 {
			imx219_cam0: rbpcv2_imx219_a@10 {
				compatible = "nvidia,imx219";
				/* I2C device address */
				reg = <0x10>;

in file tegra210-porg-camera-rbpcv2-dual-imx219.dtsi

	cam_i2cmux {
		compatible = "i2c-mux-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		mux-gpios = <&gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		i2c-parent = <&i2c7>;

in file tegra210-soc-base.dtsi

		i2c7: i2c@546c0000 {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "nvidia,tegra210-vii2c";

CAM_I2C seems to be mapped to cam_i2cmux(546c0000).
But what address should I2C0 be mapped to?
Can you give me a link to which documentation I should refer to?

I am always grateful.
Thank you.

Why do you just follow devkit to use one gpio pin for i2c-mux-gpio driver?
If you didn’t follow devkit just connect the sensor directly to CAM_I2C and I2C0 then you need move the sensor from i2c-mux-gpio scope to CAM_I2C and I2C0

Thank you for answer.

As you said, I want to move the sensor to I2C0. (second IMX219 )
Searching the forum, I found the following:

    aliases {
            i2c0 = "/i2c@7000c000";
            i2c1 = "/i2c@7000c400";
            i2c2 = "/i2c@7000c500";
            i2c3 = "/i2c@7000c700";
            i2c4 = "/i2c@7000d000";
            i2c5 = "/i2c@7000d100";

Based on the above, we would like to proceed as follows.
file tegra210-camera-rbpcv2-dual-imx219.dtsi

	cam_i2cmux {
		i2c_0: i2c@0 {
			imx219_cam0: rbpcv2_imx219_a@10 {
				compatible = "nvidia,imx219";
				/* I2C device address */
				reg = <0x10>;
				/* V4L2 device node location */
				devnode = "video0";
				...
		};
	};

	i2c@7000c000 {
		i2c_1: i2c@1 {
			imx219_cam1: rbpcv2_imx219_e@10 {
				compatible = "nvidia,imx219";
				/* I2C device address */
				reg = <0x10>;
				/* V4L2 device node location */
				devnode = "video1";
				...
		};
	};

Is the address of I2C0 0x7000c000 ?

Yes, and you need remove the i2c_1 like below.

i2c@7000c000 {
			imx219_cam1: rbpcv2_imx219_e@10 {
				compatible = "nvidia,imx219";
				/* I2C device address */
				reg = <0x10>;
				/* V4L2 device node location */
				devnode = "video1";
				...
		};

Thanks for the reply ShaneCCC.

i2c@7000c000 is used, but “/dev/video1” is not created. (/dev/video0 ok)
dmesg.log (56.0 KB)
There are no messages in the dmesg log either.

The device tree modification file is as follows.
tegra210-porg-camera-rbpcv2-dual-imx219.dtsi (1.7 KB)
tegra210-camera-rbpcv2-dual-imx219.dtsi (7.5 KB)
tegra210-porg-plugin-manager.dtsi (11.2 KB)

Are the following main settings correct?
file tegra210-porg-camera-rbpcv2-dual-imx219.dtsi

	i2c@7000c000 {
		compatible = "nvidia,tegra210-i2c";
		status = "disabled";
		// reg = <1>;
		#address-cells = <1>;
		#size-cells = <0>;
		rbpcv2_imx219_e@10 {
			status = "disabled";
			reset-gpios = <&gpio CAM2_PWDN GPIO_ACTIVE_HIGH>;
		};
	};

file tegra210-porg-plugin-manager.dtsi
Commented as a compilation error.
Do I need any other settings?

			// override@31 {
			// 	target = <&i2c_1>;
			// 	_overlay_ {
			// 		status = "okay";
			// 	};
			// };

Where do I start to figure out the problem?
Can you give me some advice?

Thanks you.

Looks like not correct have a reference to tegra210-camera-e3326-a00.dtsi
Also you need modify the status to okay to enable it.
Also check this document for customize device tree.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.html#wwpID0E0XF0HA

Hello ShaneCCC.

Thanks, it worked fine.
Here are the changes:
file tegra210-porg-camera-rbpcv2-dual-imx219.dtsi

status = “okay”;

	GEN_I2C0: i2c@7000c000 {
		compatible = "nvidia,tegra210-i2c";
		status = "okay";
		#address-cells = <1>;
		#size-cells = <0>;
		rbpcv2_imx219_e@10 {
			status = "disabled";
			reset-gpios = <&gpio CAM2_PWDN GPIO_ACTIVE_HIGH>;
		};
	};

file tegra210-camera-rbpcv2-dual-imx219.dtsi

devname = “imx219 0-0010”;

			cam_module1: module1 {
				badge = "porg_rear_RBPCV2";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 0-0010";
					proc-device-tree = "/proc/device-tree/i2c@7000c000/rbpcv2_imx219_e@10";
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};

file tegra210-porg-plugin-manager.dtsi

			override@10 {
				target = <&cam_module1_drivernode0>;
				_overlay_ {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "imx219 0-0010";
					proc-device-tree = "/proc/device-tree/i2c@7000c000/rbpcv2_imx219_e@10";
				};
			};

kernel dmesg & device list

nvidia@localhost: ~nvidia@localhost:~$ dmesg |grep imx
[    1.305153] imx219 0-0010: tegracam sensor driver:imx219_v2.0.6
[    1.329368] imx219 7-0010: tegracam sensor driver:imx219_v2.0.6
[    1.509322] vi 54080000.vi: subdev imx219 7-0010 bound
[    1.509868] vi 54080000.vi: subdev imx219 0-0010 bound

nvidia@localhost: ~nvidia@localhost:~$ ls -al /dev/vi*
crw-rw----+ 1 root video 81, 0 Jul 13 01:11 /dev/video0
crw-rw----+ 1 root video 81, 3 Jul 13 01:11 /dev/video1

If you are in the same situation as me, please refer to the source.
tegra210-porg-plugin-manager.dtsi (11.2 KB)
tegra210-porg-camera-rbpcv2-dual-imx219.dtsi (1.7 KB)
tegra210-camera-rbpcv2-dual-imx219.dtsi (7.5 KB)
t0.sh (427 Bytes)
t1.sh (427 Bytes)

Thank you for your cooperation.

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.