Orin devkit: I2C not working, camera not probing

Hi,

This is a follow-up of Gstreamer doesn't detect second camera - #4 by alain.gautherot.
I have an IMX492 camera working on Xavier NX + R35.4.1 and need to port it to the Orin devkit (R35.4.1).
I’m using the following LI-JXAV-MIPI-ADPT-4CAM adapter board from Leopard:

I derived the DTS and overlay files from IMX477, flashed orin, but camera doesn’t get detected, not even probed.
The probe I see is from IMX274 which is the default.
I can’t run jetson-IO to try and select the dual-IMX492, it immediately within 0.5s after displaying the TUI windows.

Looks like I2C transfers to cameras are not working:

nvidia@sdj-orindk-02:~$ i2cdetect -l
i2c-3   i2c             3190000.i2c                             I2C adapter
i2c-30  i2c             i2c-2-mux (chan_id 0)                   I2C adapter
i2c-1   i2c             c240000.i2c                             I2C adapter
i2c-8   i2c             31e0000.i2c                             I2C adapter
i2c-6   i2c             31c0000.i2c                             I2C adapter
i2c-33  i2c             i2c-2-mux (chan_id 3)                   I2C adapter
i2c-4   i2c             Tegra BPMP I2C adapter                  I2C adapter
i2c-31  i2c             i2c-2-mux (chan_id 1)                   I2C adapter
i2c-2   i2c             3180000.i2c                             I2C adapter
i2c-0   i2c             3160000.i2c                             I2C adapter
i2c-9   i2c             NVIDIA SOC i2c adapter 0                I2C adapter
i2c-7   i2c             c250000.i2c                             I2C adapter
i2c-5   i2c             31b0000.i2c                             I2C adapter
i2c-32  i2c             i2c-2-mux (chan_id 2)                   I2C adapter

nvidia@sdj-orindk-02:~$ i2cdetect -y -r 30
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- 54 -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: UU -- -- -- -- -- -- --

nvidia@sdj-orindk-02:~$ i2ctransfer -f -y 30 w2@0x1a 0x30 0x00 r256
Error: Sending messages failed: Remote I/O error

Also, I don’t see the CAM_I2C GPIO on AGX Orin, does it still exist?
Any better reference DTS I could look at besides IMX477?

Thanks,
Alain

@alain.gautherot

What IMX477 code files do you have? Are they for LI-JXAV-MIPI-ADPT-4CAM board?
Below patch files are for Jetson AGX Orin + LI-JXAV-MIPI-ADPT-4CAM + IMX477-MIPI camera. Please refer to these files to build the driver.

Thanks Simon for the drop.

I see CAM1_RST_L is set to (AC, 2) which is CAM_FRSYNC2, is that intentional or should it be (AC, 1)?

#define CAM0_RST_L|TEGRA234_MAIN_GPIO(H, 3)
#define CAM0_PWDN|TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_RST_L|TEGRA234_MAIN_GPIO(AC, 2)    <== should this be (AC, 1)?
#define CAM1_PWDN|TEGRA234_MAIN_GPIO(AC, 0)

I also added these sections.

				pca9570_a@24 {
					compatible = "nxp,pca9570";
					reg = <0x24>;
					channel = "a";
					drive_ic = "DRV8838";
				};

I noted that rail ‘avdd-cam-2v8’ is OFF and wonder if that could be a problem.

root@sdj-orindk-02:/sys/kernel/debug/regulator# cat rail_states | grep avdd
regulator.25 (avdd-cam-2v8): OFF(0) 

Regulator control seems to be implemented in the driver and in the DTS

	i2c@3180000 {
		tca9546@70 {
			i2c@0 {
				imx492_a@1a {
					compatible = "nvidia,imx492";
					/* I2C device address */
					reg = <0x1a>;

					/* V4L2 device node location */
					devnode = "video0";
					...
					avdd-reg = "vana";    # <== here
					iovdd-reg = "vif";    # <==
					dvdd-reg = "vdig";    # <==

Anyway, I2C still doesn’t work. Same output from dmesg:

nvidia@sdj-orindk-02:~$ sudo dmesg | grep imx
[    5.253268] imx492 30-001a: probing v4l2 sensor: pleno/alain/10_r35tri
[    5.475633] imx492 30-001a: tegracam sensor driver:imx492_v2.0.6
[    5.684514] imx492 30-001a: imx492_set_gain: val:1000000, gain:1, again:(1, 0), dgain:(1, 0)
[    5.686956] imx492 30-001a: imx492_write_reg: i2c write failed, 0x300b = 0
[    5.687154] imx492 30-001a: imx492_set_gain: GAIN control error
[    5.687326] imx492 30-001a: Error -121 in control hdl setup
[    5.687484] imx492 30-001a: Failed to init ctrls imx492
[    5.687630] imx492 30-001a: tegra camera subdev registration failed
[    5.687943] imx492: probe of 30-001a failed with error -121

and same output from i2cdetect/i2ctranfer:

nvidia@sdj-orindk-02:~$ sudo i2cdetect -y -r 30
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- 54 -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: UU -- -- -- -- -- -- --                         
nvidia@sdj-orindk-02:~$ sudo i2ctransfer -f -y 30 w2@0x1a 0x30 0x00 r256
Error: Sending messages failed: Remote I/O error

I2C usually is related with power, reset and oscillator. You may need use an oscilloscope to check if above three singals are correct.

just confirmed that issue is that pinout is different between adapter board and camera module.
need custom cables.