IMX415 Capture issue on NVIDIA AGX Xavier

Hi All,

I’m developing custom imx415 camera on NVIDIA AGX Xavier Dev kit.

  1. Created mode0 node in dtsi file and set the porperties.
				mode0 {
					mclk_khz = "37125";
					num_lanes = "4";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "no";
					dpcm_enable = "false";
					cil_settletime = "0";
					dynamic_pixel_bit_depth = "12";
					csi_pixel_bit_depth = "12";
					mode_type = "bayer";
					pixel_phase = "gbrg";

					active_w = "1920";
					active_h = "1080";
					readout_orientation = "0";
					line_length = "6600";
					inherent_gain = "1";
					mclk_multiplier = "40.40";
					pix_clk_hz = "693000000"; //"693000000" 2079Mbps*4lane/raw12;

					gain_factor = "10";
					min_gain_val = "1";
					max_gain_val = "300";
					step_gain_val = "3";
					default_gain = "1";
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					framerate_factor = "1000000";
					min_framerate = "45000000";
					max_framerate = "60000000";
					step_framerate = "1";
					default_framerate = "60000000";
					exposure_factor = "1000000";
					min_exp_time = "450";
					max_exp_time = "400000";
					step_exp_time = "1";
					default_exp_time = "12195";
					embedded_metadata_height = "1";
				};
  1. device driver test for streaming
    For the streaming test, we used the v4l2-ctl command.

  2. The following error message log appeared.

serial-terminal 
[   85.746540] imx415 2-001a: imx415_set_mode: mode 0
[   85.765268] imx415 2-001a: imx415_set_mode: setting mode complete
[   85.765422] imx415 2-001a: imx415_set_gain: val: 61
[   85.765516] imx415 2-001a: imx415_set_gain: val-limit: 61
[   85.765921] imx415 2-001a: imx415_calculate_exposure_shr: val: 16666
[   85.766052] imx415 2-001a: imx415_calculate_exposure_shr: shr: 2266 vmax: 3390 factor: 1000000
[   85.768477] imx415 2-001a: imx415_set_frame_rate: val:0
[   85.768579] imx415 2-001a: !imx415_set_frame_rate: val:60000000, VMAX:1125
[   85.768693] imx415 2-001a: !!!imx415_set_frame_rate: VMAX_DUMP:3390d, VMAX:d3e
[   85.772764] imx415 2-001a: imx415_set_frame_rate: write_reg:3026, VMAX:0
[   85.779175] imx415 2-001a: imx415_set_frame_rate: write_reg:3025, VMAX:d
[   85.785428] imx415 2-001a: imx415_set_frame_rate: write_reg:3024, VMAX:3e
[   85.791910] imx415 2-001a: imx415_set_frame_rate: PCLK:693000000, LL:6600, fps:60, VMAX:3390
[   87.378705] tegra194-vi5 15c10000.vi: no reply from camera processor
[   87.378859] tegra194-vi5 15c10000.vi: vi capture get status failed
[   90.418545] tegra194-vi5 15c10000.vi: no reply from camera processor
[   90.418700] tegra194-vi5 15c10000.vi: vi capture get status failed
[   93.426496] tegra194-vi5 15c10000.vi: no reply from camera processor
[   93.426649] tegra194-vi5 15c10000.vi: vi capture get status failed
[   96.434402] tegra194-vi5 15c10000.vi: no reply from camera processor
[   96.434590] tegra194-vi5 15c10000.vi: vi capture get status failed
trace log 
kworker/0:3-2155  [000] ....   224.803919: rtcpu_nvcsi_intr: tstamp:7349921959 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803920: rtcpu_nvcsi_intr: tstamp:7349928546 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803939: rtcpu_nvcsi_intr: tstamp:7349928546 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803939: rtcpu_nvcsi_intr: tstamp:7349935132 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803939: rtcpu_nvcsi_intr: tstamp:7349935132 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803939: rtcpu_nvcsi_intr: tstamp:7349941723 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803939: rtcpu_nvcsi_intr: tstamp:7349941723 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803940: rtcpu_nvcsi_intr: tstamp:7349948301 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803940: rtcpu_nvcsi_intr: tstamp:7349948301 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803940: rtcpu_nvcsi_intr: tstamp:7349954888 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803940: rtcpu_nvcsi_intr: tstamp:7349954888 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044
kworker/0:3-2155  [000] ....   224.803940: rtcpu_nvcsi_intr: tstamp:7349961474 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044
kworker/0:3-2155  [000] ....   224.803941: rtcpu_nvcsi_intr: tstamp:7349961474 class:CORRECTABLE_ERR type:PHY_INTR phy:0 cil:0 st:0 vc:0 status:0x00001044

Is there any other settings or parameters I need to change in the Driver or Device Tree to get this fixed?

Did you review the the port-index/bus-width in the device tree?
Have a check the REG NVCSI_PHY_0_CILA_INTR_0_STATUS_CILA_0 in TRM for the log.

tstamp:7349928546 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x10000044

Hello ShaneCCC,

I reviewed device tree about port-index/bus-width.

I found lane speed setting was wrong.
my custom sensor mipi datarate is 2079Mbps
I modified lane speed value as shown below.

before 
max_lane_speed = <1500000>;

after 
max_lane_speed = <2400000>;

Streaming is working good.

Is it correct that my modified part is related to the above error log?

Try modify the pix_clk_hz instead of max_lane_speed.
Or boost the nvcsi/vi clocks to verify it.
If below command help on it the problem is the pix_clk_hz too smaller to allocate to low bandwidth cause the problem. Adjust the pix_clk_hz should able help on it.

And if your design have SER/DESER add serdes_pix_clk_hz and define it as bigger than pix_clk_hz as much in device tree for it.

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate