From 13155c8f3a6070eef2f64dd9835e4e61596f118d Mon Sep 17 00:00:00 2001 From: alexklimaj Date: Fri, 11 Aug 2023 14:55:24 -0600 Subject: [PATCH] Initial ARK Jetson Orin Nano/NX device tree changes. --- cvb/tegra234-camera-ark-imx219.dtsi | 1752 +++++++++++++++++++++ cvb/tegra234-p3768-0000-a0.dtsi | 232 ++- cvb/tegra234-p3768-camera-ark-imx219.dtsi | 124 ++ 3 files changed, 2048 insertions(+), 60 deletions(-) create mode 100644 cvb/tegra234-camera-ark-imx219.dtsi create mode 100644 cvb/tegra234-p3768-camera-ark-imx219.dtsi diff --git a/cvb/tegra234-camera-ark-imx219.dtsi b/cvb/tegra234-camera-ark-imx219.dtsi new file mode 100644 index 0000000..21e315e --- /dev/null +++ b/cvb/tegra234-camera-ark-imx219.dtsi @@ -0,0 +1,1752 @@ +/* + * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include + +/ { + tegra-capture-vi { + num-channels = <4>; + 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 = <1>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_out1>; + }; + }; + vi_port2: port@2 { + reg = <2>; + rbpcv2_imx219_vi_in2: endpoint { + port-index = <2>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_out2>; + }; + }; + vi_port3: port@3 { + reg = <3>; + rbpcv2_imx219_vi_in3: endpoint { + port-index = <3>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_out3>; + }; + }; + }; + }; + + host1x@13e00000 { + nvcsi@15a00000 { + num-channels = <4>; + #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 = <1>; + 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>; + }; + }; + }; + }; + csi_chan2: channel@2 { + reg = <2>; + ports { + #address-cells = <1>; + #size-cells = <0>; + csi_chan2_port0: port@0 { + reg = <0>; + rbpcv2_imx219_csi_in2: endpoint@4 { + port-index = <2>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_out2>; + }; + }; + csi_chan2_port1: port@1 { + reg = <1>; + rbpcv2_imx219_csi_out2: endpoint@5 { + remote-endpoint = <&rbpcv2_imx219_vi_in2>; + }; + }; + }; + }; + csi_chan3: channel@3 { + reg = <3>; + ports { + #address-cells = <1>; + #size-cells = <0>; + csi_chan3_port0: port@0 { + reg = <0>; + rbpcv2_imx219_csi_in3: endpoint@6 { + port-index = <3>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_out3>; + }; + }; + csi_chan3_port1: port@1 { + reg = <1>; + rbpcv2_imx219_csi_out3: endpoint@7 { + remote-endpoint = <&rbpcv2_imx219_vi_in3>; + }; + }; + }; + }; + }; + }; + + i2c@3180000 { + tca9546@70 { + i2c@0 { + imx219_cam0: rbpcv2_imx219_a@10 { + compatible = "sony,imx219"; + /* I2C device address */ + reg = <0x10>; + + /* V4L2 device node location */ + devnode = "video0"; + + /* Physical dimensions of sensor */ + physical_w = "3.680"; + physical_h = "2.760"; + + sensor_model = "imx219"; + + use_sensor_mode_id = "true"; + + /** + * ==== Modes ==== + * A modeX node is required to support v4l2 driver + * implementation with NVIDIA camera software stack + * + * == Signal properties == + * + * phy_mode = ""; + * PHY mode used by the MIPI lanes for this device + * + * tegra_sinterface = ""; + * CSI Serial interface connected to tegra + * Incase of virtual HW devices, use virtual + * For SW emulated devices, use host + * + * pix_clk_hz = ""; + * Sensor pixel clock used for calculations like exposure and framerate + * + * readout_orientation = "0"; + * Based on camera module orientation. + * Only change readout_orientation if you specifically + * Program a different readout order for this mode + * + * lane_polarity + * Based on the camera connector pin. + * CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1 + * LSB | BIT1 | BIT2 | MSB + * if there is a polarity swap on any lane, the bit corrsponding + * to the lane should be set + * e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001 + * e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110 + * + * == Image format Properties == + * + * active_w = ""; + * Pixel active region width + * + * active_h = ""; + * Pixel active region height + * + * pixel_t = ""; + * The sensor readout pixel pattern + * + * line_length = ""; + * Pixel line length (width) for sensor mode. + * + * == Source Control Settings == + * + * Gain factor used to convert fixed point integer to float + * Gain range [min_gain/gain_factor, max_gain/gain_factor] + * Gain step [step_gain/gain_factor is the smallest step that can be configured] + * Default gain [Default gain to be initialized for the control. + * use min_gain_val as default for optimal results] + * Framerate factor used to convert fixed point integer to float + * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor] + * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured] + * Default Framerate [Default framerate to be initialized for the control. + * use max_framerate to get required performance] + * Exposure factor used to convert fixed point integer to float + * For convenience use 1 sec = 1000000us as conversion factor + * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor] + * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured] + * Default Exposure Time [Default exposure to be initialized for the control. + * Set default exposure based on the default_framerate for optimal exposure settings] + * + * gain_factor = ""; (integer factor used for floating to fixed point conversion) + * min_gain_val = ""; (ceil to integer) + * max_gain_val = ""; (ceil to integer) + * step_gain_val = ""; (ceil to integer) + * default_gain = ""; (ceil to integer) + * Gain limits for mode + * + * exposure_factor = ""; (integer factor used for floating to fixed point conversion) + * min_exp_time = ""; (ceil to integer) + * max_exp_time = ""; (ceil to integer) + * step_exp_time = ""; (ceil to integer) + * default_exp_time = ""; (ceil to integer) + * Exposure Time limits for mode (sec) + * + * framerate_factor = ""; (integer factor used for floating to fixed point conversion) + * min_framerate = ""; (ceil to integer) + * max_framerate = ""; (ceil to integer) + * step_framerate = ""; (ceil to integer) + * default_framerate = ""; (ceil to integer) + * Framerate limits for mode (fps) + * + * embedded_metadata_height = ""; + * Sensor embedded metadata height in units of rows. + * If sensor does not support embedded metadata value should be 0. + */ + mode0 { /* IMX219_MODE_3280x2464_21FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_a"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "3280"; + active_h = "2464"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "21000000"; /* 21.0 fps */ + step_framerate = "1"; + default_framerate = "21000000"; /* 21.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"; + }; + mode1 { /* IMX219_MODE_3280x1848_28FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_a"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "3280"; + active_h = "1848"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "28000000"; /* 28.0 fps */ + step_framerate = "1"; + default_framerate = "28000000"; /* 28.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"; + }; + mode2 { /* IMX219_MODE_1920x1080_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_a"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1920"; + active_h = "1080"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 30.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 30.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"; + }; + + mode3 { /* IMX219_MODE_1640x1232_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_a"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1640"; + active_h = "1232"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 60.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 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"; + }; + + mode4 { /* IMX219_MODE_1280x720_60FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_a"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1280"; + active_h = "720"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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"; + }; + /* + *mode5 { IMX219_MODE_1280x720_120FPS + * mclk_khz = "24000"; + * num_lanes = "2"; + * tegra_sinterface = "serial_a"; + * phy_mode = "DPHY"; + * discontinuous_clk = "yes"; + * dpcm_enable = "false"; + * cil_settletime = "0"; + * lane_polarity = "6"; + + * active_w = "1280"; + * active_h = "720"; + * mode_type = "bayer"; + * pixel_phase = "rggb"; + * csi_pixel_bit_depth = "10"; + * readout_orientation = "90"; + * line_length = "3560"; + * inherent_gain = "1"; + * mclk_multiplier = "9.33"; + * pix_clk_hz = "169600000"; + + * gain_factor = "16"; + * framerate_factor = "1000000"; + * exposure_factor = "1000000"; + * min_gain_val = "16"; // 1.00x + * max_gain_val = "170"; // 10.66x + * 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 = "120000000"; // 120.0 fps + * step_framerate = "1"; + * default_framerate = "120000000"; // 120.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"; + *}; + */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + rbpcv2_imx219_out0: endpoint { + status = "okay"; + port-index = <0>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_in0>; + }; + }; + }; + }; + }; + i2c@1 { + imx219_cam1: rbpcv2_imx219_b@10 { + compatible = "sony,imx219"; + /* I2C device address */ + reg = <0x10>; + + /* V4L2 device node location */ + devnode = "video1"; + + /* Physical dimensions of sensor */ + physical_w = "3.680"; + physical_h = "2.760"; + + sensor_model = "imx219"; + + use_sensor_mode_id = "true"; + + /** + * ==== Modes ==== + * A modeX node is required to support v4l2 driver + * implementation with NVIDIA camera software stack + * + * == Signal properties == + * + * phy_mode = ""; + * PHY mode used by the MIPI lanes for this device + * + * tegra_sinterface = ""; + * CSI Serial interface connected to tegra + * Incase of virtual HW devices, use virtual + * For SW emulated devices, use host + * + * pix_clk_hz = ""; + * Sensor pixel clock used for calculations like exposure and framerate + * + * readout_orientation = "0"; + * Based on camera module orientation. + * Only change readout_orientation if you specifically + * Program a different readout order for this mode + * + * == Image format Properties == + * + * active_w = ""; + * Pixel active region width + * + * active_h = ""; + * Pixel active region height + * + * pixel_t = ""; + * The sensor readout pixel pattern + * + * line_length = ""; + * Pixel line length (width) for sensor mode. + * + * == Source Control Settings == + * + * Gain factor used to convert fixed point integer to float + * Gain range [min_gain/gain_factor, max_gain/gain_factor] + * Gain step [step_gain/gain_factor is the smallest step that can be configured] + * Default gain [Default gain to be initialized for the control. + * use min_gain_val as default for optimal results] + * Framerate factor used to convert fixed point integer to float + * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor] + * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured] + * Default Framerate [Default framerate to be initialized for the control. + * use max_framerate to get required performance] + * Exposure factor used to convert fixed point integer to float + * For convenience use 1 sec = 1000000us as conversion factor + * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor] + * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured] + * Default Exposure Time [Default exposure to be initialized for the control. + * Set default exposure based on the default_framerate for optimal exposure settings] + * + * gain_factor = ""; (integer factor used for floating to fixed point conversion) + * min_gain_val = ""; (ceil to integer) + * max_gain_val = ""; (ceil to integer) + * step_gain_val = ""; (ceil to integer) + * default_gain = ""; (ceil to integer) + * Gain limits for mode + * + * exposure_factor = ""; (integer factor used for floating to fixed point conversion) + * min_exp_time = ""; (ceil to integer) + * max_exp_time = ""; (ceil to integer) + * step_exp_time = ""; (ceil to integer) + * default_exp_time = ""; (ceil to integer) + * Exposure Time limits for mode (sec) + * + * framerate_factor = ""; (integer factor used for floating to fixed point conversion) + * min_framerate = ""; (ceil to integer) + * max_framerate = ""; (ceil to integer) + * step_framerate = ""; (ceil to integer) + * default_framerate = ""; (ceil to integer) + * Framerate limits for mode (fps) + * + * embedded_metadata_height = ""; + * Sensor embedded metadata height in units of rows. + * If sensor does not support embedded metadata value should be 0. + */ + mode0 { /* IMX219_MODE_3280x2464_21FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_b"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "3280"; + active_h = "2464"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "21000000"; /* 21.0 fps */ + step_framerate = "1"; + default_framerate = "21000000"; /* 21.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"; + }; + mode1 { /* IMX219_MODE_3280x1848_28FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_b"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "3280"; + active_h = "1848"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "28000000"; /* 28.0 fps */ + step_framerate = "1"; + default_framerate = "28000000"; /* 28.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"; + }; + mode2 { /* IMX219_MODE_1920x1080_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_b"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1920"; + active_h = "1080"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 30.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 30.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"; + }; + mode3 { /* IMX219_MODE_1640x1232_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_b"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1640"; + active_h = "1232"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 60.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 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"; + }; + mode4 { /* IMX219_MODE_1280x720_60FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_b"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "6"; + + active_w = "1280"; + active_h = "720"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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"; + }; + /* + *mode5 { // IMX219_MODE_1280x720_120FPS + * mclk_khz = "24000"; + * num_lanes = "2"; + * tegra_sinterface = "serial_b"; + * phy_mode = "DPHY"; + * discontinuous_clk = "yes"; + * dpcm_enable = "false"; + * cil_settletime = "0"; + * lane_polarity = "6"; + + * active_w = "1280"; + * active_h = "720"; + * mode_type = "bayer"; + * pixel_phase = "rggb"; + * csi_pixel_bit_depth = "10"; + * readout_orientation = "90"; + * line_length = "3560"; + * inherent_gain = "1"; + * mclk_multiplier = "9.33"; + * pix_clk_hz = "169600000"; + + * gain_factor = "16"; + * framerate_factor = "1000000"; + * exposure_factor = "1000000"; + * min_gain_val = "16"; // 1.00x + * max_gain_val = "170"; // 10.66x + * 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 = "120000000"; // 120.0 fps + * step_framerate = "1"; + * default_framerate = "120000000"; // 120.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"; + *}; + */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + rbpcv2_imx219_out1: endpoint { + status = "okay"; + port-index = <1>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_in1>; + }; + }; + }; + }; + }; + i2c@2 { + imx219_cam2: rbpcv2_imx219_c@10 { + compatible = "sony,imx219"; + /* I2C device address */ + reg = <0x10>; + + /* V4L2 device node location */ + devnode = "video2"; + + /* Physical dimensions of sensor */ + physical_w = "3.680"; + physical_h = "2.760"; + + sensor_model = "imx219"; + + use_sensor_mode_id = "true"; + + /** + * ==== Modes ==== + * A modeX node is required to support v4l2 driver + * implementation with NVIDIA camera software stack + * + * == Signal properties == + * + * phy_mode = ""; + * PHY mode used by the MIPI lanes for this device + * + * tegra_sinterface = ""; + * CSI Serial interface connected to tegra + * Incase of virtual HW devices, use virtual + * For SW emulated devices, use host + * + * pix_clk_hz = ""; + * Sensor pixel clock used for calculations like exposure and framerate + * + * readout_orientation = "0"; + * Based on camera module orientation. + * Only change readout_orientation if you specifically + * Program a different readout order for this mode + * + * lane_polarity + * Based on the camera connector pin. + * CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1 + * LSB | BIT1 | BIT2 | MSB + * if there is a polarity swap on any lane, the bit corrsponding + * to the lane should be set + * e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001 + * e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110 + * + * == Image format Properties == + * + * active_w = ""; + * Pixel active region width + * + * active_h = ""; + * Pixel active region height + * + * pixel_t = ""; + * The sensor readout pixel pattern + * + * line_length = ""; + * Pixel line length (width) for sensor mode. + * + * == Source Control Settings == + * + * Gain factor used to convert fixed point integer to float + * Gain range [min_gain/gain_factor, max_gain/gain_factor] + * Gain step [step_gain/gain_factor is the smallest step that can be configured] + * Default gain [Default gain to be initialized for the control. + * use min_gain_val as default for optimal results] + * Framerate factor used to convert fixed point integer to float + * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor] + * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured] + * Default Framerate [Default framerate to be initialized for the control. + * use max_framerate to get required performance] + * Exposure factor used to convert fixed point integer to float + * For convenience use 1 sec = 1000000us as conversion factor + * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor] + * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured] + * Default Exposure Time [Default exposure to be initialized for the control. + * Set default exposure based on the default_framerate for optimal exposure settings] + * + * gain_factor = ""; (integer factor used for floating to fixed point conversion) + * min_gain_val = ""; (ceil to integer) + * max_gain_val = ""; (ceil to integer) + * step_gain_val = ""; (ceil to integer) + * default_gain = ""; (ceil to integer) + * Gain limits for mode + * + * exposure_factor = ""; (integer factor used for floating to fixed point conversion) + * min_exp_time = ""; (ceil to integer) + * max_exp_time = ""; (ceil to integer) + * step_exp_time = ""; (ceil to integer) + * default_exp_time = ""; (ceil to integer) + * Exposure Time limits for mode (sec) + * + * framerate_factor = ""; (integer factor used for floating to fixed point conversion) + * min_framerate = ""; (ceil to integer) + * max_framerate = ""; (ceil to integer) + * step_framerate = ""; (ceil to integer) + * default_framerate = ""; (ceil to integer) + * Framerate limits for mode (fps) + * + * embedded_metadata_height = ""; + * Sensor embedded metadata height in units of rows. + * If sensor does not support embedded metadata value should be 0. + */ + mode0 { /* IMX219_MODE_3280x2464_21FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_c"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "3280"; + active_h = "2464"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "21000000"; /* 21.0 fps */ + step_framerate = "1"; + default_framerate = "21000000"; /* 21.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"; + }; + mode1 { /* IMX219_MODE_3280x1848_28FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_c"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "3280"; + active_h = "1848"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "28000000"; /* 28.0 fps */ + step_framerate = "1"; + default_framerate = "28000000"; /* 28.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"; + }; + mode2 { /* IMX219_MODE_1920x1080_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_c"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1920"; + active_h = "1080"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 30.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 30.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"; + }; + + mode3 { /* IMX219_MODE_1640x1232_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_c"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1640"; + active_h = "1232"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 60.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 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"; + }; + + mode4 { /* IMX219_MODE_1280x720_60FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_c"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1280"; + active_h = "720"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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"; + }; + /* + *mode5 { IMX219_MODE_1280x720_120FPS + * mclk_khz = "24000"; + * num_lanes = "2"; + * tegra_sinterface = "serial_c"; + * phy_mode = "DPHY"; + * discontinuous_clk = "yes"; + * dpcm_enable = "false"; + * cil_settletime = "0"; + * lane_polarity = "0"; + + * active_w = "1280"; + * active_h = "720"; + * mode_type = "bayer"; + * pixel_phase = "rggb"; + * csi_pixel_bit_depth = "10"; + * readout_orientation = "90"; + * line_length = "3560"; + * inherent_gain = "1"; + * mclk_multiplier = "9.33"; + * pix_clk_hz = "169600000"; + + * gain_factor = "16"; + * framerate_factor = "1000000"; + * exposure_factor = "1000000"; + * min_gain_val = "16"; // 1.00x + * max_gain_val = "170"; // 10.66x + * 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 = "120000000"; // 120.0 fps + * step_framerate = "1"; + * default_framerate = "120000000"; // 120.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"; + *}; + */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + rbpcv2_imx219_out2: endpoint { + status = "okay"; + port-index = <2>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_in2>; + }; + }; + }; + }; + }; + i2c@3 { + imx219_cam3: rbpcv2_imx219_d@10 { + compatible = "sony,imx219"; + /* I2C device address */ + reg = <0x10>; + + /* V4L2 device node location */ + devnode = "video3"; + + /* Physical dimensions of sensor */ + physical_w = "3.680"; + physical_h = "2.760"; + + sensor_model = "imx219"; + + use_sensor_mode_id = "true"; + + /** + * ==== Modes ==== + * A modeX node is required to support v4l2 driver + * implementation with NVIDIA camera software stack + * + * == Signal properties == + * + * phy_mode = ""; + * PHY mode used by the MIPI lanes for this device + * + * tegra_sinterface = ""; + * CSI Serial interface connected to tegra + * Incase of virtual HW devices, use virtual + * For SW emulated devices, use host + * + * pix_clk_hz = ""; + * Sensor pixel clock used for calculations like exposure and framerate + * + * readout_orientation = "0"; + * Based on camera module orientation. + * Only change readout_orientation if you specifically + * Program a different readout order for this mode + * + * lane_polarity + * Based on the camera connector pin. + * CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1 + * LSB | BIT1 | BIT2 | MSB + * if there is a polarity swap on any lane, the bit corrsponding + * to the lane should be set + * e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001 + * e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110 + * + * == Image format Properties == + * + * active_w = ""; + * Pixel active region width + * + * active_h = ""; + * Pixel active region height + * + * pixel_t = ""; + * The sensor readout pixel pattern + * + * line_length = ""; + * Pixel line length (width) for sensor mode. + * + * == Source Control Settings == + * + * Gain factor used to convert fixed point integer to float + * Gain range [min_gain/gain_factor, max_gain/gain_factor] + * Gain step [step_gain/gain_factor is the smallest step that can be configured] + * Default gain [Default gain to be initialized for the control. + * use min_gain_val as default for optimal results] + * Framerate factor used to convert fixed point integer to float + * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor] + * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured] + * Default Framerate [Default framerate to be initialized for the control. + * use max_framerate to get required performance] + * Exposure factor used to convert fixed point integer to float + * For convenience use 1 sec = 1000000us as conversion factor + * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor] + * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured] + * Default Exposure Time [Default exposure to be initialized for the control. + * Set default exposure based on the default_framerate for optimal exposure settings] + * + * gain_factor = ""; (integer factor used for floating to fixed point conversion) + * min_gain_val = ""; (ceil to integer) + * max_gain_val = ""; (ceil to integer) + * step_gain_val = ""; (ceil to integer) + * default_gain = ""; (ceil to integer) + * Gain limits for mode + * + * exposure_factor = ""; (integer factor used for floating to fixed point conversion) + * min_exp_time = ""; (ceil to integer) + * max_exp_time = ""; (ceil to integer) + * step_exp_time = ""; (ceil to integer) + * default_exp_time = ""; (ceil to integer) + * Exposure Time limits for mode (sec) + * + * framerate_factor = ""; (integer factor used for floating to fixed point conversion) + * min_framerate = ""; (ceil to integer) + * max_framerate = ""; (ceil to integer) + * step_framerate = ""; (ceil to integer) + * default_framerate = ""; (ceil to integer) + * Framerate limits for mode (fps) + * + * embedded_metadata_height = ""; + * Sensor embedded metadata height in units of rows. + * If sensor does not support embedded metadata value should be 0. + */ + mode0 { /* IMX219_MODE_3280x2464_21FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_d"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "3280"; + active_h = "2464"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "21000000"; /* 21.0 fps */ + step_framerate = "1"; + default_framerate = "21000000"; /* 21.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"; + }; + mode1 { /* IMX219_MODE_3280x1848_28FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_d"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "3280"; + active_h = "1848"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "28000000"; /* 28.0 fps */ + step_framerate = "1"; + default_framerate = "28000000"; /* 28.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"; + }; + mode2 { /* IMX219_MODE_1920x1080_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_d"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1920"; + active_h = "1080"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 30.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 30.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"; + }; + + mode3 { /* IMX219_MODE_1640x1232_30FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_d"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1640"; + active_h = "1232"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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 = "30000000"; /* 60.0 fps */ + step_framerate = "1"; + default_framerate = "30000000"; /* 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"; + }; + + mode4 { /* IMX219_MODE_1280x720_60FPS */ + mclk_khz = "24000"; + num_lanes = "2"; + tegra_sinterface = "serial_d"; + phy_mode = "DPHY"; + discontinuous_clk = "yes"; + dpcm_enable = "false"; + cil_settletime = "0"; + lane_polarity = "0"; + + active_w = "1280"; + active_h = "720"; + mode_type = "bayer"; + pixel_phase = "rggb"; + csi_pixel_bit_depth = "10"; + 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"; /* 1.00x */ + max_gain_val = "170"; /* 10.66x */ + 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"; + }; + /* + *mode5 { IMX219_MODE_1280x720_120FPS + * mclk_khz = "24000"; + * num_lanes = "2"; + * tegra_sinterface = "serial_d"; + * phy_mode = "DPHY"; + * discontinuous_clk = "yes"; + * dpcm_enable = "false"; + * cil_settletime = "0"; + * lane_polarity = "0"; + + * active_w = "1280"; + * active_h = "720"; + * mode_type = "bayer"; + * pixel_phase = "rggb"; + * csi_pixel_bit_depth = "10"; + * readout_orientation = "90"; + * line_length = "3560"; + * inherent_gain = "1"; + * mclk_multiplier = "9.33"; + * pix_clk_hz = "169600000"; + + * gain_factor = "16"; + * framerate_factor = "1000000"; + * exposure_factor = "1000000"; + * min_gain_val = "16"; // 1.00x + * max_gain_val = "170"; // 10.66x + * 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 = "120000000"; // 120.0 fps + * step_framerate = "1"; + * default_framerate = "120000000"; // 120.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"; + *}; + */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + rbpcv2_imx219_out3: endpoint { + status = "okay"; + port-index = <3>; + bus-width = <2>; + remote-endpoint = <&rbpcv2_imx219_csi_in3>; + }; + }; + }; + }; + }; + }; + }; + + 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"; + /** + * Physical settings to calculate max ISO BW + * + * num_csi_lanes = <>; + * Total number of CSI lanes when all cameras are active + * + * max_lane_speed = <>; + * Max lane speed in Kbit/s + * + * min_bits_per_pixel = <>; + * Min bits per pixel + * + * vi_peak_byte_per_pixel = <>; + * Max byte per pixel for the VI ISO case + * + * vi_bw_margin_pct = <>; + * Vi bandwidth margin in percentage + * + * max_pixel_rate = <>; + * Max pixel rate in Kpixel/s for the ISP ISO case + * + * isp_peak_byte_per_pixel = <>; + * Max byte per pixel for the ISP ISO case + * + * isp_bw_margin_pct = <>; + * Isp bandwidth margin in percentage + */ + num_csi_lanes = <8>; + 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>; + + /** + * The general guideline for naming badge_info contains 3 parts, and is as follows, + * The first part is the camera_board_id for the module; if the module is in a FFD + * platform, then use the platform name for this part. + * The second part contains the position of the module, ex. "rear" or "front". + * The third part contains the last 6 characters of a part number which is found + * in the module's specsheet from the vendor. + */ + modules { + cam_module0: module0 { + badge = "topleft_RBP194"; + position = "topleft"; + orientation = "1"; + cam_module0_drivernode0: drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "imx219 9-0010"; + proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/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 = "topright_RBP194"; + position = "topright"; + orientation = "1"; + cam_module1_drivernode0: drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "imx219 10-0010"; + proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@1/rbpcv2_imx219_b@10"; + }; + cam_module1_drivernode1: drivernode1 { + pcl_id = "v4l2_lens"; + proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/"; + }; + }; + cam_module2: module2 { + badge = "bottomright_RBP194"; + position = "bottomright"; + orientation = "1"; + cam_module2_drivernode0: drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "imx219 11-0010"; + proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@2/rbpcv2_imx219_c@10"; + }; + cam_module2_drivernode1: drivernode1 { + pcl_id = "v4l2_lens"; + proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/"; + }; + }; + cam_module3: module3 { + badge = "bottomleft_RBP194"; + position = "bottomleft"; + orientation = "1"; + cam_module3_drivernode0: drivernode0 { + pcl_id = "v4l2_sensor"; + devname = "imx219 12-0010"; + proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@3/rbpcv2_imx219_d@10"; + }; + cam_module3_drivernode1: drivernode1 { + pcl_id = "v4l2_lens"; + proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/"; + }; + }; + }; + }; +}; diff --git a/cvb/tegra234-p3768-0000-a0.dtsi b/cvb/tegra234-p3768-0000-a0.dtsi index 01f41c8..fb98ed6 100644 --- a/cvb/tegra234-p3768-0000-a0.dtsi +++ b/cvb/tegra234-p3768-0000-a0.dtsi @@ -12,12 +12,14 @@ */ #include #include "dt-bindings/input/input.h" +#include #include "tegra234-p3768-0000-a0-pwm-fan.dtsi" #include "tegra234-p3768-0000-a0-pcie.dtsi" #include "tegra234-p3768-0000-a0-fixed-regulator.dtsi" #include "tegra234-p3768-audio.dtsi" -#include "tegra234-p3768-camera-rbpcv3-imx477.dtsi" -#include "tegra234-p3768-camera-rbpcv2-imx219.dtsi" +//#include "tegra234-p3768-camera-rbpcv3-imx477.dtsi" +//#include "tegra234-p3768-camera-rbpcv2-imx219.dtsi" +#include "tegra234-p3768-camera-ark-imx219.dtsi" / { gpio-keys { @@ -87,38 +89,54 @@ nvidia,function = "xusb"; status = "okay"; }; + usb3-2 { + nvidia,function = "xusb"; + status = "okay"; + }; }; }; }; ports { - usb2-0 {/* Goes to recovery port */ + usb2-0 {/* Goes to recovery port when micro usb connected, otherwise goes to Pixhawk */ mode = "otg"; status = "okay"; vbus-supply = <&p3768_vdd_5v_sys>; usb-role-switch; - port { - typec_p0: endpoint { - remote-endpoint = <&fusb_p0>; - }; - }; + connector { + compatible = "usb-b-connector", "gpio-usb-b-connector"; + label = "micro-USB"; + type = "micro"; + id-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Z, 1) GPIO_ACTIVE_LOW>; + //vbus-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Z, 1) GPIO_ACTIVE_HIGH>; + //cable-connected-on-boot = ; + }; + // port { + // typec_p0: endpoint { + // remote-endpoint = <&fusb_p0>; + // }; + // }; }; usb2-1 {/* Goes to hub */ mode = "host"; vbus-supply = <&p3768_vdd_av10_hub>; status = "okay"; }; - usb2-2 {/* Goes to M2.E */ + usb2-2 {/* Goes to Single USB A Port */ mode = "host"; vbus-supply = <&p3768_vdd_5v_sys>; status = "okay"; }; - usb3-0 {/* Goes to hub */ + usb3-0 {/* Goes to Single USB A Port */ + nvidia,usb2-companion = <2>; + status = "okay"; + }; + usb3-1 {/* Goes to Dual USB A Port (USB 2 comes from Hub)*/ nvidia,usb2-companion = <1>; status = "okay"; }; - usb3-1 {/* Goes to J5 */ - nvidia,usb2-companion = <0>; + usb3-2 {/* Goes to Dual USB A Port (USB 2 comes from Hub)*/ + nvidia,usb2-companion = <1>; status = "okay"; }; }; @@ -126,9 +144,8 @@ tegra_xudc: xudc@3550000 { status = "okay"; - phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>, - <&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>; - phy-names = "usb2-0", "usb3-1"; + phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>; + phy-names = "usb2-0"; nvidia,xusb-padctl = <&xusb_padctl>; }; @@ -138,30 +155,31 @@ <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-1}>, <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-2}>, <&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-0}>, - <&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>; - phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-0", "usb3-1"; + <&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>, + <&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-2}>; + phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-0", "usb3-1", "usb3-2"; nvidia,xusb-padctl = <&xusb_padctl>; }; - i2c@c240000{ - status = "okay"; - fusb301@25 { - compatible = "onsemi,fusb301"; - reg = <0x25>; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&tegra_main_gpio>; - interrupts = ; - connector@0 { - port@0 { - fusb_p0: endpoint { - remote-endpoint = <&typec_p0>; - }; - }; - }; - }; - }; + // i2c@c240000{ + // status = "okay"; + // fusb301@25 { + // compatible = "onsemi,fusb301"; + // reg = <0x25>; + // status = "okay"; + // #address-cells = <1>; + // #size-cells = <0>; + // interrupt-parent = <&tegra_main_gpio>; + // interrupts = ; + // connector@0 { + // port@0 { + // fusb_p0: endpoint { + // remote-endpoint = <&typec_p0>; + // }; + // }; + // }; + // }; + // }; spi@3210000{ /* SPI1 in 40 pin conn */ status = "okay"; spi@0 { /* chip select 0 */ @@ -259,35 +277,85 @@ display@13800000 { status = "okay"; + //os_gpio_hotplug_a = <&tegra_main_gpio TEGRA234_MAIN_GPIO(M, 0) GPIO_ACTIVE_HIGH>; }; - tegra-capture-vi { - ports { - port@0 { - endpoint { - port-index = <1>; - }; - }; - }; - }; + // tegra-capture-vi { + // ports { + // port@0 { + // endpoint { + // port-index = <1>; + // }; + // }; + // }; + // }; - host1x@13e00000 { - nvcsi@15a00000 { - csi_chan0 { + // host1x@13e00000 { + // nvcsi@15a00000 { + // csi_chan0 { + // ports { + // port@0 { + // endpoint@0 { + // port-index = <1>; + // }; + // }; + // }; + // }; + // }; + // }; + + i2c@3180000{ + i2c@0 { + rbpcv2_imx219_a@10 { + mode0 { + tegra_sinterface = "serial_a"; + lane_polarity = "6"; + }; + mode1 { + tegra_sinterface = "serial_a"; + lane_polarity = "6"; + }; + mode2 { + tegra_sinterface = "serial_a"; + lane_polarity = "6"; + }; + mode3 { + tegra_sinterface = "serial_a"; + lane_polarity = "6"; + }; + mode4 { + tegra_sinterface = "serial_a"; + lane_polarity = "6"; + }; ports { port@0 { - endpoint@0 { + endpoint { port-index = <1>; }; }; }; }; - }; - }; - cam_i2cmux{ - i2c@0 { - rbpcv2_imx219_a@10 { + // rbpcv3_imx477_a@1a { + // mode0 { + // tegra_sinterface = "serial_b"; + // lane_polarity = "6"; + // }; + // mode1 { + // tegra_sinterface = "serial_b"; + // lane_polarity = "6"; + // }; + // ports { + // port@0 { + // endpoint { + // port-index = <1>; + // }; + // }; + // }; + // }; + }; + i2c@1 { + rbpcv2_imx219_b@10 { mode0 { tegra_sinterface = "serial_b"; lane_polarity = "6"; @@ -316,15 +384,59 @@ }; }; }; - - rbpcv3_imx477_a@1a { + }; + i2c@2 { + rbpcv2_imx219_c@10 { mode0 { - tegra_sinterface = "serial_b"; - lane_polarity = "6"; + tegra_sinterface = "serial_c"; + lane_polarity = "0"; }; mode1 { - tegra_sinterface = "serial_b"; - lane_polarity = "6"; + tegra_sinterface = "serial_c"; + lane_polarity = "0"; + }; + mode2 { + tegra_sinterface = "serial_c"; + lane_polarity = "0"; + }; + mode3 { + tegra_sinterface = "serial_c"; + lane_polarity = "0"; + }; + mode4 { + tegra_sinterface = "serial_c"; + lane_polarity = "0"; + }; + ports { + port@0 { + endpoint { + port-index = <1>; + }; + }; + }; + }; + }; + i2c@3 { + rbpcv2_imx219_c@10 { + mode0 { + tegra_sinterface = "serial_d"; + lane_polarity = "0"; + }; + mode1 { + tegra_sinterface = "serial_d"; + lane_polarity = "0"; + }; + mode2 { + tegra_sinterface = "serial_d"; + lane_polarity = "0"; + }; + mode3 { + tegra_sinterface = "serial_d"; + lane_polarity = "0"; + }; + mode4 { + tegra_sinterface = "serial_d"; + lane_polarity = "0"; }; ports { port@0 { diff --git a/cvb/tegra234-p3768-camera-ark-imx219.dtsi b/cvb/tegra234-p3768-camera-ark-imx219.dtsi new file mode 100644 index 0000000..9f7062c --- /dev/null +++ b/cvb/tegra234-p3768-camera-ark-imx219.dtsi @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tegra234-camera-ark-imx219.dtsi" +#include "dt-bindings/clock/tegra234-clock.h" + +#define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6) +#define CAM1_PWDN TEGRA234_MAIN_GPIO(AC, 0) +#define CAM2_PWDN TEGRA234_MAIN_GPIO(Y, 4) +#define CAM3_PWDN TEGRA234_AON_GPIO(CC, 3) +//#define CAM_I2C_MUX TEGRA234_AON_GPIO(CC, 3) +#define CAMERA_I2C_MUX_BUS(x) (0x1E + x) + +/ { + i2c@3180000 { + gpio@2200000 { + camera-control-output-low { + gpio-hog; + output-low; + gpios = ; + label = "cam0-pwdn","cam1-pwdn", + "cam2-pwdn", "cam3-pwdn"; + }; + }; + + tca9546@70 { + compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + skip_mux_detect = "yes"; + force_bus_start = ; + status = "okay"; + + i2c@0 { + reg = <0>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + rbpcv2_imx219_a@10 { + /* Define any required hw resources needed by driver */ + /* ie. clocks, io pins, power sources */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH1>, + <&bpmp_clks TEGRA234_CLK_PLLP_OUT0>; + clock-names = "extperiph1", "pllp_grtba"; + mclk = "extperiph1"; + reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_LOW>; + }; + }; + i2c@1 { + reg = <1>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + rbpcv2_imx219_b@10 { + /* Define any required hw resources needed by driver */ + /* ie. clocks, io pins, power sources */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH2>, + <&bpmp_clks TEGRA234_CLK_PLLP_OUT0>; + clock-names = "extperiph2", "pllp_grtba"; + mclk = "extperiph2"; + reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_LOW>; + }; + }; + i2c@2 { + reg = <2>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + rbpcv2_imx219_c@10 { + /* Define any required hw resources needed by driver */ + /* ie. clocks, io pins, power sources */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH3>, + <&bpmp_clks TEGRA234_CLK_PLLP_OUT0>; + clock-names = "extperiph3", "pllp_grtba"; + mclk = "extperiph3"; + reset-gpios = <&tegra_main_gpio CAM2_PWDN GPIO_ACTIVE_LOW>; + }; + }; + i2c@3 { + reg = <3>; + i2c-mux,deselect-on-exit; + #address-cells = <1>; + #size-cells = <0>; + rbpcv2_imx219_d@10 { + /* Define any required hw resources needed by driver */ + /* ie. clocks, io pins, power sources */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH4>, + <&bpmp_clks TEGRA234_CLK_PLLP_OUT0>; + clock-names = "extperiph4", "pllp_grtba"; + mclk = "extperiph4"; + reset-gpios = <&tegra_aon_gpio CAM3_PWDN GPIO_ACTIVE_LOW>; + }; + }; + }; + }; +};