How to get YUV420 video format on Xavier CSI?

We use the FPGA for HDMI video to MIPI CSI, video format YUV422, resolution 3840x2160xP30.
HDMI video 3840x2160xP30 → FPGA → MIPI CSI 4 Lanes / YUV420 Normal
The FPGA convert the HDMI video into MIPI CSI format and is connected to MIPI CSI interface 4 Lanes(CSI A, CSI B) of Xavier
As below block diagram:

Accoding to Jetson L4T Camera BringUp
I Boost the clock for debug.

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

and enable the csi debug message from below command, and use v4l2-ctl to verify the driver first.

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
echo 2 > /sys/class/video4linux/video0/dev_debug
echo file vi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file vi4_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi4_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi5_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file nvcsi.c +p > /sys/kernel/debug/dynamic_debug/control
echo file v4l2-compat-ioctl32.c +p > /sys/kernel/debug/dynamic_debug/control
echo file tegracam_v4l2.c +p > /sys/kernel/debug/dynamic_debug/control

But I get CHANSEL_NOMATCH=0x00000309 in trace log (see trace_log_3840x2160xP30_20210923_01.txt)
trace_log_3840x2160xP30_20210923_01.txt (1.3 MB)
kernel_log_3840x2160xP30_20210923_01.txt (429.2 KB)
CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:2906933321 data:0x00000309
bit 0 no_match= 1
bit 1-4 CTYPE= 0x4 = LS
bit 5-10 DTYPE= 24 = NvCsiDataType_YUV420_8

May I to konw how to analyze the CHANSEL_NOMATCH root cause?
How to get 3840x2160xP30 YUV420 video format on Xavier CSI?

hello SammyChenTw,

you may try to configure it as 10-bits for testing,
for example, csi_pixel_bit_depth= "10"

there’re some dynamic_debug are not used by Xavier’s drivers,
you may simply enable vi-5 and csi-5 to gather the necessary debug logs.

If I configure the csi_pixel_bit_depth= "10" in device tree,
What’s action I need to do in FPGA driver?

hello SammyChenTw,

csi_pixel_bit_depth in the device tree define the bits of the stream. so you’ll need to configure FPGA to output 10-bits.