Multi Virtual Channel Implementation in a CSI port using Xavier NX

Hi everyone,
Can I configure imx219 driver for receiving 4 virtual channel(VC0,VC1,VC2,VC3) packet dynamically in Jetson Xavier NX. If Can what are the driver file I want to modify. My present driver can receive VC0 channel packet successfully but I want to receive all channel packet sequentially without packet discarding.
Does anyone can give some Idea to implement this. Thanks

Hi everyone,
In imx390 dtsi file of xavier NX devnode = “video” is not present, without adding devnode in dtsi file how I can read data using v4l2 driver. Can anyone give some idea to read data using imx319 driver.

hello PaulEnoch,

are you working with SerDes chips for your sensor driver?
you may also refer to Jetson Virtual Channel with GMSL Framework Guide for more details.

Hello JerryChang.
Thanks for your reference. Yes Jerry my custom has SerDes chip.Could you please suggest how to use v4l2 command to read data using imx390 driver because I can’t find /dev/video0 file after enabling imx390, max9295 and max9296 drivers. Is imx390 driver will create any other file for reading each Virtual channel data separately.

Thanks for your time.

hello PaulEnoch,

please share the kernel initialization messages for reference,
you should see the video nodes (i.e. /dev/video0 ) once the device registration is complete without failures.

BTW, is it possible to enable test-pattern-generator on the SerDes chip (i.e. Max9295/Max9296), it usually helps for issue narrow down,

1 Like

Hello JerryChang,
Thanks for your response. Actually I have modified imx390 sensor driver as per my custom sensor. My custom sensor send continuous data without i2c triggering so that I have disabled serializer and i2c trigger section. When am making my driver I have seen below warnings, I have added extern and EXPORT_SYMBOL_GPL() in max9296.c file but warnings is not removing. Because of this my driver failed.
WARNING: "max9296_start_streaming"undefined!
WARNING: “max9296_power_on” undefined!
WARNING: “max9296_stop_streaming” undefined!
WARNING: “max9296_power_off” undefined!
Here I have attached my sensor driver file. JerryChang could you please go through and give some suggestion to debug it.

Thanks for your time. (28.1 KB)

hello PaulEnoch,

could you please share kernel initialization messages for reference before looking into your kernel sources,
you may setup serial console to gather console logs, or you may use $ dmesg > klog.txt for checking kernel logs.

Hello JerryChang,
Here I have attached kernel log. ThankskernelLog.txt (71.7 KB)

hello PaulEnoch,

could you please check the sensor port binding?
I’ve only see below messages which related to your sensor initialization.
did the video device register to /dev/video* successfully for the usage?

[    2.951580] tegra194-vi5 subdev 15a00000.nvcsi--2 bound
[    2.951689] tegra194-vi5 subdev 15a00000.nvcsi--1 bound

Hi JerryChang,
/dev/video0 video device is not registered and when am loading my imx390 module it generating error imx390: loading out-of-tree module taints kernel. Here I have attached my imx390 driver and dtsi file for your reference. Could give some suggestion to debug it.

imx390.c (21.9 KB) tegra194-camera-imx390-a00.txt (13.7 KB)

This vi5 is imx219 sensor port binding actually it enable when booting itself. I am loading imx module after booting.
How to enable imx390 sensor porting at the time of booting instead of imx219. please give me any suggestion.

hello PaulEnoch,

please also refer to Port Binding to review your device tree.
you may also execute media-ctl commands to verify the port binding results.

