MIPI CSI Camera without i2c

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:

  1. Change names and parameters in the nv_imx185.c code to match my camera and remove the i2c methods.
  2. 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
  3. 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
  4. Using ‘make dtbs’ in Linux_for_Tegra/source, build the device tree overlay (.dtbo) file for my device and copy it to /boot
  5. 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.
  6. 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?

hello apachecreeksoftware,

ya, that’s looks correct.

for sensor driver development.
you may check developer guide, Sensor Software Driver Programming,
and, please see-also Release Notes (r36.4.3) of [4. Implementation Details] for reference.

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)

hello apachecreeksoftware,

did you also updated.. /boot/Image?

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?

I have now also tried completely rebuilding the kernel, copying the new Image to /boot , and restarting with very much the same result.

hello apachecreeksoftware,

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.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.