New Camera Device tree and Driver conflicts - Boot and driver binding problem

Hi, I’m using a Jetson Orin Nano with a Waveshare carrier board. The camera sensor is the OmniVision OS08A20. Camera module link: https://www.nxp.com/design/design-center/development-boards-and-designs/4K-MIPI-CMOS-CAMERA-MODULE. Between the camera module and the Jetson, I’m using an NXP adapter board.

I’ve started writing the device tree for this camera based on the IMX477 dual DTS file.

tegra234-p3767-camera-p3768-os08a20-dual-4plus.txt (16.2 KB)

I uploaded it here as a text file. The device tree successfully detects the camera module on I²C, and I can read the chip ID correctly. The next step is to bind the driver so the CSI interface is detected and streaming works. I’ve started writing a minimal base driver based on nv_imx477.c. I also uploaded the driver source and the related header files here:

nv_os08a20.txt (15.7 KB)
headers:

os08a20_mode_tbls.txt (18.6 KB)

os08a20.txt (2.1 KB)

After binding the driver, syncing, and rebooting, the Jetson didn’t boot and stayed here:

ing

I couldn’t edit the extlinux.conf after this to put the os08a20 driver in the blacklist.
The problem seems to be that something has conflicts between DT and the driver. Or something else I don’t know.
Please take a look at the files and help me stream this sensor.
thanks.

I have to mention that, previously, I edited the extlinux.conf file like this:
TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0003-nv.dtb
OVERLAYS overlays/tegra234-p3767-camera-p3768-imx477-dual-4lane.dtbo
APPEND ${cbootargs} root=PARTUUID=5635775e-428b-4a21-931a-586e83837bae rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 video=efifb:off console=tty0 nv-auto-config

And it worked.

However, after experiencing a one-time problem with Jetson and flashing it with the SDK Manager, this model did not bind the DT to the current device tree.
Then I used a command to merge my new device tree with the current device tree, and I had a merged version of the DTB file.

The kernel crash could be the sensor driver missing some thing.

You can make the sensor driver to loadable modules(.ko) to probe after boot to system to debug it.

Hi Shane,
Thanks for your help.
I have built the .ko file, and with insmod, I have verified it.
The problem is that the Jetson reboots immediately after executing the insmod command.
and the dmesg returns this:
nv_os08a20: module verification failed: signature and/or required key missing - tainting kernel.

I have to say that I have simplified the driver and put some debug reporting parts to track the driver issues, but nothing is reported.

Hello @ms.alijani

I think this post Module sign key ignore - #6 by JerryChang could be helpful for you!

Regards!
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi Eduardo,

The main problem now is that after loading with sudo insmod, the Jetson reboots.
From the device tree, I had previously gpio hog, which held the reset pins and didn’t let the driver to control the reset pins, then I deleted the hog field in the device tree, and after loading the .ko file with the insmod, the Jetson reboots.

Hello @ms.alijani

Thank you for getting back to us.

Could you please get the serial console log and send it to us?

This NVIDIA Jetson Orin Nano - In Board - Getting in Board - Serial Console could help get the serial console log. Additionally, please attach the log from dmesg.

hello ms.alijani,

there’s error log regrading to property missing and then kernel panic with NULL pointer dereference.
I assume it’s due to you did not define necessary sensor property. the issue should be on sensor device tree side, during kernel initialization stage, it’s step for camera device registration to setup a video device node to linux kernel. sensor probing only run when you loaded the kernel module.

please compare your sensor device tree with reference driver.
$public_sources/kernel_src/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3767-camera-p3768-imx477-A.dts

Hello Jerry, Hello Eduardo,

The property missing was about the missing exp_time. which was empty in modes in the Device Tree, I corrected this missing item.

After that I ran insmod to load the driver but the Jetson rebooted.
and the only message was in dmesg and serial report was:
nv_os08a20: module verification failed: signature and/or required key missing - tainting kernel

Then, I corrected the GPIO address and add hog to the dts file, then I deleted the reset-gpio from the dts file.
the dmesg after insmod was so:
[ 1830.453839] nv_os08a20: no symbol version for module_layout
[ 1830.454010] nv_os08a20: module verification failed: signature and/or required key missing - tainting kernel
[ 1830.471887] os08a20 9-0036: os08a20_parse_dt: reset-gpios not found
[ 1830.471895] os08a20 9-0036: unable to get platform data
[ 1830.471898] os08a20 9-0036: tegra camera registration failed (-14)
[ 1830.471938] os08a20: probe of 9-0036 failed with error -14
[ 1830.472276] os08a20 10-0036: os08a20_parse_dt: reset-gpios not found
[ 1830.472279] os08a20 10-0036: unable to get platform data
[ 1830.472281] os08a20 10-0036: tegra camera registration failed (-14)
[ 1830.472309] os08a20: probe of 10-0036 failed with error -14

Now if I remove the hog and add the reset-gpio to the dts
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
the jetson after running the insmod reboots.

in the reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
”&tegra_main_gpio” is correct or “&gpio”?

I have another question about device tree compilation.

