Which system do you use? Android, Ubuntu, OOWOW or others?
Ubuntu
Which version of system do you use? Khadas official images, self built images, or others?
Khadas official images
Please describe your issue below:
TL;DR: I am trying to stream a video from a IMX415 camera on a custom PCB board but I am having issues linking the CSI-2, and DPHY entities. I encounter the two errors Entity type for entity XXX was not initialized!
and No link between dphy and sensor.
Full story: I am using the official Khadas image from fenix which includes the device tree source of the IMX415 camera found in rk3588s-khadas-edge2-camera.dtsi
. I can confirm that the IMX415 dts is properly parsed using dtc -I fs -O dts /sys/firmware/devicetree/base
on the Khadas Edge 2.
I have made a custom PCB to interface between the IMX415 and the Khadas Edge 2. The 4-lane CSI2 connector of the custom PCB is connected to one of the 4-lanes CSI-2 lanes on the Khadas Edge 2. I can read and write to the IMX415 sensor using the I2C link and recognize the IMX415 chip ID through the imx415.c driver probe function. I am also able to see the clock and data signals on the CSI lanes at the right voltage and timings, which seems to prove that the hardware is working on the custom PCB side, and thus (probably) not the source of my current problem.
I can remove and insert the module in the kernel at will using modprobe
. Using lsmod
tells me that the driver is recognized, and the probe function does not assert any errors. I can see rkisp-statistics, rkcif-mipi-lvds, rkisp0, and rkisp_mainpath using v4l2-ctl --list-devices
.
khadas@Khadas:~$ v4l2-ctl --list-devices
rkisp-statistics (platform: rkisp):
/dev/video31
/dev/video32
rkcif-mipi-lvds (platform:rkcif):
/dev/media0
/dev/media1
/dev/media2
rkisp0 (platform:rkisp-unite):
/dev/media3
rkisp_mainpath (platform:rkisp0-vir0):
/dev/video24
/dev/video25
/dev/video26
/dev/video27
/dev/video28
/dev/video29
/dev/video30
The first device media0 seems to hold the information about the mipi-csi2, cif, and csi2-dphy:
khadas@Khadas:~$ media-ctl -d /dev/media0 -p
Media controller API version 5.10.66
Media device information
------------------------
driver rkcif
model rkcif-mipi-lvds
serial
bus info
hw revision 0x0
driver version 5.10.66
Device topology
- entity 1: stream_cif_mipi_id0 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "rockchip-mipi-csi2":1 [ENABLED]
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 5: stream_cif_mipi_id1 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 [ENABLED]
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 9: stream_cif_mipi_id2 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video2
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 [ENABLED]
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 13: stream_cif_mipi_id3 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video3
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 [ENABLED]
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 17: rkcif_scale_ch0 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video4
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 [ENABLED]
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 21: rkcif_scale_ch1 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video5
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 [ENABLED]
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 []
- entity 25: rkcif_scale_ch2 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video6
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 [ENABLED]
<- "rockchip-mipi-csi2":8 []
- entity 29: rkcif_scale_ch3 (1 pad, 8 links)
type Node subtype V4L flags 0
device node name /dev/video7
pad0: Sink
<- "rockchip-mipi-csi2":1 []
<- "rockchip-mipi-csi2":2 []
<- "rockchip-mipi-csi2":3 []
<- "rockchip-mipi-csi2":4 []
<- "rockchip-mipi-csi2":5 []
<- "rockchip-mipi-csi2":6 []
<- "rockchip-mipi-csi2":7 []
<- "rockchip-mipi-csi2":8 [ENABLED]
- entity 33: rockchip-mipi-csi2 (9 pads, 65 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
<- "rockchip-csi2-dphy0":1 [ENABLED]
pad1: Source
-> "stream_cif_mipi_id0":0 [ENABLED]
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad2: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 [ENABLED]
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad3: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 [ENABLED]
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad4: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 [ENABLED]
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad5: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 [ENABLED]
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad6: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 [ENABLED]
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 []
pad7: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 [ENABLED]
-> "rkcif_scale_ch3":0 []
pad8: Source
-> "stream_cif_mipi_id0":0 []
-> "stream_cif_mipi_id1":0 []
-> "stream_cif_mipi_id2":0 []
-> "stream_cif_mipi_id3":0 []
-> "rkcif_scale_ch0":0 []
-> "rkcif_scale_ch1":0 []
-> "rkcif_scale_ch2":0 []
-> "rkcif_scale_ch3":0 [ENABLED]
- entity 43: rockchip-csi2-dphy0 (2 pads, 1 link)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
pad1: Source
-> "rockchip-mipi-csi2":0 [ENABLED]
It is possible to see that entity 43 that represents DPHY0 is correctly linked to the MIPI-CSI2, but has no link to the sensor. It’s sink pad0 is NULL.
media3 seems to hold information about the rkisp block, but again the link seems to be missing between the isp-subdev and the IMX415 → DPHY → CSI-2 link.
khadas@Khadas:~$ media-ctl -d /dev/media3 -p
Media controller API version 5.10.66
Media device information
------------------------
driver rkisp-unite
model rkisp0
serial
bus info
hw revision 0x0
driver version 5.10.66
Device topology
- entity 1: rkisp-isp-subdev (4 pads, 9 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev5
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none
crop.bounds:(0,0)/800x600
crop:(0,0)/800x600]
<- "rkisp_rawrd0_m":0 []
<- "rkisp_rawrd2_s":0 []
<- "rkisp_rawrd1_l":0 []
pad1: Sink
<- "rkisp-input-params":0 [ENABLED]
pad2: Source
[fmt:YUYV8_2X8/800x600 field:none colorspace:smpte170m quantization:full-range
crop.bounds:(0,0)/800x600
crop:(0,0)/800x600]
-> "rkisp_mainpath":0 [ENABLED]
-> "rkisp_selfpath":0 [ENABLED]
-> "rkisp_fbcpath":0 [ENABLED]
-> "rkisp_iqtool":0 [ENABLED]
pad3: Source
-> "rkisp-statistics":0 [ENABLED]
- entity 6: rkisp_mainpath (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video24
pad0: Sink
<- "rkisp-isp-subdev":2 [ENABLED]
- entity 12: rkisp_selfpath (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video25
pad0: Sink
<- "rkisp-isp-subdev":2 [ENABLED]
- entity 18: rkisp_fbcpath (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video26
pad0: Sink
<- "rkisp-isp-subdev":2 [ENABLED]
- entity 24: rkisp_iqtool (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video27
pad0: Sink
<- "rkisp-isp-subdev":2 [ENABLED]
- entity 30: rkisp_rawrd0_m (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video28
pad0: Source
-> "rkisp-isp-subdev":0 []
- entity 36: rkisp_rawrd2_s (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video29
pad0: Source
-> "rkisp-isp-subdev":0 []
- entity 42: rkisp_rawrd1_l (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video30
pad0: Source
-> "rkisp-isp-subdev":0 []
- entity 48: rkisp-statistics (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video31
pad0: Sink
<- "rkisp-isp-subdev":3 [ENABLED]
- entity 54: rkisp-input-params (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video32
pad0: Source
-> "rkisp-isp-subdev":1 [ENABLED]
Do you know what could be done to resolve this issue and properly link the IMX415 to the Khadas Edge 2?
References:
Post a console log of your issue below:
[ 6.822267] rkcif rkcif-mipi-lvds: Adding to iommu group 15
[ 6.824939] rkcif rkcif-mipi-lvds: rkcif driver version: v00.01.0a
[ 6.827652] rkcif rkcif-mipi-lvds: attach to cif hw node
[ 6.830272] rkcif rkcif-mipi-lvds: rkcif wait line 0
[ 6.864317] rkcif rkcif-mipi-lvds1: Adding to iommu group 15
[ 6.866953] rkcif rkcif-mipi-lvds1: rkcif driver version: v00.01.0a
[ 6.869629] rkcif rkcif-mipi-lvds1: attach to cif hw node
[ 6.872230] rkcif rkcif-mipi-lvds1: rkcif wait line 0
[ 6.912251] rkcif rkcif-mipi-lvds2: Adding to iommu group 15
[ 6.914878] rkcif rkcif-mipi-lvds2: rkcif driver version: v00.01.0a
[ 6.917503] rkcif rkcif-mipi-lvds2: attach to cif hw node
[ 6.920049] rkcif rkcif-mipi-lvds2: rkcif wait line 0
[ 6.954723] rkcif rkcif-mipi-lvds: Entity type for entity rockchip-mipi-csi2 was not initialized!
[ 6.982269] rockchip-mipi-csi2: Async registered subdev
[ 6.984863] rockchip-mipi-csi2: probe success, v4l2_dev:rkcif-mipi-lvds!
[ 6.987599] rkcif rkcif-mipi-lvds1: Entity type for entity rockchip-mipi-csi2 was not initialized!
[ 6.990204] rockchip-mipi-csi2: Async registered subdev
[ 6.992783] rockchip-mipi-csi2: probe success, v4l2_dev:rkcif-mipi-lvds1!
[ 6.995508] rkcif rkcif-mipi-lvds2: Entity type for entity rockchip-mipi-csi2 was not initialized!
[ 6.998119] rockchip-mipi-csi2: Async registered subdev
[ 7.000731] rockchip-mipi-csi2: probe success, v4l2_dev:rkcif-mipi-lvds2!
[ 8.953887] rkcif rkcif-mipi-lvds: clear unready subdev num: 1
[ 8.988858] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 8.992940] rkcif-mipi-lvds: Async subdev notifier completed
[ 9.000614] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 9.002927] rkcif-mipi-lvds: There is not terminal subdev, not synchronized with ISP
[ 9.010435] rkcif rkcif-mipi-lvds1: clear unready subdev num: 1
[ 9.017596] rkcif-mipi-lvds1: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 9.025931] rkcif-mipi-lvds1: Async subdev notifier completed
[ 9.030660] rkcif-mipi-lvds1: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 9.033387] rkcif-mipi-lvds1: There is not terminal subdev, not synchronized with ISP
[ 9.036037] rkcif rkcif-mipi-lvds2: clear unready subdev num: 1
[ 9.038516] rockchip-mipi-csi2: No link between dphy and sensor
[ 9.041506] rockchip-mipi-csi2: No link between dphy and sensor
[ 9.044401] rkcif-mipi-lvds2: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 9.047551] rkcif-mipi-lvds2: Async subdev notifier completed
[ 9.054995] rockchip-mipi-csi2: No link between dphy and sensor
[ 9.057114] rkcif-mipi-lvds2: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 9.059561] rkcif-mipi-lvds2: There is not terminal subdev, not synchronized with ISP
An when I try to fetch the /dev/videoX using v4l2-ctl or media-ctl, I get logs similar to this one:
[ 669.883635] rockchip-csi2-dphy0: No link between dphy and sensor
[ 669.886837] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 669.890324] stream_cif_mipi_id0: update sensor info failed -19