I am attempting to create a driver for a MIPI CSI-2 DPHY 4-lane camera with NO i2c interface (camera is always on) on a Jetson Orin Nano Development Kit running Jetpack 6.2. Information on how to do this is available in many small fragments for various devices and versions of software. Here is what I have aggregated from all of this - to create a driver for such a camera I should get the kernel source code and use the imx185 as a guide and perform the following steps:
Change names and parameters in the nv_imx185.c code to match my camera and remove the i2c methods.
Build the kernel module (.ko file) using ‘make modules’ from the Linux_for_Tegra/source directory and copy the new .ko file to /lib/modules/5.15.148-tegra/updates/drivers/media/i2c
Cannibalize following files to create an appropriate device tree overlay for my camera:
tegra234-camera-imx185-a00.dtsi
tegra234-p3737-0000-camera-imx185-a00.dtsi
tegra234-p3737-camera-imx185-overlay.dts
Using ‘make dtbs’ in Linux_for_Tegra/source, build the device tree overlay (.dtbo) file for my device and copy it to /boot
Edit the extlinux.conf file in a similar manner to what the jetson-io tool does and point the configuration at my new overlay file in /boot.
Connect and power-on the camera, and boot the Jetson device to get it to load the device tree overlay and corresponding driver.
Is this general approach correct? If not, can you please, please tell me what is the correct approach?
Thanks! - I had already read those and found both of those resources useful, but I did not notice the release notes until late in the process. I was surprised (but happy) to find such a good outline of driver-related development in release notes.
Again, I greatly appreciate the help! I followed the outline above and have produced and compiled a kernel module, copied it to the directory specified above, produced the .dts and dtsi files based on the imx185, copied the resulting overlay file to the /boot directory and pointed to it with the /boo/extlinux/extlinux.conf file.
So far, so good. The configuration does get loaded when I boot with the camera attached, but my kernel module does not seem to get loaded, and my probe method is, of course, not called. I have scoured the log files and all related documentation and cannot quite figure out why - could you offer me any clues, please?
Trying to attach .c, .dts, and .dtsi files, but the webiste won’t allow it? nv_mira.c.txt (5.0 KB) tegra234-camera-mira-a00.dtsi.txt (8.6 KB) tegra234-p3737-0000-camera-mira-a00.dtsi.txt (1.4 KB) tegra234-p3737-camera-mira-overlay.dts.txt (5.2 KB)
I did not update the kernel, just added-in my “mira.ko” file for the driver, added the new overlay .dtbo file and pointed at the overlay file with the config. I was under the impression that this would be adequate, and I would not need to update the kernel also. Seems like that is what the jetson-io tool does?
please refer to.. Building the NVIDIA Out-of-Tree Modules.
anyways, this is a closed topic, please file another new forum discussion thread if you need further supports.