/home/**/overlay.pp.dts:64.10-475.6: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:65.21-113.7: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:66.21-112.8: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000/nvcsi@15a00000: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:77.30-81.12: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@0/endpoint@0: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:85.31-87.12: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@1/endpoint@1: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:98.30-102.12: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000/nvcsi@15a00000/channel@1/ports/port@0/endpoint@2: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:106.31-108.12: Warning (unit_address_vs_reg): /fragment@0/overlay/bus@0/host1x@13e00000/nvcsi@15a00000/channel@1/ports/port@1/endpoint@3: node has a unit name, but no reg or ranges property
/home/**/overlay.pp.dts:283.14-294.10: Warning (graph_child_address): /fragment@0/overlay/bus@0/cam_i2cmux/i2c@0/os08a20_a@36/ports: graph node has single child node ‘port@0’, #address-cells/#size-cells are not necessary
/home/**/overlay.pp.dts:459.14-471.10: Warning (graph_child_address): /fragment@0/overlay/bus@0/cam_i2cmux/i2c@1/os08a20_c@36/ports: graph node has single child node ‘port@0’, #address-cells/#size-cells are not necessary

I got these warnings. Do you see anything critical in these fields?

hello ms.alijani,

it should not harmful, you may try to configure CONFIG_MODULE_SIG as disabled to get rid of the message during modprobe/insmod.

it should be the root cause.

is it a customize carrier board? you may double check pinmux spreadsheets to review your pin settings.
FYI, it’s by default to use TEGRA234_MAIN_GPIO(H, 6) as CAM0_PWDN.
you may see-also reference driver, such as.. ./tegra234-p3767-camera-p3768-imx219-A.dts.
you should use &gpio to define a GPIO pin in the sensor device tree.
for instance, reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;

Hi Jerry,

Thanks for your response.

I continoued to use &gpio, otherwise it doesn’t boot. But the problem is also by using the &gpio the Jetson reboots after insmod.

In this link Enable PSS on Jetson-GPIO Pin Header - #11 by KevinFFF your colleage suggested to use &tegra_main_gpio, that’s why I used this, and I will not use it anymore.

in the pinmux spreadsheets is so:
image

from this pin number from the spreadsheet, the cam0_pwdn and cam1_pwrdn must be:
define CAM0_PWDN TEGRA234_MAIN_GPIO(S, 7)
define CAM1_PWDN TEGRA234_MAIN_GPIO(T, 0)
correct?

I compiled the dts with new pin number from spread sheet,
I got an error:
Error: /home/**/overlay.pp.dts:127.31-32 syntax error
FATAL ERROR: Unable to parse input tree

the dts is so:
122 - 146:

				channel@1 {
					reg = <1>;

					ports {
						#address-cells = <1>;
line 127 is:			#size-cells = <0>;

						port@0 {
							reg = <0>;

							csi1_in: endpoint@2 {
								port-index = <2>;
								bus-width = <2>;
								remote-endpoint = <&os08a20_c_out>;
							};
						};

						port@1 {
							reg = <1>;
							csi1_out: endpoint@3 {
								remote-endpoint = <&vi1_in>;
							};
						};
					};
				};

line 127 is: #size-cells = <0>;

is the #address-cells = <1>; and #size-cells = <0>; correct?
I used them from the imx477 dts file without any change.

For Jetpack 5.x, please use &tegra_main_gpio
For Jetpack 6.x, please use &gpio instead.
FYI.

It seems your device tree can not recognize the TEGRA234_MAIN_GPIO macro so that you got this error.

Hi Kevin and thanks for your clarification.

Sorry I used the wrong spreadsheet, based on the Orin Nano Spreadsheet the pin numbers are correct.
And when I used hog and make them high they changed to 3.3 V.

I use waveshare carrierBoard for the ORin Nano.

Hi Jerry,

I checked the spreadsheet, and also I toggled the high and low in the pwrdn pin on cam0 and cam1 woth hog, it is ok.
I expected 1.8 volts, but it is 3.3 V.
But the Jetson still reboots after insmod.
The main problem is this rebooting.
Can anyone help me with this matter more specifically?
What do you suggest doing to find the problem?

hello ms.alijani,

please setup serial console to gather the logs for investigation.

Hi,

Please check the txt file.
putty30102025_16_35.log (235.8 KB)

hello ms.alijani,

there’s error logs no symbol version for module_layout, which indicates a kernel module version mismatch. this happens when a kernel module (.ko file) is built against a different kernel version or configuration than the one currently running on the system.
please double check you’re based-on the same release version for development.

Hi Jerry,

I rebuilt the kernel and successfully generated both conftest.h and Module.symvers. However, I believe the reset issue is unrelated to those files.

I wrote a lightweight skeleton driver — the probe function is essentially identical to what imx477.c does. To verify if the program counter reaches the probe, I added this line at the beginning:

pr_alert(“[os08a20] %s:%d: PROBE_BEGIN addr=0x%02x\n”, func, LINE, client->addr);

However, I always get the following message in the serial log after running insmod:
[ 564.779082] nv_os08a20: module verification failed: signature and/or required key missing - tainting kernel

serialLogAfterloglineInProb.txt (100.0 KB)
The serial link log is attached.

Could you please let me know where exactly I should check before the probe function?

I also deleted all existing drivers and .ko files related to IMX477. Then I regenerated the .dtbo and .ko files from the default.dts and .c sources. After running insmod to load the module, the first issue was related to the hog field in the device tree. I removed the hog entry from the IMX477-A .dts file, and after that I got the following errors:
[ 473.512352] imx477 9-001a: imx477_power_get: unable to request reset_gpio (-16)
[ 473.512363] imx477 9-001a: unable to power get
[ 473.512365] imx477 9-001a: tegra camera driver registration failed
[ 473.512406] imx477: probe of 9-001a failed with error -14

imx477SingleALog.txt (61.9 KB)
I really need to find out what I’m doing wrong.
I also didn’t get the “no symbol version for module_layout” error this time.
Please take a look at the logs and help me get at least a working version of the driver that I can debug and see a proper response from the Jetson.