Jetson TX2 CSI port interfacing

We are using a custom hardware to convert SDI-CSI2 and using that to interface with Jetson TX2 CSI port. By following Sensor programming guide I have modified the device tree and can see /dev/video0, however on trying to capture data using v4l2-ctl I am seeing syncpt error.

[ +0.999808] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.002984] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.002663] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.005185] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

[1] TX2 is expecting Start of frame and timedout waiting for this. It could mean that data is not being received at TX2 end or not formatted correctly. Unfortunately I cannot probe on the lanes to check the data, are there any means with in the tegra vi driver to dump whatever is being received?

[2] We are using 4 data lanes connected to CSI4 and CSI5 on the Jetson board, which parameters in device-tree/tegra driver represent these values so that the SoC can read data from these ports?

I am using num_lanes = “4”, tegra_sinterface = “serial_a”, are these correct?

[3] Are there any specific set of registers that can be read to see if things are configured correctly?

[4] Any utilities/debugfs files to dump registers or read their values?

Please check below wiki to enable trace for more information. And I believe CSI4 and CSI5 should be serial_e and num_lanes = “4”

https://elinux.org/Jetson_TX2/28.1_Camera_BringUp

Could you let me know where are these mapping details explained? couldn’t find it in TX2 (Parker) TRM?

There are no obvious errors from the logs,

[ +0.007538] tegra-vi4 15700000.vi: Create Surface with imgW=1920, imgH=1080, memFmt=32
[ +0.006503] nvcsi 150c0000.nvcsi: csi port:0
[ +0.004488] nvcsi 150c0000.nvcsi: csi4_start_streaming ports index=0, lanes=4
[ +0.007167] nvcsi 150c0000.nvcsi: csi4_stream_init
[ +0.004858] nvcsi 150c0000.nvcsi: csi4_stream_config
[ +0.005002] nvcsi 150c0000.nvcsi: csi4_stream_config (0) read VC0_DPCM_CTRL = 00000000
[ +0.007954] nvcsi 150c0000.nvcsi: csi4_phy_config, phy_num=0, cil_a=true, csi_lanes=4
[ +0.007843] nvcsi 150c0000.nvcsi: NVCSI_CIL_CONFIG = 00000000
[ +0.999955] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.003291] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.003443] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ +1.003167] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[Jan 9 12:31] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!
[ +0.011656] nvcsi 150c0000.nvcsi: csi4_stop_streaming ports index=0, lanes=4
[ +0.007138] nvcsi 150c0000.nvcsi: csi4_phy_config, phy_num=0, cil_a=true, csi_lanes=4
[ +0.008110] nvcsi 150c0000.nvcsi: NVCSI_CIL_CONFIG = 00000004
[ +0.006198] nvcsi 150c0000.nvcsi: csi4_stream_check_status, pg_mode=0
[ +0.006568] nvcsi 150c0000.nvcsi: csi4_cil_check_status

With tracing enabled I get the following, could you explain what does it mean?

 kworker/3:2-705   [003] ...1   123.222667: rtos_queue_peek_from_isr_failed: tstamp:4153203551 queue:0x0b4a3c58
 kworker/3:2-705   [003] ...1   123.222671: rtcpu_start: tstamp:4153204412
 kworker/3:2-705   [003] ...1   123.378067: rtos_queue_peek_from_isr_failed: tstamp:4158204437 queue:0x0b4a3c58
 kworker/3:2-705   [003] ...1   123.534061: rtos_queue_peek_from_isr_failed: tstamp:4163204968 queue:0x0b4a3c58
 kworker/3:2-705   [003] ...1   123.690056: rtos_queue_peek_from_isr_failed: tstamp:4168205477 queue:0x0b4a3c58
 kworker/3:2-705   [003] ...1   123.846065: rtos_queue_peek_from_isr_failed: tstamp:4173205992 queue:0x0b4a3c58
 kworker/3:2-705   [003] ...1   124.002058: rtos_queue_peek_from_isr_failed: tstamp:4178206492 queue:0x0b4a3c58

I have a question regarding MIPI calibration.

We are using 4 lanes of CSI4, CSI5 on the Jetson carrier board and as you mentioned earlier it corresponds to tegra_sinterface=“serial_e”

[ 38.022112] nvcsi 150c0000.nvcsi: csi port:0, num_lanes=4
[ 38.027512] tegra_mipi_cal 3990000.mipical: tegra_mipi_calibration
[ 38.033744] tegra_mipical_using_prod(), lanes=0x300000
[ 38.039105] tegra_mipi_wait(), CIL_MIPI_CAL_STATUS=0x00319880, lanes=0x300000

[1] The lanes value suggest that calibration is done only for CSIA, CSIB.
I am not sure whether these correspond to the lanes that we are using (CSI4, CSI5).

Could you please let me know how to check this?

[2] csi4_mipi_cal() in csi4_fops.c only uses lanes CSIA, CSIB - what about the other lanes (C~F)? Are they not required?

In summary, how does the channels CSI[0:5] on the carrier board correspond to channels CSI[A:F] referenced in the driver?

Regarding MIPI calibration - After going through the code I think it is clear to me now, previously csi-port=<0> because of which it was selecting lanes A, B.

I have changed csi-port=<4> and now I can see lanes E,F being selected but the PXL_SOF error is still there.

[ +0.005424] tegra_mipi_cal 3990000.mipical: tegra_mipi_calibration
[ +0.006207] tegra_mipical_using_prod(), lanes=0x3000000
[ +0.005513] tegra_mipi_wait(), CIL_MIPI_CAL_STATUS=0x03019880, lanes=0x3000000

Could you clarify what does the following trace messages mean?
kworker/3:2-705 [003] …1 123.222667: rtos_queue_peek_from_isr_failed: tstamp:4153203551 queue:0x0b4a3c58
kworker/3:2-705 [003] …1 123.222671: rtcpu_start: tstamp:4153204412
kworker/3:2-705 [003] …1 123.378067: rtos_queue_peek_from_isr_failed: tstamp:4158204437 queue:0x0b4a3c58
kworker/3:2-705 [003] …1 123.534061: rtos_queue_peek_from_isr_failed: tstamp:4163204968 queue:0x0b4a3c58
kworker/3:2-705 [003] …1 123.690056: rtos_queue_peek_from_isr_failed: tstamp:4168205477 queue:0x0b4a3c58
kworker/3:2-705 [003] …1 123.846065: rtos_queue_peek_from_isr_failed: tstamp:4173205992 queue:0x0b4a3c58
kworker/3:2-705 [003] …1 124.002058: rtos_queue_peek_from_isr_failed: tstamp:4178206492 queue:0x0b4a3c58

@asiluvery
From your tracing log tell CSI didn’t get any validate frame from the MIPI bus.
You can check the VI notify when you get some others message from the trace.

No correct both of CSIA - CSIF will done the calibration. There’s a while loop to go through the CSIA-B, CSIC-D, CSIE-F