Custom device tree does not load camera driver

We have everything working for our custom camera with JETSON NANO but now we are switching to XAXVIER NX. We compared to the example device trees, but we have also device trees from AUVIDEA since we are using their baseboards.
Instead of the examples, the only real difference is the use of cam_i2c_mux, which is not used with AUVIDEA, instead, we use i2c@0c230000 directly.

For some reason I cant figure out, when I probe my driver, the probe function is not invoked like if there was no device compatible with my driver. Do you have any idea, what could be the reason for that? Using standard nvidia device tree I can see the driver being probed.

I’ll leave you with my device tree for the imx219, which is not working.

#include <dt-bindings/media/camera.h>


#define CAM0_PWDN	TEGRA194_MAIN_GPIO(P, 4)
#define CAM1_PWDN	TEGRA194_MAIN_GPIO(P, 5)
#define CAM_I2C_MUX 	TEGRA194_AON_GPIO(CC, 3)

/ {
    host1x {
        vi@15c10000  {
            num-channels = <1>;
            ports {
				#address-cells = <1>;
				#size-cells = <0>;
                vi_port0: port@0 {
                reg = <0>;
                rbpcv2_imx219_vi_in0: endpoint {
                    port-index = <0>;
                    bus-width = <2>;
                    remote-endpoint = <&rbpcv2_imx219_csi_out0>;
                };
            };
                /*vi_port1: port@1 {
					reg = <1>;
					rbpcv2_imx219_vi_in1: endpoint {
						port-index = <2>;
						bus-width = <2>;
						remote-endpoint = <&rbpcv2_imx219_csi_out1>;
					};
				};*/
            };
        };

        nvcsi@15a00000 {
            num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
            csi_chan0: channel@0 {
                reg = <0>;
                ports {
					#address-cells = <1>;
					#size-cells = <0>;
                    csi_chan0_port0: port@0 {
                    reg = <0>;
                    rbpcv2_imx219_csi_in0: endpoint@0 {
                        port-index = <0>;
                        bus-width = <2>;
                        remote-endpoint = <&rbpcv2_imx219_out0>;
                    };
                };
                    csi_chan0_port1: port@1 {
                    reg = <1>;
                    rbpcv2_imx219_csi_out0: endpoint@1 {
                        remote-endpoint = <&rbpcv2_imx219_vi_in0>;
                    };
                };
                };
            };
            /*csi_chan1: channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					csi_chan1_port0: port@0 {
						reg = <0>;
						rbpcv2_imx219_csi_in1: endpoint@2 {
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&rbpcv2_imx219_out1>;
						};
					};
					csi_chan1_port1: port@1 {
						reg = <1>;
						rbpcv2_imx219_csi_out1: endpoint@3 {
							remote-endpoint = <&rbpcv2_imx219_vi_in1>;
						};
					};
				};
			};*/
        };
    };


    i2c@0c230000 {
        status="okay";
        imx219_cam0: rbpcv2_imx219_a@10 {
        reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
        status="okay";
        compatible = "nvidia,imx219";
        reg = <0x10>;

        devnode = "video0";

        physical_w = "3.680";
        physical_h = "2.760";

        sensor_model = "imx219";

        use_sensor_mode_id = "true";

        mode0 {
            mclk_khz = "24000";
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
            discontinuous_clk = "yes";
            dpcm_enable = "false";
            cil_settletime = "0";

            active_w = "3264";
            active_h = "2464";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            line_length = "3448";
            inherent_gain = "1";
            mclk_multiplier = "9.33";
            pix_clk_hz = "182400000";

            gain_factor = "16";
            framerate_factor = "1000000";
            exposure_factor = "1000000";
            min_gain_val = "16";
            max_gain_val = "170";
            step_gain_val = "1";
            default_gain = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "1";
            min_framerate = "2000000";
            max_framerate = "21000000";
            step_framerate = "1";
            default_framerate = "21000000";
            min_exp_time = "13";
            max_exp_time = "683709";
            step_exp_time = "1";
            default_exp_time = "2495";

            embedded_metadata_height = "2";
        };
        mode1 {
            mclk_khz = "24000";
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
            discontinuous_clk = "yes";
            dpcm_enable = "false";
            cil_settletime = "0";

            active_w = "3264";
            active_h = "1848";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            line_length = "3448";
            inherent_gain = "1";
            mclk_multiplier = "9.33";
            pix_clk_hz = "182400000";

            gain_factor = "16";
            framerate_factor = "1000000";
            exposure_factor = "1000000";
            min_gain_val = "16";
            max_gain_val = "170";
            step_gain_val = "1";
            default_gain = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "1";
            min_framerate = "2000000";
            max_framerate = "28000000";
            step_framerate = "1";
            default_framerate = "28000000";
            min_exp_time = "13";
            max_exp_time = "683709";
            step_exp_time = "1";
            default_exp_time = "2495";

            embedded_metadata_height = "2";
        };
        mode2 {
            mclk_khz = "24000";
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
            discontinuous_clk = "yes";
            dpcm_enable = "false";
            cil_settletime = "0";

            active_w = "1920";
            active_h = "1080";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            line_length = "3448";
            inherent_gain = "1";
            mclk_multiplier = "9.33";
            pix_clk_hz = "182400000";

            gain_factor = "16";
            framerate_factor = "1000000";
            exposure_factor = "1000000";
            min_gain_val = "16";
            max_gain_val = "170";
            step_gain_val = "1";
            default_gain = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "1";
            min_framerate = "2000000";
            max_framerate = "30000000";
            step_framerate = "1";
            default_framerate = "30000000";
            min_exp_time = "13";
            max_exp_time = "683709";
            step_exp_time = "1";
            default_exp_time = "2495";

            embedded_metadata_height = "2";
        };
        mode3 {
            mclk_khz = "24000";
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
            discontinuous_clk = "yes";
            dpcm_enable = "false";
            cil_settletime = "0";

            active_w = "1280";
            active_h = "720";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            line_length = "3448";
            inherent_gain = "1";
            mclk_multiplier = "9.33";
            pix_clk_hz = "182400000";

            gain_factor = "16";
            framerate_factor = "1000000";
            exposure_factor = "1000000";
            min_gain_val = "16";
            max_gain_val = "170";
            step_gain_val = "1";
            default_gain = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "1";
            min_framerate = "2000000";
            max_framerate = "60000000";
            step_framerate = "1";
            default_framerate = "60000000";
            min_exp_time = "13";
            max_exp_time = "683709";
            step_exp_time = "1";
            default_exp_time = "2495";

            embedded_metadata_height = "2";
        };
        mode4 {
            mclk_khz = "24000";
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
            discontinuous_clk = "yes";
            dpcm_enable = "false";
            cil_settletime = "0";

            active_w = "1280";
            active_h = "720";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            line_length = "3448";
            inherent_gain = "1";
            mclk_multiplier = "9.33";
            pix_clk_hz = "169600000";

            gain_factor = "16";
            framerate_factor = "1000000";
            exposure_factor = "1000000";
            min_gain_val = "16";
            max_gain_val = "170";
            step_gain_val = "1";
            default_gain = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "1";
            min_framerate = "2000000";
            max_framerate = "120000000";
            step_framerate = "1";
            default_framerate = "120000000";
            min_exp_time = "13";
            max_exp_time = "683709";
            step_exp_time = "1";
            default_exp_time = "2495";

            embedded_metadata_height = "2";
        };

        ports {
				#address-cells = <1>;
				#size-cells = <0>;
            port@0 {
                reg = <0>;
                rbpcv2_imx219_out0: endpoint {
                    port-index = <0>;
                    bus-width = <2>;
                    remote-endpoint = <&rbpcv2_imx219_csi_in0>;
                };
            };
        };
    };
    };
    /*i2c_1: i2c@1 {
		imx219_cam1: rbpcv2_imx219_c@10 {
			compatible = "nvidia,imx219";
			reg = <0x10>;

			devnode = "video1";

			physical_w = "3.680";
			physical_h = "2.760";

			sensor_model = "imx219";

			use_sensor_mode_id = "true";

			mode0 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3264";
				active_h = "2464";
				pixel_t = "bayer_rggb";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "182400000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "170";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000";
				max_framerate = "21000000";
				step_framerate = "1";
				default_framerate = "21000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = "1";
				default_exp_time = "2495";

				embedded_metadata_height = "2";
			};
			mode1 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3264";
				active_h = "1848";
				pixel_t = "bayer_rggb";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "182400000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "170";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000";
				max_framerate = "28000000";
				step_framerate = "1";
				default_framerate = "28000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = "1";
				default_exp_time = "2495";

				embedded_metadata_height = "2";
			};
			mode2 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "182400000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "170";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000";
				max_framerate = "30000000";
				step_framerate = "1";
				default_framerate = "30000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = "1";
				default_exp_time = "2495";
				embedded_metadata_height = "2";
			};
			mode3 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "182400000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "170";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000";
				max_framerate = "60000000";
				step_framerate = "1";
				default_framerate = "60000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = "1";
				default_exp_time = "2495";

				embedded_metadata_height = "2";
			};
			mode4 {
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_c";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "1280";
				active_h = "720";
				pixel_t = "bayer_rggb";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "9.33";
				pix_clk_hz = "169600000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "170";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "2000000";
				max_framerate = "120000000";
				step_framerate = "1";
				default_framerate = "120000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = "1";
				default_exp_time = "2495";

				embedded_metadata_height = "2";
			};

			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					rbpcv2_imx219_out1: endpoint {
						status = "okay";
						port-index = <2>;
						bus-width = <2>;
						remote-endpoint = <&rbpcv2_imx219_csi_in1>;
					};
				};
			};
		};
	};*/

    lens_imx219@RBPCV2 {
        min_focus_distance = "0.0";
        hyper_focal = "0.0";
        focal_length = "3.04";
        f_number = "2.0";
        aperture = "0.0";
    };
};
/ {
    tcp: tegra-camera-platform {
    compatible = "nvidia, tegra-camera-platform";

    num_csi_lanes = <2>;
    max_lane_speed = <1500000>;
    min_bits_per_pixel = <10>;
    vi_peak_byte_per_pixel = <2>;
    vi_bw_margin_pct = <25>;
    max_pixel_rate = <240000>;
    isp_peak_byte_per_pixel = <5>;
    isp_bw_margin_pct = <25>;

    modules {
        cam_module0: module0 {
        badge = "jakku_front_RBP194";
        position = "front";
        orientation = "1";
        cam_module0_drivernode0: drivernode0 {
            pcl_id = "v4l2_sensor";
            devname = "imx219 2-0010";
            proc-device-tree = "/proc/device-tree/i2c@0c230000/rbpcv2_imx219_a@10";
        };
        cam_module0_drivernode1: drivernode1 {
            pcl_id = "v4l2_lens";
            proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
        };
    };

        /*cam_module1: module1 {
            badge = "jakku_rear_RBP194";
            position = "rear";
            orientation = "1";
            cam_module1_drivernode0: drivernode0 {
                pcl_id = "v4l2_sensor";
                devname = "imx219 10-0010";
                proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_c@10";
            };
            cam_module1_drivernode1: drivernode1 {
                pcl_id = "v4l2_lens";
                proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
            };
        };*/
    };
};
};

