Hi,
We are porting IMX296 sensor driver to Jetson Nano L4T 32.2.
IMX296 is mono/color sensor 1440x1080, 60 FPS, 1 lane, 1.2 Gbps/lane.
The driver probes OK, but the streaming fails. Attempt to get one frame enters into probably infinite loop with the following error messages:
v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1
[ 527.376631] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 0
[ 527.392955] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 1
[ 527.409834] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 2
[ 527.426508] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 3
[ 527.442632] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 4
[ 527.459222] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 5
[ 527.475890] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 6
[ 527.493291] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 7
[ 527.509050] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 8
[ 527.525937] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 9
[ 527.542422] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 10
[ 527.559153] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 11
. . . . . . . . . . . . .
Here is our device tree:
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#define CAM0_RST_L TEGRA_GPIO(S, 4)
#define CAM0_PWDN TEGRA_GPIO(S, 7)
/ {
gpio@2200000 {
camera-control-output-low {
status = "okay";
gpio-hog;
output-low;
gpios = < CAM0_PWDN 0 >; // gpios = <CAM0_RST_L 0 CAM0_PWDN 0>;
label = "cam0-pwdn"; // label = "cam0-rst", "cam0-pwdn";
};
};
host1x {
vi_base: vi {
num-channels = <1>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port0: port@0 {
reg = <0>;
imx296_vi_in0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&imx296_csi_out0>;
};
};
};
};
csi_base: nvcsi {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
csi_chan0: channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
csi_chan0_port0: port@0 {
reg = <0>;
imx296_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&imx296_out0>;
};
};
csi_chan0_port1: port@1 {
reg = <1>;
imx296_csi_out0: endpoint@1 {
remote-endpoint = <&imx296_vi_in0>;
};
};
};
};
};
i2c@546c0000 {
status = "okay";
imx296_c@1a {
compatible = "nvidia,imx296";
reg = <0x1a>;
devnode = "video0";
status = "okay";
reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
sensor_model ="imx296";
use_sensor_mode_id = "true";
mode0 { // IMX296_MODE_1440X1080, 60 FPS
mclk_khz = "24000";
num_lanes = "1";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1440";
active_h = "1080";
pixel_t = "y10";
csi_pixel_bit_depth = "8";
readout_orientation = "90";
line_length = "2048";
inherent_gain = "1";
mclk_multiplier = "9.33";
// 1440 * 1080 * 60 = 93312000:
pix_clk_hz = "93312000";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "0";
max_gain_val = "480";
step_gain_val = "1";
default_gain = "200";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "10000000"; /* 10.0 fps */
max_framerate = "60000000"; /* 60.0 fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0 fps */
min_exp_time = "29"; // us
max_exp_time = "15110711"; // us
step_exp_time = "1";
default_exp_time = "10000"; // us
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx296_out0: endpoint {
port-index = <0>; // <2> : TX2
bus-width = <2>; // +++
remote-endpoint = <&imx296_csi_in0>;
};
};
};
};
};
}; // host1x
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <1>; // <2>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <8>;
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>;
status = "okay";
modules {
cam_module0: module0 {
status = "okay";
badge = "porg_front_RBPCV2";
position = "front";
orientation = "1";
cam_module0_drivernode0: drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx296 6-001a"; /* Driver v4l2 device name */
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx296_c@1a";
};
};
};
};
};