I’m trying enable dual imx283 output on orin nx, but can only detect one camera:
My device tree’s setting here:
/*
* Copyright (c) 2022-2023, 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 <http://www.gnu.org/licenses/>.
*/
#define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_PWDN TEGRA234_MAIN_GPIO(AC, 0)
//#define CAM2_PWDN TEGRA234_MAIN_GPIO(Q, 6)
#define CAM_I2C_MUX TEGRA234_AON_GPIO(CC, 3)
//#define CAM_SW_A TEGRA234_MAIN_GPIO(G, 6)
/ {
tegra-capture-vi {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_cam_vi_in0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_csi_out0>;
};
};
port@1 {
reg = <1>;
mipi_cam_vi_in1: endpoint {
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_csi_out1>;
};
};
};
};
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <2>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_cam_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_out0>;
};
};
port@1 {
reg = <1>;
mipi_cam_csi_out0: endpoint@1 {
remote-endpoint = <&mipi_cam_vi_in0>;
};
};
};
};
channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_cam_csi_in1: endpoint@2 {
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_out1>;
};
};
port@1 {
reg = <1>;
mipi_cam_csi_out1: endpoint@3 {
remote-endpoint = <&mipi_cam_vi_in1>;
};
};
};
};
};
};
cam_i2cmux {
i2c@0 {
sw_mipi_cam0: cam_0@1a {
compatible = "sensing,imx283_0";
/* I2C device address */
reg = <0x1a>;
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.680";
physical_h = "2.760";
sensor_model = "imx283";
use_sensor_mode_id = "true";
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
/* ==== Modes ====*/
mode0 {
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
lane_polarity = "6";
active_w = "5496";
active_h = "3694";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "5740";
inherent_gain = "1";
mclk_multiplier = "20";
pix_clk_hz = "480000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "20000000";/* 20.0fps */
step_framerate = "1";
default_framerate = "20000000"; /* 20.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode1{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
lane_polarity = "6";
active_w = "5496";
active_h = "3694";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "5740";
inherent_gain = "1";
mclk_multiplier = "21";
pix_clk_hz = "518000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "25000000";/* 25.0fps */
step_framerate = "1";
default_framerate = "25000000"; /* 25.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode2{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2748";
active_h = "1842";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "2976";
inherent_gain = "1";
mclk_multiplier = "12";
pix_clk_hz = "288000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "50000000";/* 50.0fps */
step_framerate = "1";
default_framerate = "50000000"; /* 50.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode3{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1832";
active_h = "1234";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "2200";
inherent_gain = "1";
mclk_multiplier = "12";
pix_clk_hz = "288000000";
lane_polarity = "6";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "60000000";/* 60.0fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode4{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
lane_polarity = "6";
active_w = "3872";
active_h = "2174";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "3968";
inherent_gain = "1";
mclk_multiplier = "21";
pix_clk_hz = "504000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "60000000";/* 60.0fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_cam_out0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_csi_in0>;
};
};
};
};
};
i2c@1 {
sw_mipi_cam1: cam_1@1a {
compatible = "sensing,imx283_1";
/* I2C device address */
reg = <0x1a>;
/* V4L2 device node location */
devnode = "video1";
/* Physical dimensions of sensor */
physical_w = "3.680";
physical_h = "2.760";
sensor_model = "imx283";
use_sensor_mode_id = "true";
reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
/* ==== Modes ====*/
mode0 {
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "5496";
active_h = "3694";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "5740";
inherent_gain = "1";
mclk_multiplier = "20";
pix_clk_hz = "480000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "20000000";/* 25.0fps */
step_framerate = "1";
default_framerate = "20000000"; /* 25.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
/* readout related settings */
// num_of_exposure = "1";
// num_of_ignored_lines = "24";
// num_of_lines_offset_0 = "0";
// num_of_ignored_pixels = "0";
// num_of_left_margin_pixels = "108";
// num_of_right_margin_pixels = "12";
embedded_metadata_height = "1";
};
mode1{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "5496";
active_h = "3694";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "5592";
inherent_gain = "1";
mclk_multiplier = "21";
pix_clk_hz = "518000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "25000000";/* 25.0fps */
step_framerate = "1";
default_framerate = "25000000"; /* 25.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode2{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2748";
active_h = "1842";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "2976";
inherent_gain = "1";
mclk_multiplier = "12";
pix_clk_hz = "288000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "50000000";/* 25.0fps */
step_framerate = "1";
default_framerate = "50000000"; /* 25.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode3{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1832";
active_h = "1234";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "12";
readout_orientation = "90";
line_length = "2200";
inherent_gain = "1";
mclk_multiplier = "12";
pix_clk_hz = "288000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "60000000";/* 60.0fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
mode4{
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "3872";
active_h = "2174";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "3968";
inherent_gain = "1";
mclk_multiplier = "21";
pix_clk_hz = "504000000";
gain_factor = "1";
min_gain_val = "0"; /* 0d 0db*/
max_gain_val = "1957"; /* 1957d 27db Gain[db]=-20log{(2048)-PGC{10:0]/2048}*/
step_gain_val = "1";
default_gain = "0"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "2000000";/* 2.0fps */
max_framerate = "60000000";/* 60.0fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0fps */
exposure_factor = "1000000";
min_exp_time = "52"; /* us */
max_exp_time = "49865"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "1";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_cam_out1: endpoint {
port-index = <2>;
bus-width = <4>;
remote-endpoint = <&mipi_cam_csi_in1>;
};
};
};
};
};
};
};
/ {
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 = <7500000>;
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 {
module0 {
badge = "imx283_front";
position = "front";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx283 9-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/cam_0@1a";
};
};
module1 {
badge = "imx283_rear";
position = "rear";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx283 10-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/cam_1@1a";
};
};
};
};
};
/*
* 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 <http://www.gnu.org/licenses/>.
*/
//#if defined(SG_MIPI_IMX283)
#include "sg-mipi-imx283.dtsi"
//#elif defined(SG_MIPI_IMX577)
//#include "sg-mipi-imx577.dtsi"
//#endif
/ {
cam_i2cmux {
compatible = "i2c-mux-gpio";
#address-cells = <1>;
#size-cells = <0>;
mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
i2c-parent = <&cam_i2c>;
i2c@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
};
};
gpio@2200000 {
camera-control-output-low {
gpio-hog;
output-low;
gpios = < CAM1_PWDN 0 CAM0_PWDN 0>;
label = "cam1-pwdn", "cam0-pwdn";
};
};
};
I think I’ve check every related setting, like port index, tegra_sinterface and so on, I have no idea why the camera 0 is good but camera 1 can’t even be detect