I’m currently trying to understand how to make /dev/video0 appear and how to receive data coming in from a 4-lane CSI-2 connection in RAW12 format. For the time being, I only want to read the received data. I do not have an actual camera connected, it’s more like an FPGA. I checked this thread and this thread as well, but they are talking about the Xavier and I am still unsure about a couple of things:
I thought about using the IMX185 driver and adapt it to my needs, but I do not seem to find the source files, even so, would it be easier to create a custom overlay file and write a driver? My goal is to only read incoming data over the CSI-2 lanes, that’s it. There’s no configuration over I2C happening, the FPGA simply continuously streams data over CSI-2.
Can I write my driver directly on the Jetson platform? If so, how do I convert it into a kernel module to load it into the kernel?
Any tips or a generic step-by-step rundown of the simplest method on how to achieve something like that would be greatly appreciated. Printing out incoming CSI-2 data is sufficient for my needs at the moment. Currently, I’m a bit overwhelmed by the amount of information and /dev/video0 not appearing, probably due to the I2C checks not passing when I select the IMX185 hardware configuration over jetson-io. If the device node would appear, I could start playing around with the dtsi configuration, but I don’t even find the correct dtsi files anywhere, which would lead me to decompile the current active dtb file, do some changes there, compile and apply it again.
Select your Jetpack version. If possible install the latest Jetpack.
Select the Jetson Linux Link (eg Jetson Linux 35.4.1 | NVIDIA Developer for Jetpack 5.1.2)
Download the “Driver Package (BSP) Sources”. This contains all source code for the kernel and all the drivers and the device tree source.
Yes. Usually a make modules should work. You really need very good kernel programming skills, though.
PS: As you will see the source is for all supported Jetson modules (Xavier and Orin). The kernel and the modules are the same across all modules, the device tree is specific to each module.
I got the sources by using the source_sync.sh script on my Ubuntu host PC. Executing cat /etc/nv_tegra_release on the Jetson platform shows me R35, Revision 3.1, so I used the tag jetson_35.3.1 to sync all sources. I am still unsure on how to further tackle this problem, but my plan is as follows:
Modify the e3333 DTSI file such to reduce it from 6 to 1 camera. It’s the only dtsi file that links to the ov5693 driver. Problem is, two versions of the same file exists, one is located at <...>/Linux_for_Tegra/sources/hardware/nvidia/platform/t23x/common/kernel-dts/t234-common-modules, the other one at <...>/Linux_for_Tegra/sources/hardware/nvidia/platform/t23x/concord/kernel-dts, so I’m unsure which is the correct one. My plan is to make it a similar as possible to existing e3326 dtsi file, found on other platforms like this one. Basically commenting out all modules except the first one and also only leaving i2c@0 and mode0 therein intact. EDIT: Solved, the one in the concord directory is simply the overlay present when using the JetsonIO tool, meaning I’ll modify the other one.
Modify the ov5693.c file to pass on all i2c checks. Problem is, I could only find a ov5693.c file at <...>/Linux_for_Tegra/sources/kernel/kernel-5.10/drivers/staging/media/atomisp/i2c/ov5693, which seems like a very odd path.
If both 1. and 2. have been cleared up, I’d build the kernel and flash the device, hopefully making /dev/video0 appear. From that point on, I could start to fine tune the e3333 dtsi file.
After grep’ing through all source files, I can’t seem to find the appropriate ov5693.c file from NVIDIA after having sync’d the source files…
EDIT: Syncing the source files did not yield a ov5693.c / ov5693_mode_tbls.h file, I had to manually download and unpack the source files, as @fchkjwlsq suggested.
Whatever I do, /dev/video0 simply does not show up. I flashed the device with a new fresh image and did the following:
I used JetsonIO to enable the E3333 overlay.
I commented out all the i2c code in the ov5693.c file, both flashed the device with the new kernel module but also created a loadable module on the Jetson platform and used insmod.
I added additional debug output to the ov5693.c file, with printk and also dev_dbg(…), but sudo dmesg does not show any reference to ov5693 and my custom prints
I checked cat /proc/device-tree/i2c@3180000/tca9548@77/i2c@*/ov5693_*@36/status, as well as the status of the tca9548 itself, they all returned okay
Still, /dev/video0 does not appear. I do not get any output using sudo dmesg, so I am unable to debug this problem. As I only applied the E3333 DTSI file over JetsonIO and loaded a slightly modified kernel module for the ov5693 the problem should be easy to detect.
Edit: dmesg shows me the following, I’m not sure whether this is related (could be, as there is no pca953x multiplexer present on my custom board):
[ 8.051179] pca954x 2-0077: supply vcc-pullup not found, using dummy regulator
[ 8.059740] pca954x 2-0077: pca954x_probe: forcing device bus number, start 30.
[ 8.068252] pca954x 2-0077: device detect skipped.
[ 8.074597] pca954x 2-0077: probe failed
[ 8.079747] pca954x: probe of 2-0077 failed with error -121
[ 8.087039] pca953x 2-0021: using no AI
[ 8.092662] pca953x 2-0021: failed writing register
[ 8.098689] pca953x: probe of 2-0021 failed with error -121
Does anyone have any possible solutions to this problem?