/* * Copyright (c) 2018-2019, 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 . */ /* camera control gpio definitions */ /* * Copyright (c) 2018-2019, 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 / { host1x { vi@15c10000 { num-channels = <2>; status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; vi_port0: port@0 { reg = <0>; ecam_ar0521_vi_in0: endpoint { port-index = <0>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_csi_out0>; }; }; vi_port1: port@1 { reg = <1>; ecam_ar0521_vi_in1: endpoint { port-index = <2>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_csi_out1>; }; }; }; }; nvcsi@15a00000 { num-channels = <2>; #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>; ecam_ar0521_csi_in0: endpoint@0 { port-index = <0>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_out0>; }; }; csi_chan0_port1: port@1 { reg = <1>; ecam_ar0521_csi_out0: endpoint@1 { remote-endpoint = <&ecam_ar0521_vi_in0>; }; }; }; }; csi_chan1: channel@1 { reg = <1>; ports { #address-cells = <1>; #size-cells = <0>; csi_chan1_port0: port@0 { reg = <0>; ecam_ar0521_csi_in1: endpoint@2 { port-index = <2>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_out1>; }; }; csi_chan1_port1: port@1 { reg = <1>; ecam_ar0521_csi_out1: endpoint@3 { remote-endpoint = <&ecam_ar0521_vi_in1>; }; }; }; }; }; }; i2c@3180000 { tca9546@70 { i2c@0 { #address-cells = <1>; #size-cells = <0>; ar0521_cam0: ecam_ar0521_a@42 { compatible = "nvidia,ar0521"; /* I2C device address */ reg = <0x42>; /* V4L2 device node location */ devnode = "video0"; status = "okay"; /* Physical dimensions of sensor */ physical_w = "3.680"; physical_h = "2.760"; sensor_model = "ar0521"; //Default use_sensor_mode_id is false /*use_sensor_mode_id = "false";*/ camera_mipi_lanes = <2>; disable-framesync; /** * ==== 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 { /* AR0521_MODE_640x480_75FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; mode_type = "yuv"; active_w = "640"; active_h = "480"; /* pixel_t = "uyvy";*/ pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /* 10.66x */ step_gain_val = "1"; default_gain = "16"; /* 1.00x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "75"; /* 21.0 fps */ step_framerate = "1"; default_framerate = "21000000"; /* 21.0 fps */ min_exp_time = "1"; /* us */ max_exp_time = "43000000"; /* us */ embedded_metadata_height = "0"; }; mode1 { /* AR0521_MODE_1280x720_100FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "1280"; active_h = "720"; pixel_phase = "uyvy"; mode_type = "yuv"; /*pixel_t = "bayer_rggb";*/ readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /* 1.00x */ max_gain_val = "48"; /* 10.66x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "100"; /* 28.0 fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; mode2 { /* AR0521_MODE_1280x960_75FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; csi_pixel_bit_depth = "16"; active_w = "1280"; active_h = "960"; /*pixel_t = "uyvy";*/ pixel_phase = "uyvy"; mode_type = "yuv"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /* 1.00x */ max_gain_val = "48"; /* 10.66x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "75"; /* 75.0 fps */ default_framerate = "30000000"; /* 30.0 fps */ min_exp_time = "13"; /* us */ max_exp_time = "683709"; /* us */ step_exp_time = "1"; embedded_metadata_height = "0"; }; mode3 { /* AR0521_MODE_1920x1080_67FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "1920"; active_h = "1080"; /* pixel_t = "uyvy";*/ pixel_phase = "uyvy"; mode_type = "yuv"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /*dB*/ max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "67"; /* 67.0 fps */ min_exp_time = "1"; max_exp_time = "430000"; embedded_metadata_height = "0"; }; mode4 { /* Ar0521_MODE_2560x1440_38FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "2560"; active_h = "1440"; /* pixel_t = "uyvy"; */ mode_type = "yuv"; pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "38"; /* 38fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; mode5 { /* Ar0521_MODE_2592x1944_28FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "2592"; active_h = "1944"; /* pixel_t = "uyvy"; */ mode_type = "yuv"; pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "28"; /* 38fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; ecam_ar0521_out0: endpoint { port-index = <0>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_csi_in0>; }; }; }; }; }; i2c@1 { #address-cells = <1>; #size-cells = <0>; ar0521_cam1: ecam_ar0521_c@42 { compatible = "nvidia,ar0521"; /* I2C device address */ reg = <0x42>; /* V4L2 device node location */ devnode = "video1"; status = "okay"; /* Physical dimensions of sensor */ physical_w = "3.680"; physical_h = "2.760"; sensor_model = "ar0521"; camera_mipi_lanes = <2>; disable-framesync; // Default use_sensor_mode_id is false /*use_sensor_mode_id = "false";*/ /** * ==== 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 { /* AR0521_MODE_640x480_75FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; mode_type = "yuv"; active_w = "640"; active_h = "480"; /* pixel_t = "uyvy";*/ pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /* 10.66x */ step_gain_val = "1"; default_gain = "16"; /* 1.00x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "75"; /* 21.0 fps */ step_framerate = "1"; default_framerate = "21000000"; /* 21.0 fps */ min_exp_time = "1"; /* us */ max_exp_time = "43000000"; /* us */ embedded_metadata_height = "0"; }; mode1 { /* AR0521_MODE_1280x720_100FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "1280"; active_h = "720"; pixel_phase = "uyvy"; mode_type = "yuv"; /*pixel_t = "bayer_rggb";*/ readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /* 1.00x */ max_gain_val = "48"; /* 10.66x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "100"; /* 28.0 fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; mode2 { /* AR0521_MODE_1280x960_75FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; csi_pixel_bit_depth = "16"; active_w = "1280"; active_h = "960"; /*pixel_t = "uyvy";*/ pixel_phase = "uyvy"; mode_type = "yuv"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /* 1.00x */ max_gain_val = "48"; /* 10.66x */ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 2.0 fps */ max_framerate = "75"; /* 75.0 fps */ default_framerate = "30000000"; /* 30.0 fps */ min_exp_time = "13"; /* us */ max_exp_time = "683709"; /* us */ step_exp_time = "1"; embedded_metadata_height = "0"; }; mode3 { /* AR0521_MODE_1920x1080_67FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "1920"; active_h = "1080"; /* pixel_t = "uyvy";*/ pixel_phase = "uyvy"; mode_type = "yuv"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; /*dB*/ max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "67"; /* 67.0 fps */ min_exp_time = "1"; max_exp_time = "430000"; embedded_metadata_height = "0"; }; mode4 { /* Ar0521_MODE_2560x1440_38FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "2560"; active_h = "1440"; /* pixel_t = "uyvy"; */ mode_type = "yuv"; pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "38"; /* 38fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; mode5 { /* Ar0521_MODE_2592x1944_28FPS */ mclk_khz = "48000"; num_lanes = "2"; tegra_sinterface = "serial_a"; phy_mode = "DPHY"; discontinuous_clk = "yes"; dpcm_enable = "false"; cil_settletime = "0"; dynamic_pixel_bit_depth = "16"; csi_pixel_bit_depth = "16"; active_w = "2592"; active_h = "1944"; /* pixel_t = "uyvy"; */ mode_type = "yuv"; pixel_phase = "uyvy"; readout_orientation = "0"; line_length = "2000"; inherent_gain = "1"; mclk_multiplier = "18"; pix_clk_hz = "1200000000"; min_gain_val = "0"; max_gain_val = "48"; /*dB*/ min_hdr_ratio = "1"; max_hdr_ratio = "1"; min_framerate = "1"; /* 1 fps */ max_framerate = "28"; /* 38fps */ min_exp_time = "1"; /* us */ max_exp_time = "430000"; /* us */ embedded_metadata_height = "0"; }; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; ecam_ar0521_out1: endpoint { status = "okay"; port-index = <2>; bus-width = <2>; remote-endpoint = <&ecam_ar0521_csi_in1>; }; }; }; }; }; }; }; }; / { 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 = <16>; max_lane_speed = <2500000>; min_bits_per_pixel = <16>; vi_peak_byte_per_pixel = <2>; vi_bw_margin_pct = <67>; /** * 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 = "porg_front_ar0521"; position = "front"; orientation = "1"; cam_module0_drivernode0: drivernode0 { pcl_id = "v4l2_sensor"; devname = "ar0521 9-0010"; proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/ecam_ar0521_a@42"; }; }; cam_module1: module1 { badge = "porg_rear_ar0521"; position = "rear"; orientation = "1"; cam_module1_drivernode0: drivernode0 { pcl_id = "v4l2_sensor"; devname = "ar0521 10-0010"; proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@1/ecam_ar0521_c@42"; }; }; }; }; };