Registering and verifying camera driver and its settings

Hi, I’ve downloaded the bsp source for jetson linux 34.1.1 and I’ve written a custom V4L2 GMSL camera driver and its device tree for the omnivision sensor OX03A10 with imx185 and imx390 camera drivers as reference. I was following the sensor software driver programming guide and I have a few questions:

  1. I want to register the camera driver by modifying the main platform device tree file, following this step:
    Sensor Software Driver Programming — Jetson Linux<br/>Developer Guide 34.1 documentation
    For the Orin AGX which file should I modify? Is it the file tegra234-p3701-0000-p3737-0000.dts under the path /hardware/nvidia/platform/t23x/concord/kernel-dts/ ?
    Should I actually change anything in this file? For example, the plugin manager is not included in the .dts file. And the cvb/tegra234-p3737-camera-modules.dtsi file includes many camera device tree files, so in principle just including my camera device tree file in the above .dtsi file and changing it’s status to ‘okay’ should suffice right? Or should I create a new .dtsi file like the other sample camera .dtsi files ? In the sample files, I don’t see anywhere where there is a status = disabled or okay flag.
    And will just saving the changes to this file, recompiling kernel and flashing the new image register the driver?

  2. If I use the above mentioned main platform device tree modification method to register a driver, should a device tree overlay file also be made?

  3. An adaptor board is being made to connected the GMSL camera to the jetson camera connector, but the connector cable will arrive with a delay. Is it possible to check if the port bindings or the camera driver work properly in some way without connecting the camera?

  4. And is there a way to update the kernel with the new driver without flashing again? I know we can make the driver a loadable module, but which file do I modify to add the CONFIG_VIDEO =m setting? And in this case the kernel has to be recompiled and flashed anyway when the driver is added for the first time right?

  5. If the deserialiser on an external board is already configued with an external microcontroller, should I still include deserialiser settings in the device tree files? For example, can I use pix_clk_hz property instead of ser_des_pix_clk_hz?

I would really appreciate any answers you could provide.

  1. It’s better to create new dts for specific sensor.
  2. Using main platform that tells only include your sensor dts without overlay.
  3. Not possible.
  4. Build the sensor driver as loadable module than just replace the *.ko instead fo flash the kernel image.
  5. Need implement the SER/DESER driver not just only sensor driver.

Thank you for the answer!

Just to clarify what I understand from the reply:

  1. I create new .dtsi file for camera under hardware/nvidia/platform/t23x/concord/kernel-dts/cvb. Then I include it in the main platform .dts file tegra234-p3701-0000-p3737-0000.dts(I assume then this is the main platform dts file) and save it without other modifications.

  2. So no device overlay file is required, just doing the above step(including custom camera dts in main platform tree) is enough to register the driver.

  3. That’s unfortunate. Then I’ll see if we can make a hand soldered connector cable meanwhile so we can connect and check with camera sooner.

  4. Understood, I add the setting CONFIG_VIDEO ovx3a=min kernel configuration file under kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig, build kernel and driver and move the .ko file to jetson file system on orin and I should be able to load it.

  5. The camera I’m trying to connect also uses the max9295a ser and max9296 deser. I notice that there is already a driver for this serdes combination in the bsp package, can I just reuse them for my purpose? The deser will be configured by external microcontroller and communication happens over the deser driver, the ser and sensor drivers configure the ser and sensor. In theory this should work right?

Please correct me if my understanding is wrong.

I have just one further question, I see in the sensor software programming guide, this note:



Note

Use tegra194-p2822-camera-modules.dtsi as a model for generating your .dtsi file. In your file, change status = disable to status = okay.

In which file should I add this setting in the orin? The main platform .dts file? Or in my custom camera .dtsi file which I include in the platform .dts file?
And I assume I should enable this setting not only for sensor but also for the serdes?

  1. You need remove plugin manager. Check the document.
  2. No need device tree overlay if you don’t need enable it dynamical after boot to system.
  3. Suppose the max929x is default for imx390. You may need to modify it for others.