Jetson Orin mipical issues for custom board

We are using a custom board to adapter camera on Jetson AGX Orin Developer Kit.
This custom board is verified and work fine on Jetson AGX Xavier Developer Kit.
But this custom board need to change Brick config in csi5_fops.c

		brick_config.lane_polarity[0] = NVCSI_CPHY_POLARITY_CAB; //Trio1
		brick_config.lane_polarity[1] = NVCSI_CPHY_POLARITY_BCA; //Trio2
		brick_config.lane_polarity[2] = NVCSI_CPHY_POLARITY_CAB; //Trio3 not used
		brick_config.lane_polarity[3] = NVCSI_CPHY_POLARITY_CAB; //Trio4
		brick_config.lane_swizzle = NVCSI_LANE_SWIZZLE_A0A1B1B0;

I am to change csi5_mipi_cal for Xavier like down,It’s work fine.

cila = 
	(0x01 << CSI5_E_INPUT_LP_IO1_SHIFT) |
	(0x01 << CSI5_E_INPUT_LP_IO0_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_CLK_SHIFT) |
	(0x01 << CSI5_PD_CLK_SHIFT) |
	(0x00 << CSI5_PD_IO1_SHIFT) |
	(0x00 << CSI5_PD_IO0_SHIFT);
cilb =  
	(0x01 << CSI5_E_INPUT_LP_IO1_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_IO0_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_CLK_SHIFT) |
	(0x01 << CSI5_PD_CLK_SHIFT) |
	(0x00 << CSI5_PD_IO1_SHIFT) |
	(0x01 << CSI5_PD_IO0_SHIFT);

But Orin is not support csi5_mipi_cal now?
It’s show not calibration.

# tracer: nop
#
# entries-in-buffer/entries-written: 80/80   #P:12
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/0:4-522     [000] ....    80.582371: rtcpu_dbg_set_loglevel: tstamp:2935948392 old:0 new:2
        v4l2-ctl-1713    [011] ....    81.247494: tegra_channel_open: vi-output, cphycam2-0032
        v4l2-ctl-1713    [011] ....    81.269180: vb2_qbuf: owner = 0000000051ee2610, queued = 1, owned_by_drv = 0, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269184: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [011] ....    81.269195: vb2_qbuf: owner = 0000000051ee2610, queued = 2, owned_by_drv = 0, index = 1, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269196: v4l2_qbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [011] ....    81.269201: vb2_qbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 0, index = 2, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269201: v4l2_qbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [011] ....    81.269204: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 0, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269204: v4l2_qbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = ANY, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [011] ....    81.269214: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 1, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269215: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 2, index = 1, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269215: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 2, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269216: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 4, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [011] ....    81.269219: tegra_channel_set_power: cphycam 2-0032 : 0x1
        v4l2-ctl-1713    [011] ....    81.269227: camera_common_s_power: status : 0x1
        v4l2-ctl-1713    [000] ....    81.273769: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-1713    [000] ....    81.273773: csi_s_power: enable : 0x1
        v4l2-ctl-1713    [000] ....    81.274760: tegra_channel_capture_setup: vnc_id 0 W 4096 H 3072 fmt c4
        v4l2-ctl-1713    [000] ....    81.275343: tegra_channel_set_stream: enable : 0x1
        v4l2-ctl-1713    [000] ....    81.285178: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-1713    [000] ....    81.285180: csi_s_stream: enable : 0x1
        v4l2-ctl-1713    [000] ....    81.285690: tegra_channel_set_stream: cphycam 2-0032 : 0x1
     kworker/0:4-522     [000] ....    81.314338: rtcpu_vinotify_event: tstamp:2959337761 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:94688750368 data:0xc55cff0010000000
     kworker/0:4-522     [000] ....    81.314339: rtcpu_vinotify_event: tstamp:2959337922 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:94688757504 data:0x0000000031000001
     kworker/0:4-522     [000] ....    81.314339: rtcpu_vinotify_event: tstamp:2959338075 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:94688807584 data:0xc55cfc0010000000
     kworker/0:4-522     [000] ....    81.314340: rtcpu_vinotify_event: tstamp:2959338206 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:94688814816 data:0x0000000031000002
     kworker/0:4-522     [000] ....    81.426344: rtcpu_nvcsi_intr: tstamp:2963187896 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-522     [000] ....    81.426351: rtcpu_nvcsi_intr: tstamp:2963192902 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x20000000
     kworker/0:4-522     [000] ....    81.426355: rtcpu_nvcsi_intr: tstamp:2963193280 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x40000000
     kworker/0:4-522     [000] ....    81.426357: rtcpu_nvcsi_intr: tstamp:2963197416 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x40000000
 vi-output, semi-1715    [002] ....    83.934584: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.934599: vb2_dqbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 3, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.934605: v4l2_dqbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|ERROR|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [004] ....    83.934666: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.934667: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 4, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.934671: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 vi-output, semi-1715    [002] ....    83.935506: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 0, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    83.935511: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 2, index = 1, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    83.935512: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 1, index = 2, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    83.935514: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 0, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935516: vb2_dqbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 0, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935516: v4l2_dqbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|ERROR|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [004] ....    83.935531: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 0, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935531: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 1, index = 0, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935533: v4l2_qbuf: minor = 0, index = 0, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [004] ....    83.935534: vb2_dqbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 1, index = 1, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935534: v4l2_dqbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|ERROR|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 1
        v4l2-ctl-1713    [004] ....    83.935540: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 1, index = 1, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935540: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 2, index = 1, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935540: v4l2_qbuf: minor = 0, index = 1, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [004] ....    83.935541: vb2_dqbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 2, index = 2, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935542: v4l2_dqbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|ERROR|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 2
        v4l2-ctl-1713    [004] ....    83.935547: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 2, index = 2, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935547: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 2, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935547: v4l2_qbuf: minor = 0, index = 2, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
        v4l2-ctl-1713    [004] ....    83.935548: vb2_dqbuf: owner = 0000000051ee2610, queued = 3, owned_by_drv = 3, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935549: v4l2_dqbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|ERROR|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 3
        v4l2-ctl-1713    [004] ....    83.935554: vb2_qbuf: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935554: vb2_buf_queue: owner = 0000000051ee2610, queued = 4, owned_by_drv = 4, index = 3, type = 1, bytesused = 25165824, timestamp = 0
        v4l2-ctl-1713    [004] ....    83.935555: v4l2_qbuf: minor = 0, index = 3, type = VIDEO_CAPTURE, bytesused = 25165824, flags = MAPPED|QUEUED|TIMESTAMP_UNKNOWN|TIMESTAMP_MONOTONIC, field = NONE, timestamp = 0, timecode = { type = 0x0, flags = , frames = 0, seconds = 0, minutes = 0, hours = 0, userbits = { 0 0 0 0 } }, sequence = 0
 vi-output, semi-1715    [002] ....    83.936594: tegra_channel_capture_setup: vnc_id 0 W 4096 H 3072 fmt c4
     kworker/0:4-522     [000] ....    83.954268: rtcpu_vinotify_event: tstamp:3042341010 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:97350078080 data:0xc55cff0010000000
     kworker/0:4-522     [000] ....    83.954280: rtcpu_vinotify_event: tstamp:3042341151 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:97350085216 data:0x0000000031000001
     kworker/0:4-522     [000] ....    83.954286: rtcpu_vinotify_event: tstamp:3042341304 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:97350124256 data:0xc55cfc0010000000
     kworker/0:4-522     [000] ....    83.954289: rtcpu_vinotify_event: tstamp:3042341436 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:97350131456 data:0x0000000031000002
        v4l2-ctl-1713    [005] ....    84.984248: tegra_channel_close: vi-output, cphycam 2-0032
 vi-output, semi-1715    [002] ....    86.462983: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 3, index = 0, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    86.463548: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 2, index = 1, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    86.463551: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 1, index = 2, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    86.463552: vb2_buf_done: owner = 0000000051ee2610, queued = 4, owned_by_drv = 0, index = 3, type = 1, bytesused = 25165824, timestamp = 0
 vi-output, semi-1715    [002] ....    86.464748: tegra_channel_capture_setup: vnc_id 0 W 4096 H 3072 fmt c4
        v4l2-ctl-1713    [005] ....    86.465523: tegra_channel_set_stream: enable : 0x0
        v4l2-ctl-1713    [005] ....    86.465531: tegra_channel_set_stream: cphycam 2-0032 : 0x0
        v4l2-ctl-1713    [005] ....    86.466123: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-1713    [005] ....    86.466129: csi_s_stream: enable : 0x0
        v4l2-ctl-1713    [000] ....    86.477823: tegra_channel_set_power: cphycam 2-0032 : 0x0
        v4l2-ctl-1713    [000] ....    86.477877: camera_common_s_power: status : 0x0
        v4l2-ctl-1713    [005] ....    86.487387: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-1713    [005] ....    86.487397: csi_s_power: enable : 0x0

