Skip to content

adding 12M pixel mode (4032x3040) in Jetson Xavier nx with L4T 35.6.0 #209

@HosseinLachini

Description

@HosseinLachini

Hi,
I wrote 12M pixel device tree overlay :

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Jetson Device-tree overlay for dual camera IMX477 rbpcv3 on
 * dual cam connector baseboards
 *
 * Copyright (c) 2021-2022 NVIDIA CORPORATION. All rights reserved.
 *
 */

/dts-v1/;
/plugin/;

/ {
	overlay-name = "Camera IMX477 Dual";
	jetson-header-name = "Jetson Nano CSI Connector";
	compatible = "nvidia,p3449-0000+p3668-0000", "nvidia,p3449-0000+p3668-0001", "nvidia,p3509-0000+p3668-0000", "nvidia,p3509-0000+p3668-0001";

	/* IMX477 dual sensor module */
	fragment@0 {
		target = <&imx477_cam0>;
		__overlay__ {
			status = "okay";
				mode0 { /* IMX477_MODE_4032x3040 */
					active_w = "4032";
					active_h = "3840";
					line_length = "12352";
				};
				mode1 { /* IMX477_MODE_3840x2160 */
					active_w = "3840";
					active_h = "2160";
					line_length = "11200";
				};
				mode2 { /* IMX477_MODE_1920X1080 */
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "no";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1920";
					active_h = "1080";
					mode_type = "bayer";
					pixel_phase = "rggb";
					csi_pixel_bit_depth = "10";
					readout_orientation = "90";
					line_length = "7000";
					inherent_gain = "1";
					mclk_multiplier = "80";
					pix_clk_hz = "300000000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "356"; /* 22x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "60000000"; /* 60.0 fps */
					step_framerate = "1";
					default_framerate = "60000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "2";
				};
		};
	};
	fragment@1 {
		target = <&cam_module0>;
		__overlay__ {
			status = "okay";
			badge = "jakku_front_RBPCV3";
			position = "front";
			orientation = "1";
		};
	};
	fragment@2 {
		target = <&cam_module0_drivernode0>;
		__overlay__ {
			status = "okay";
			pcl_id = "v4l2_sensor";
			devname = "imx477 9-001a";
			proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a";
		};
	};
	fragment@3 {
		target = <&imx477_cam1>;
		__overlay__ {
			status = "okay";
		};
	};
	fragment@4 {
		target = <&cam_module1>;
		__overlay__ {
			status = "okay";
			badge = "jakku_rear_RBPCV3";
			position = "rear";
			orientation = "1";
		};
	};
	fragment@5 {
		target = <&cam_module1_drivernode0>;
		__overlay__ {
			status = "okay";
			pcl_id = "v4l2_sensor";
			devname = "imx477 10-001a";
			proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv3_imx477_c@1a";
		};
	};
	fragment@6 {
                target = <&imx219_cam0>;
                __overlay__ {
                        status = "disabled";
                };
        };

	fragment@7 {
		target = <&rbpcv3_imx477_vi_in0>;
		__overlay__ {
			status = "okay";
			port-index = <0>;
			bus-width = <2>;
			remote-endpoint = <&rbpcv3_imx477_csi_out0>;
		};
	};
	fragment@8 {
		target = <&rbpcv3_imx477_vi_in1>;
		__overlay__ {
			status = "okay";
			port-index = <2>;
			bus-width = <2>;
			remote-endpoint = <&rbpcv3_imx477_csi_out1>;
		};
	};
	fragment@9 {
		target = <&rbpcv3_imx477_csi_in0>;
		__overlay__ {
			status = "okay";
			port-index = <0>;
			bus-width = <2>;
			remote-endpoint = <&rbpcv3_imx477_out0>;
		};
	};
	fragment@10 {
		target = <&rbpcv3_imx477_csi_out0>;
		__overlay__ {
			status = "okay";
		};
	};
	fragment@11 {
		target = <&rbpcv3_imx477_csi_in1>;
		__overlay__ {
			status = "okay";
			port-index = <2>;
			bus-width = <2>;
			remote-endpoint = <&rbpcv3_imx477_out1>;
		};
	};
	fragment@12 {
		target = <&rbpcv3_imx477_csi_out1>;
		__overlay__ {
			status = "okay";
		};
	};
	fragment@13 {
		target = <&imx219_cam1>;
		__overlay__ {
			status = "disabled";
		};
	};
};

in the next step I should edit imx477 device driver to add new mode by adding new registers value. But I cant find complete datasheet or document about registers value of imx477 camera.
Are you can share this datasheet or your nvidia source code for L4T 35.5.0 to me. Then I write driver to 12M pixel mode, And share it with you to using by other people?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions