How to use IMX219 with Tx2 Jetpack 4.2

Want to know what are the changes required in order to run the CSI camera with Tx2 using Jetpack 4.2?

What’s your HW? Did you design the sensor board or get it from Vendor?
You may need to implement the device tree for it.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_dev.html%23

Its a CSI camera IMX219 compatible with Raspberry Pi. I am able to see its definition in .dst file with JetPack 4.2.

Hi ammar.zafar8,

The answer to your question depends mostly on the hardware you are using, this will determine I2C addresses, CSI-2 ports, voltage regulators, GPIO pins, etc. The driver for the IMX219 that is distributed in the L4T is similar to the one used for the Raspberry Pi. Typically, you should only need to modify the device tree accordingly.

Hello Jchaves,
Design is similar to the dev kit for Tx1/Tx2. We have changed the camera only in that and we are using CSI-0.
Following is the portion of default device tree mention imx219.

tegra-camera-platform {
compatible = “nvidia, tegra-camera-platform”;
num_csi_lanes = <0x2>;
max_lane_speed = <0x3d0900>;
min_bits_per_pixel = <0xa>;
vi_peak_byte_per_pixel = <0x2>;
vi_bw_margin_pct = <0x19>;
max_pixel_rate = <0xb71b0>;
isp_peak_byte_per_pixel = <0x5>;
isp_bw_margin_pct = <0x19>;
tpg_max_iso = <0x3bc400>;
linux,phandle = <0x128>;
phandle = <0x128>;

	modules {

		module0 {
			badge = "imx390_rear";
			position = "rear";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x11a>;
			phandle = <0x11a>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx390 30-001b";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/imx390_a@1b";
				status = "disabled";
				linux,phandle = <0x11b>;
				phandle = <0x11b>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
				status = "disabled";
				linux,phandle = <0x12c>;
				phandle = <0x12c>;
			};
		};

		module1 {
			badge = "imx390_front";
			position = "front";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x11d>;
			phandle = <0x11d>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx390 30-001c";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/imx390_b@1c";
				status = "disabled";
				linux,phandle = <0x11e>;
				phandle = <0x11e>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
				status = "disabled";
				linux,phandle = <0x130>;
				phandle = <0x130>;
			};
		};

		module2 {
			badge = "e3322_centerright_A815P2";
			position = "centerright";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x139>;
			phandle = <0x139>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx219 32-0010";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@77/i2c@2/imx219_c@10";
				status = "disabled";
				linux,phandle = <0x13a>;
				phandle = <0x13a>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
				status = "disabled";
				linux,phandle = <0x13b>;
				phandle = <0x13b>;
			};
		};

		module3 {
			badge = "e3322_topleft_A815P2";
			position = "topleft";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x142>;
			phandle = <0x142>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx219 33-0010";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@77/i2c@3/imx219_d@10";
				status = "disabled";
				linux,phandle = <0x143>;
				phandle = <0x143>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
				status = "disabled";
				linux,phandle = <0x144>;
				phandle = <0x144>;
			};
		};

		module4 {
			badge = "e3322_bottomright_A815P2";
			position = "bottomright";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x14b>;
			phandle = <0x14b>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx219 34-0010";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@77/i2c@4/imx219_e@10";
				status = "disabled";
				linux,phandle = <0x14c>;
				phandle = <0x14c>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
				status = "disabled";
				linux,phandle = <0x14d>;
				phandle = <0x14d>;
			};
		};

		module5 {
			badge = "e3322_topright_A815P2";
			position = "topright";
			orientation = [31 00];
			status = "disabled";
			linux,phandle = <0x154>;
			phandle = <0x154>;

			drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "imx219 35-0010";
				proc-device-tree = "/proc/device-tree/i2c@3180000/tca9548@77/i2c@5/imx219_f@10";
				status = "disabled";
				linux,phandle = <0x155>;
				phandle = <0x155>;
			};

			drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/e3333_lens_ov5693@P5V27C/";
				status = "disabled";
				linux,phandle = <0x156>;
				phandle = <0x156>;
			};
		};
	};
};

As you said we only require to change dts. Ill be gratefull if You can specify the areas.

@ammar.zafar8
I would suggest to check the programing guide first.

@shaneCCC

I think it only requires the adjustment in the device tree as the camera i am using is compatible with the dev kit.

Yes, it need to be match your HW design.