IMX274 Device Tree devnode error

I’m trying to get the tegra210-jetson-cv-camera-imx274-a00.dtsi integrated into my Nano device tree. I’ve added additional regulators to satisfy the supplies and have updated the names of the supplies to comply with the latest imx274.c driver. But I am not getting the following error message on Linux boot:

[    3.708540] imx274 30-001a: probing v4l2 sensor.
[    3.709337] imx274 30-001a: tegracam sensor driver:imx274_v2.0.6
[    3.709478] imx274 30-001a: devnode not in DT
[    3.709481] imx274 30-001a: error creating debugfs interface
[    3.709638] imx274: probe of 30-001a failed with error -22

Looking at the code it is looking for the devnode property to be located here:

err = of_property_read_string(client->dev.of_node, "devnode", &devnode);
	if (err) {
		dev_err(&client->dev, "devnode not in DT\n");
		return err;
	}

Below is what I’ve tried for my device tree:

#include "tegra210-camera-imx274-a00.dtsi"

#define CAM0_RST_L	TEGRA_GPIO(S, 4)
#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)

/* camera control gpio definitions */

/ {
	en_vdd_cam_hv_2v8_maza: regulator@11 {
		compatible = "regulator-fixed-sync";
		reg = <11>;
		regulator-name = "en-vdd-cam-hv-2v8_maza";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		regulator-always-on;
	};

	en_vdd_cam_1v2_maza: regulator@12 {
		compatible = "regulator-fixed-sync";
		reg = <12>;
		regulator-name = "en-vdd-cam-1v2_maza";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		regulator-always-on;
	};

	en_vdd_cam_maza: regulator@13 {
		compatible = "regulator-fixed-sync";
		reg = <13>;
		regulator-name = "en-vdd-cam-maza";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};


	host1x {
		i2c@546c0000 {
			tca9546@70 {
				compatible = "nxp,pca9546";
				reg = <0x70>;
				#address-cells = <1>;
				#size-cells = <0>;
				skip_mux_detect = "yes";
				vcc-supply = <&en_vdd_cam_maza>;
				vcc_lp = "vcc";
				force_bus_start = <CAMERA_I2C_MUX_BUS(0)>;

				i2c@0 {
					reg = <0>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					pca9570_a@24 {
						compatible = "nvidia,pca9570";
						reg = <0x24>;
						channel = "a";
						drive_ic = "DRV8838";
					};

					imx274_a@1a {
						/* Define any required hw resources needed by driver */
						/* ie. clocks, io pins, power sources */
						clocks = <&tegra_car TEGRA210_CLK_CLK_OUT_3>;
						clock-names = "clk_out_3";
						clock-frequency = <24000000>;
						mclk = "clk_out_3";
						reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
						vana-supply = <&en_vdd_cam_hv_2v8_maza>;
						vif-supply = <&en_vdd_cam_maza>;
						vdig-supply = <&en_vdd_cam_1v2_maza>;
						devnode = "video2";
					};
				};
			};
		};
	};
};

I suspect the client->dev.of_node part needs to be defined, but I’m not sure where to define it.

hello Shadowmind,

please check below for the details of kernel message reporting imx274_v2.0.6

<i>$l4t-r32.1/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/tegracam_core.c</i>

/* use semantic versioning convention */
#define TEGRACAM_MAJOR_VERSION 2
#define TEGRACAM_MINOR_VERSION 0
#define TEGRACAM_PATCH_VERSION 6

you should check Device Registration chapter for the process of camera device registration.
please also note that, the badge property represent an unique name that identifies camera module. you must update the badge info if have your own customization camera modules.
thanks

I’ve made additional progress. On power up I see the following in the kernel output:

[    3.469623] imx274 6-001a: probing v4l2 sensor.
[    3.470495] imx274 6-001a: tegracam sensor driver:imx274_v2.0.6
[    3.470642] imx274 6-001a: Detected IMX274 sensor

Then a little while later I see:

[    4.582112] vi 54080000.vi: vi_probe: ++
[    4.586587] vi 54080000.vi: initialized
[    4.589177] vi 54080000.vi: subdev nvcsi--1 bound
[    4.589193] vi 54080000.vi: subdev imx274 6-001a bound

I have a /dev/video0 node. When I run v4l2-compliance -d /dev/video0 I get the following:

v4l2-compliance SHA   : not available

Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output, imx274 6-001a
	Bus info      : platform:54080000.vi:0
	Driver version: 4.9.140
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK
	test for unlimited opens: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 18

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		fail: v4l2-test-formats.cpp(1184): ret && node->has_frmintervals
		test VIDIOC_G/S_PARM: FAIL
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		test VIDIOC_TRY_FMT: OK
		warn: v4l2-test-formats.cpp(887): Could not set fmt2
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		test Scaling: OK (Not Supported)

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:


Total: 43, Succeeded: 42, Failed: 1, Warnings: 1

The failure is in
fail: v4l2-test-formats.cpp(1184): ret && node->has_frmintervals

I can’t stream images to GStreamer and the Linux kernel output shows the following error messages:

[ 1007.597939] vi 54080000.vi: =================  START STATUS  =================
[ 1007.597951] vi 54080000.vi: ==================  END STATUS  ==================
[ 1007.609907] imx274 6-001a: imx274_set_exposure_shr_dol_short: error, invalid dol mode
[ 1007.617920] imx274 6-001a: imx274_set_exposure_shr_dol_short: EXPOSURE short control is not set
[ 1007.626875] imx274 6-001a: ctrl Exposure Short range update failed
[ 1007.633168] imx274 6-001a: Error updating control ranges -22

I’m attaching the I2C log from init and v4l2_complaince testing. I’m using the IMX274.c file from the Nvidia source tree and a Leopard Imaging IMX274_FMC board (it is what I had in the lab).

Any ideas on how to proceed?

DMESG:
https://pastebin.com/vfaFDQJD

I2C log from power up:
https://pastebin.com/gtM7s982

I2C log from compliance test:
https://pastebin.com/vbzQtuJh

Hi Shadowmind,

The IMX274-FMC board is for Xilinx platform instead of Jetson Nano kit. We have below IMX274 driver patches for our Nano carrier board (LI-NANO-CB) + LI-IMX274-MIPI camera. You can take it as a reference.

IMX274 Nano patches: https://www.dropbox.com/sh/gyoiflh9oiguwyc/AAC-YI_DPn3qrnd7KCqDI6s9a?dl=0

LI-NANO-CB: https://leopardimaging.com/product/li-nano-cb/
LI-IMX274-MIPI: https://leopardimaging.com/product/li-imx274-mipi-cs/

Are there any update patches for the IMX274 NANO and the LI-NANO-CB board?

Hi Shadowmind,

Nvidia just released a production version Nano SOM which requires new carrier board design. We are working on the new Nano carrier board and will release in October. This carrier board can support 4 IMX274 cameras.

I purchased a LI-NANO-CB board to use with the Nano SOM Dev kits. Are you saying I can’t use this board?

Hi Shadowmind,

The current LI-NANO-CB board works with the Nano SOM from the Nano Dev kit. Since Nvidia’s new production version Nano module use new design, we have to update our carrier board based on this new design.
The current LI-NANO-CB only have one I-PEX connector to support IMX274 camera. You can download the driver from comments #4.