I modifed tegra194-p3509-0000-a00.dtsi like this so my device tree will be used:

//#include "tegra194-camera-jakku-rbpcv2-imx219.dtsi"
#include "tegra194-camera-auvidea-test.dtsi"

Am I doing something wrong?

Thank you for your time and help!

hello busch.johannes,

DT settings seems correct.
please check from low-level first, are you able to probe the signaling to ensure you’re given correct regulator to ensure i2c communication.
thanks

Hey, thank you very much for your fast response.

You are right to start testing on a lower level is a good idea, but it seems to me that the problem is already earlier.
If I understand you correctly, you say I have to make sure there is an i2c connection working, but even when there is no sensor connected at all, the driver should probe and at least print that it can’t reach any sensor, shouldn’t it? (Because that’s also what happens with Nvidia device trees)

So it seems to me the device tree node is somehow skipped over, so that is is not probing the device when loading the module.
Any idea on this?
Best regards,
jb

Hi @busch.johannes

Are you able to see your custom dtb when you do:

dmesg | grep dts

Just to isolate that it is loading you custom device tree and not another one

Best regards,
Roberto

Hey robertogs2,
your idea is right, that was my first thought too. I already checked it and the device tree I am modifying is in use. Also I can see changes having impact.

Thank you for your help anyway!

You were right, i2c@0c230000 is totally wrong. I don’t know why Auvidea gives away device trees like this. We found i2c@c240000 and i2c@3180000 working for cam1 and cam2. I got that i2c addresses from hardware/nvidia/soc/t19x/kernel-dts/tegra194-soc/tegra194-soc-i2c.dtsi file.