may I know what’s the image it is? is this a single line image or only metadata?

				compatible = "nvidia,imx390";
				mode0 {
					active_w = "256";
					active_h = "1";

Hi JerryChang

It’s my custom sensor data for verification.
Single line data using imx219 driver I read 4 virtual channel data separately by configuring kernel. But I want to read it one by one sequentially.
Jerry without adding devnode = video0 in imx390 dtsi file how it will register /dev/video0. This is confusing me without adding devnode in driver/ dtsi file how video device will register.
If I want to add devnode, where I want to add.

Thanks for your time

hello PaulEnoch,

so, you’re making your sensor driver as kernel module (*.ko) ?
you may refer to Loadable Kernel Module (LKM) for necessary changes of sensor driver.

here’s Device Registration session you may refer to for sensor device instantiated when the kernel boots.

please access Tutorials page, you may expand [Developer Tools] session for training materials.
please check this training video, V4L2 Sensor Driver Development Tutorial for reference.

Hello JerryChang,
Thanks for your support. Yes am making my sensor driver as kernel module. I found the error that imx390 dtsi file is not loaded. One I register my imx390 dtsi file I will update you.

Thanks for your time.

Hello JerryChang,
After booting my device I have checked the command dmseg | grep dts, It gives following output.
[ 0.430744] DTS File Name: …/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dts
[ 0.698103] DTS File Name: …/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dts
In Xavier NX kernel source there is two folder for dtsi file galen and Jakku. Imx390 dtsi file present in galen path. How can I add imx390 to Jakku when am adding it through more errors like below.

DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx274-hdmi.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx185_v1.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-maxn.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-e3366-1199.dtb
DTC arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0006-p2822-0000.dtb
CHK include/generated/asm-offsets.h
CALL …/scripts/
ERROR (phandle_references): Reference to non-existent node or label “p2822_vdd_1v8_cvb”

ERROR (phandle_references): Reference to non-existent node or label “p2822_vdd_1v8_cvb”

ERROR: Input tree has errors, aborting (use -f to force output)
…/arch/arm64/boot/dts/Makefile:120: recipe for target ‘arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dtb’ failed
make[2]: *** [arch/arm64/boot/dts/ddot/ddot/ddot/ddot/ddot/ddot/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dtb] Error 2
make[2]: *** Waiting for unfinished jobs…
ERROR (phandle_references): Reference to non-existent node or label “e3326_vi_in0”

ERROR (phandle_references): Reference to non-existent node or label “e3326_csi_out0”

ERROR (phandle_references): Reference to non-existent node or label “e3326_csi_in0”

ERROR (phandle_references): Reference to non-existent node or label “e3326_ov5693_out0”

ERROR (phandle_references): Reference to non-existent node or label “e3326_csi_out0”

ERROR (phandle_references): Reference to non-existent node or label “e3326_vi_in0”

ERROR (phandle_references): Reference to non-existent node or label “tca6408_21”

ERROR (phandle_references): Reference to non-existent node or label “tca9548_77”

ERROR (phandle_references): Reference to non-existent node or label “e3333_vi_in0”

ERROR (phandle_references): Reference to non-existent node or label “e3333_csi_out0”

ERROR (phandle_references): Reference to non-existent node or label “e3333_csi_in0”

ERROR (phandle_references): Reference to non-existent node or label “e3333_ov5693_out0”

please give any suggestion

Thanks for your time

hello PaulEnoch,

those two device tree folders under /hardware/nvidia/platform/t19x/.
jakku/ were DT sources for NX platforms and galen/ to include DT for Xavier platforms. there’re regulator settings that were used by Xavier, you may port all of necessary items to NX to fix those compile errors.

you may check documentation, such as Jetson Xavier NX Product Design Guide, and also Jetson Xavier NX Platform Adaptation and Bring-Up for reference,

Hello JerryChang,
Thank you so much. I will update you.

Hi JerryChang,
I ported imx370 driver to my xavier NX board but it’s creating following error.

[ 0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
[ 0.431632] DTS File Name: …/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dts
[ 0.698860] DTS File Name: …/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dts
[ 1.395930] t194-nvcsi 15a00000.nvcsi: initialized
[ 1.418194] nvdla 15880000.nvdla0: initialized
[ 1.901944] mousedev: PS/2 mouse device common for all mice
[ 2.060744] tegra194_cpufreq_probe: platform driver Initialization: pass
[ 2.079194] hidraw: raw HID events driver © Jiri Kosina
[ 2.090538] misc nvmap: cvsram :dma coherent mem declare 0x0000000050000000,4194304
[ 2.096194] trusty_ipc virtio0: vring1: va(pa) ffffffc1e2aa0000(0) qsz 32 notifyid 2
[ 2.319468] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
[ 3.015391] tegra194-isp5 14800000.isp: initialized
[ 3.022385] tegra194-vi5 using default number of vi channels, 36
[ 3.030350] tegra194-vi5 initialized
[ 3.034867] tegra194-vi5 tegra_channel_csi_init:Fail to parse port info
[ 3.035091] tegra194-vi5 channel init failed
[ 3.035242] tegra194-vi5 tegra_channel_csi_init:Fail to parse port info
[ 3.035417] tegra194-vi5 channel init failed
[ 3.035544] tegra194-vi5 all channel init failed
[ 3.035684] tegra194-vi5 Init channel failed
[ 3.035960] tegra194-vi5 tegra_vi_media_controller_init: failed
[ 3.036144] tegra194-vi5 media controller init failed
[ 5.334391] imx390 30-001b: probing v4l2 sensor.
[ 5.335400] imx390 30-001b: tegracam sensor driver:imx390_v2.0.6
[ 5.335498] imx390 30-001b: Detected IMX390 sensor
[ 5.335586] imx390 30-001c: probing v4l2 sensor.
[ 5.335767] imx390 30-001c: couldn’t create debugfs
[ 5.335970] imx390 30-001c: tegracam sensor driver:imx390_v2.0.6
[ 5.336033] imx390 30-001c: Detected IMX390 sensor

Imx390 sensor driver is detected but /dev/video0 not created.
Is this error is generating from imx390 source file or dtsi file. Could you please suggest any idea. 

Thanks for your time.

hello PaulEnoch,

is there a typo?

ideally, video nodes will register to /dev/video* once the probing process complete.

could you please also look into kernel messages for the reports of tegra194-vi5,
there should be also sub device bound info from VI driver.
for example,

[    7.810474] ov5693 2-0036: probing v4l2 sensor.
[    7.814140] ov5693 2-0036: tegracam sensor driver:ov5693_v2.0.6
[    8.837158] tegra194-vi5 subdev ov5693 2-0036 bound