Have a check if output data rate > 1.5G for your pix_clk_hz to adjust it to try.

Hi ShaneCCC:
Thank you, I had update pix_clk_hz to 1710000000. It’s still is the same messages.
I am run CPHY 3 trio each run 1.71G, but my custom board is run on Trio1/2/4(CILA0/A1 & CILB1), I need to skip Trio3 (CILB0).
Do you had any idea to change mipical like this?It’s seems run with Camera RTCPU that I can’t change NVCSI_PHY_0_NVCSI_CIL_A_PAD_CONFIG_0 & NVCSI_PHY_0_NVCSI_CIL_B_PAD_CONFIG_0

cila = 
	(0x01 << CSI5_E_INPUT_LP_IO1_SHIFT) |
	(0x01 << CSI5_E_INPUT_LP_IO0_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_CLK_SHIFT) |
	(0x01 << CSI5_PD_CLK_SHIFT) |
	(0x00 << CSI5_PD_IO1_SHIFT) |
	(0x00 << CSI5_PD_IO0_SHIFT);
cilb =  
	(0x01 << CSI5_E_INPUT_LP_IO1_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_IO0_SHIFT) |
	(0x00 << CSI5_E_INPUT_LP_CLK_SHIFT) |
	(0x01 << CSI5_PD_CLK_SHIFT) |
	(0x00 << CSI5_PD_IO1_SHIFT) |
	(0x01 << CSI5_PD_IO0_SHIFT);

Suppose Orin and Xavier share the same driver(csi5_fops.c)
Unable config like Xavier?

Hi ShaneCCC:
Yes, This function is never run in, but Xavier does.

static int csi5_mipi_cal(struct tegra_csi_channel *chan)

Please try J5.0 Xavier to confirm if the csi5_mipi_cal()

Thanks

Sorry ShaneCCC:
It’s so late to relay you.
Jetson 5.0 Xavier is working with csi5_mipi_cal()
But, Orin is not working…