This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P: 4 camera support with max96724

Part Number: AM62P

Tool/software:

Platform: AM62P
sensor: four ISX031 (1920x1080 @25fps)nv12
SERDES:MAX92717+MAX96724

1)
As log log_ioctl.txt show:

when app call: enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
ret = ioctl(fd, VIDIOC_STREAMON, &type);

error occur in v4l2-subdev.c:
v4l2_subdev_enable_streams->
if (found_streams != streams_mask) {
dev_dbg(dev, "streams 0x%llx not found on %s:%u\n",
streams_mask & ~found_streams, sd->entity.name, pad);
ret = -EINVAL;
goto done;
}
// found_streams =0
// streams_mask =1

As the code show, I need to add stream_configs in my sensor dirver?


2) As log log_media-ctl.txt show:
only one route found in entity 9: cdns_csi2rx.30101000.csi-bridge.
(expect 4 route )
how to add route in app or kernel?

log_booting.txt

[    6.614865] <max96724> 1 max96724_probe
[    6.623494] remoteproc remoteproc1: attaching to 78000000.r5f
[    6.631966] <max96724>   1.1 devm_regmap_init_i2c
[    6.636475] platform 78000000.r5f: R5F core initialized in IPC-only mode
[    6.650801] rproc-virtio rproc-virtio.2.auto: assigned reserved memory node r5f-dma-memory@9c800000
[    6.660359] <max96724>   1.2 max96724_reset
[    6.666174] virtio_rpmsg_bus virtio0: rpmsg host is online
[    6.666746] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd
[    6.671834] rproc-virtio rproc-virtio.2.auto: registered virtio0 (type 7)
[    6.679450] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe
[    6.689472] remoteproc remoteproc1: remote processor 78000000.r5f is now attached
[  OK  ] Reached target Socket Units.
[  OK  ] Reached target Hardware activated USB gadget.
[    6.756595] <max96724>   1.3 max96724_parse_dt
[    6.771123] <j721e-csi2rx> 0 ti_csi2rx_probe begin
[    6.771220] <max96724> max96724_parse_dt->fwnode_graph_get_endpoint_by_id
[    6.778037] <v4l2_device> v4l2_device_register vdec
[    6.790668] <j721e-csi2rx> 1 ti_csi2rx_v4l2_init
[    6.791528] <max96724>err: vep.nr_of_link_frequencies(0) != 1
[    6.796230] <j721e-csi2rx>   1.1 media_device_init
[    6.796244] <j721e-csi2rx>   1.2 v4l2_device_register
[    6.796246] <v4l2_device> v4l2_device_register j721e-csi2rx
[    6.796252] <j721e-csi2rx>   1.3 media_device_register
[    6.806988] <max96724>err: force set link_freq = 800000000
[    6.806988]
[    6.808990] <j721e-csi2rx>   1.4 v4l2_subdev_init
[    6.819478] <max96724>   1.4 max96724_mipi_configure
[    6.821268] <v4l2_subdev> v4l2_subdev_init
[    6.851882] <j721e-csi2rx>   1.5 media_entity_pads_init
[    6.858051] <mc-entity> media_entity_pads_init 30102000.ticsi2rx
[    6.865054] <j721e-csi2rx>   1.6 v4l2_subdev_init_finalize
[    6.871437] <j721e-csi2rx> v4l2_subdev_routing_validate V4L2_SUBDEV_ROUTING_ONLY_1_TO_1
[    6.880342] <j721e-csi2rx> v4l2_subdev_set_routing_with_fmt MEDIA_BUS_FMT_UYYVYY8_0_5X24
[    6.889391] <v4l2_subdev> v4l2_subdev_set_routing 30102000.ticsi2rx
[    6.896670] <v4l2_subdev> v4l2_subdev_init_stream_configs
[    6.903041] <j721e-csi2rx>   1.7 v4l2_device_register_subdev
[    6.909570] <v4l2_device> v4l2_device_register_subdev sd->entity.name:30102000.ticsi2rx
[    6.918472] <mc-device> media_device_register_entity 1 - 30102000.ticsi2rx
[    6.926254] <mc-entity> media_entity_pads_init (null)
[    6.933012] <mc-entity> media_entity_pads_init (null)
[    6.939630] <mc-entity> media_entity_pads_init (null)
[    6.946278] <mc-entity> media_entity_pads_init (null)
[    6.952967] <mc-entity> media_entity_pads_init (null)
[    6.959529] <mc-entity> media_entity_pads_init (null)
[    6.966358] max96724 1-0027: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
[    6.976420] platform 30101000.csi-bridge: Fixed dependency cycle(s) with /bus@f0000/i2c@20010000/sensor@27
[    7.017207] vdec 30210000.video-codec: Added wave5 driver with caps: 'ENCODE' 'DECODE'
[    7.025479] vdec 30210000.video-codec: Product Code:      0x521c
[    7.031667] vdec 30210000.video-codec: Firmware Revision: 320127
         Starting Virtual Console Setup...
[    7.056697] <cdns-csi2rx> csi2rx_probe
[    7.062175] <cdns-csi2rx>   csi2rx_probe->v4l2_subdev_init 30101000.csi-bridge
[    7.070533] <v4l2_subdev> v4l2_subdev_init
[    7.078922] <mc-entity> media_entity_pads_init cdns_csi2rx.30101000.csi-bridge
[    7.087084] <v4l2_subdev> v4l2_subdev_set_routing cdns_csi2rx.30101000.csi-bridge
[    7.095604] <v4l2_subdev> v4l2_subdev_init_stream_configs
[    7.102061] <v4l2_device> v4l2_device_register_subdev sd->entity.name:cdns_csi2rx.30101000.csi-bridge
[    7.112206] <mc-device> media_device_register_entity 2 - cdns_csi2rx.30101000.csi-bridge
[    7.121231] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY

log_ioctl.txt

root@am62pxx-evm:/test# ./v4l2_test
<v4l2_test> Oct 29 2024 06:01:44

Select Test Type:
1. media_test_query_cap
2. media_test_set_format
3. media_test_entity
4. media_test_pads
5. media_test_link
6. media_test_get_image
6
<medai_debug> media_test_get_image [   25.710995] <j721e-csi2rx> ti_csi2rx_queue_setup

[   25.722197] videobuf2_common: [cap-00000000f115a713] __setup_offsets: buffer 0, plane 0 offset 0x00000000
[   25.735928] videobuf2_common: [cap-00000000f115a713] __setup_offsets: buffer 1, plane 0 offset 0x001fb000
[   25.751077] videobuf2_common: [cap-00000000f115a713] __setup_offsets: buffer 2, plane 0 offset 0x003f6000
[   25.762355] videobuf2_common: [cap-00000000f115a713] __setup_offsets: buffer 3, plane 0 offset 0x005f1000
[   25.771932] videobuf2_common: [cap-00000000f115a713] __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each
[   25.781920] videobuf2_common: [cap-00000000f115a713] vb2_mmap: buffer 0, plane 0 successfully mapped
[   25.796520] <j721e-csi2rx> ti_csi2rx_buffer_prepare
  ioctl VIDIOC_QBUF 0
[   25.807155] videobuf2_common: [cap-00000000f115a713] vb2_core_qbuf: qbuf of buffer 0 succeeded
  ioctl VIDIOC_QUERYBUF 1 [   25.817877] videobuf2_common: [cap-00000000f115a713] vb2_mmap: buffer 1, plane 0 successfully mapped

[   25.829241] <j721e-csi2rx> ti_csi2rx_buffer_prepare
  ioctl VIDIOC_QBUF 1
[   25.835124] videobuf2_common: [cap-00000000f115a713] vb2_core_qbuf: qbuf of buffer 1 succeeded
  ioctl VIDIOC_QUERYBUF 2 [   25.845852] videobuf2_common: [cap-00000000f115a713] vb2_mmap: buffer 2, plane 0 successfully mapped

[   25.857206] <j721e-csi2rx> ti_csi2rx_buffer_prepare
  ioctl VIDIOC_QBUF 2
[   25.863099] videobuf2_common: [cap-00000000f115a713] vb2_core_qbuf: qbuf of buffer 2 succeeded
  ioctl VIDIOC_QUERYBUF 3 [   25.873816] videobuf2_common: [cap-00000000f115a713] vb2_mmap: buffer 3, plane 0 successfully mapped

[   25.885180] <j721e-csi2rx> ti_csi2rx_buffer_prepare
  ioctl VIDIOC_QBUF 3
[   25.891072] videobuf2_common: [cap-00000000f115a713] vb2_core_qbuf: qbuf of buffer 3 succeeded
[   25.901773] <vb2-v4l2> 2 vb2_streamon

<medai_debug> ioctl VIDIOC_STREAMON
[   25.910356] <vb2-core> 2 vb2_core_streamon begin
[   25.920067] <vb2-core>   2.1 vb2_core_streamon->prepare_streaming
[   25.927017] <vb2-core>   2.2 vb2_core_streamon->vb2_start_streaming
[   25.934146] <vb2-core>   2.2.1 vb2_start_streaming->start_streaming
[   25.941271] <j721e-csi2rx>     ti_csi2rx_start_streaming
[   25.950787] <mc-entity> media_pipeline_start begin
[   25.956480] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 0'
[   25.967596] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   25.977848] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:1 pad'30102000.ticsi2rx'
[   25.988096] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx'
[   25.998342] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.008645] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:1 pad'cdns_csi2rx.30101000.csi-bridge'
[   26.020115] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'cdns_csi2rx.30101000.csi-bridge'
[   26.031579] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.041835] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'max96724 1-0027'
[   26.051908] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:2 pad'30102000.ticsi2rx'
[   26.062154] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 1'
[   26.073272] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.083519] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:3 pad'30102000.ticsi2rx'
[   26.093763] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 2'
[   26.104874] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.115117] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:4 pad'30102000.ticsi2rx'
[   26.125363] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 3'
[   26.136479] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.146729] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:5 pad'30102000.ticsi2rx'
[   26.156975] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 4'
[   26.168087] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.178331] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:6 pad'30102000.ticsi2rx'
[   26.188575] <mc-entity>   2.1)media_pipeline_start->list_for_each_entry index:0 pad'30102000.ticsi2rx context 5'
[   26.199693] <mc-entity>     2.1.1) media_pipeline_start->for_each_media_entity_data_link->link_validate
[   26.209939] <mc-entity> media_pipeline_start end
[   26.215419] <max96724> max96724_get_frame_desc stream:0 dt:0
[   26.221935] <max96724> max96724_get_frame_desc end
[   26.227627] <j721e-csi2rx>     ti_csi2rx_start_streaming->v4l2_subdev_enable_streams
[   26.236228] <v4l2_subdev> v4l2_subdev_enable_streams pad:1 30102000.ticsi2rx  streams_mask:0x1
[   26.245782] <v4l2_subdev> found_streams(0x1)  streams_mask(0x1)
[   26.252655] <j721e-csi2rx> ti_csi2rx_sd_enable_streams 30102000.ticsi2rx pad:1
[   26.260767] <j721e-csi2rx>   ti_csi2rx_sd_enable_streams->v4l2_subdev_enable_streams remote_pad->index:1
[   26.271108] <v4l2_subdev> v4l2_subdev_enable_streams pad:1 cdns_csi2rx.30101000.csi-bridge  streams_mask:0x1
[   26.281877] <v4l2_subdev> found_streams(0x1)  streams_mask(0x1)
[   26.288743] <cdns-csi2rx> 1) csi2rx_enable_streams cdns_csi2rx.30101000.csi-bridge pad:1
[   26.297697] <cdns-csi2rx> 1.1) csi2rx_start
[   26.302823] <cdns-csi2rx>   1.1.1) csi2rx_start->csi2rx_configure_ext_dphy
[   26.310568] <cdns-csi2rx>   csi2rx_configure_ext_dphy->v4l2_get_link_freq link_freq:800000000
[   26.319948] <cdns-csi2rx>    1.1.1.1)csi2rx_configure_ext_dphy->phy_power_on
[   26.327860] <cdns-csi2rx>    1.1.1.2)csi2rx_configure_ext_dphy->phy_configure
[   26.336335] <cdns-csi2rx> 1.2) v4l2_subdev_enable_streams
[   26.342598] <v4l2_subdev> v4l2_subdev_enable_streams pad:0 max96724 1-0027  streams_mask:0x1
[   26.351980] <v4l2_subdev> found_streams(0x0)  streams_mask(0x1)
[   26.358848] <v4l2_subdev>err found_streams(0x0) != streams_mask(0x1)
[   26.366146] <cdns-csi2rx>err v4l2_subdev_enable_streams return -22
[   26.373187] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
[   26.380749] <cdns-csi2rx> csi2rx_stop
[   26.395328] cdns-csi2rx 30101000.csi-bridge: Failed to stop streaming on pad0
[   26.412479] cdns-csi2rx 30101000.csi-bridge: Failed to stop streaming on pad1
[   26.429674] cdns-csi2rx 30101000.csi-bridge: Failed to stop streaming on pad2
[   26.446826] cdns-csi2rx 30101000.csi-bridge: Failed to stop streaming on pad3
[   26.454064] <j721e-csi2rx>err: ti_csi2rx_start_streaming->ti_csi2rx_dma_submit_pending return -22
[   26.516635] <mc-entity> media_pipeline_stop
[   26.521732] videobuf2_common: [cap-00000000f115a713] vb2_start_streaming: driver refused to start streaming
[   26.531486] <vb2-core>   2.2 vb2_core_streamon begin->vb2_start_streaming return -22
VIDIOC_STREAMON IS ERROR! LINE:190
<medai_debug>err start_capture failed

log_media-ctl.txt
root@am62pxx-evm:/test# media-ctl -p -d /dev/media0
Media controller API version 6.6.32

Media device information
------------------------
driver          j721e-csi2rx
model           TI-CSI2RX
serial
bus info        platform:30102000.ticsi2rx
hw revision     0x1
driver version  6.6.32

Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt:UYYVYY8_0_5X24/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYYVYY8_0_5X24/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
        pad2: Source
                -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
        pad3: Source
                -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
        pad4: Source
                -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
        pad5: Source
                -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
        pad6: Source
                -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]

- entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt:UYYVYY8_0_5X24/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                <- "max96724 1-0027":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYYVYY8_0_5X24/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
        pad2: Source
        pad3: Source
        pad4: Source

- entity 15: max96724 1-0027 (1 pad, 1 link, 0 routes)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
        pad0: Source
                [stream:0 fmt:UYYVYY8_0_5X24/1920x1080 field:none colorspace:srgb]
                -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

- entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video2
        pad0: Sink
                <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]

- entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video3
        pad0: Sink
                <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]

- entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video4
        pad0: Sink
                <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]

- entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video5
        pad0: Sink
                <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]

- entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video6
        pad0: Sink
                <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]

- entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video7
        pad0: Sink
                <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]

  • Hello,

    I'm currently out of office and not able to analyze your case. Please take a look at the following for reference:

    1. TI's DS90UB960 deserializer driver: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/media/i2c/ds90ub960.c?h=ti-linux-6.6.y

    2. IMX219 driver that supports connecting multiple IMX219 cameras through DS90UB953 serializer and DS90UB960 deserializer: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/media/i2c/imx219.c?h=ti-linux-6.6.y

    3. A script that sets up the routes and formats for connecting 4x IMX219 cameras to AM62A through DS90UB953 and DS90UB960: https://github.com/TexasInstruments/edgeai-gst-apps/blob/main/scripts/setup_cameras_v3link.sh#L335

    Regards,

    Jianzhong

  • root@am62pxx-evm:/test# media-ctl -p -d /dev/media0
    Media controller API version 6.6.32
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.6.32
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "max96724 1-0027":4 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 15: max96724 1-0027 (6 pads, 5 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev2
            routes:
                    0/0 -> 4/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "max96717 1-0030":1 [ENABLED,IMMUTABLE]
            pad1: Sink
                    <- "max96717 1-0031":1 [ENABLED,IMMUTABLE]
            pad2: Sink
                    <- "max96717 1-0032":1 [ENABLED,IMMUTABLE]
            pad3: Sink
                    <- "max96717 1-0033":1 [ENABLED,IMMUTABLE]
            pad4: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
            pad5: Source
    
    - entity 24: max96717 1-0033 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev3
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "isx031 7-0013":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "max96724 1-0027":3 [ENABLED,IMMUTABLE]
    
    - entity 29: isx031 7-0013 (1 pad, 1 link, 0 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev4
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:none quantization:lim-range]
                    -> "max96717 1-0033":0 [ENABLED,IMMUTABLE]
    
    - entity 33: max96717 1-0032 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev5
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "isx031 6-0012":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "max96724 1-0027":2 [ENABLED,IMMUTABLE]
    
    - entity 38: isx031 6-0012 (1 pad, 1 link, 0 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev6
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:none quantization:lim-range]
                    -> "max96717 1-0032":0 [ENABLED,IMMUTABLE]
    
    - entity 42: max96717 1-0031 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev7
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "isx031 5-0011":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "max96724 1-0027":1 [ENABLED,IMMUTABLE]
    
    - entity 47: isx031 5-0011 (1 pad, 1 link, 0 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev8
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:none quantization:lim-range]
                    -> "max96717 1-0031":0 [ENABLED,IMMUTABLE]
    
    - entity 51: max96717 1-0030 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev9
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "isx031 4-0010":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "max96724 1-0027":0 [ENABLED,IMMUTABLE]
    
    - entity 56: isx031 4-0010 (1 pad, 1 link, 0 routes)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev10
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:none quantization:lim-range]
                    -> "max96717 1-0030":0 [ENABLED,IMMUTABLE]
    
    - entity 62: 30102000.ticsi2rx context 0 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 68: 30102000.ticsi2rx context 1 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 74: 30102000.ticsi2rx context 2 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 80: 30102000.ticsi2rx context 3 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 86: 30102000.ticsi2rx context 4 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 92: 30102000.ticsi2rx context 5 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    

     <medai_debug> media_test_get_image
    [ 2097.719003] <j721e-csi2rx> ti_csi2rx_queue_setup
     [ 2097.732268] videobuf2_common: [cap-0000000007849065] __setup_offsets: buffer 0, plane 0 offset 0x00000000
     ioctl VIDIOC_REQBUFS  2097.746191] videobuf2_common: [cap-0000000007849065] __setup_offsets: buffer 1, plane 0 offset 0x003f5000
    m
    [ 2097.761756] videobuf2_common: [cap-0000000007849065] __setup_offsets: buffer 2, plane 0 offset 0x007ea000
    [ 2097.773094] videobuf2_common: [cap-0000000007849065] __setup_offsets: buffer 3, plane 0 offset 0x00bdf000
    [ 2097.782678] videobuf2_common: [cap-0000000007849065] __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each
    [ 2097.792682] videobuf2_common: [cap-0000000007849065] vb2_mmap: buffer 0, plane 0 successfully mapped
     => calloc buffer
      ioctl VIDIOC_QUERYBUF 0
    [ 2097.807271] <j721e-csi2rx> ti_csi2rx_buffer_prepare
      ioctl VIDIOC_QBUF 0
    [ 2097.817981] videobuf2_common: [cap-0000000007849065] vb2_core_qbuf: qbuf of buffer 0 succeeded
      ioctl VIDIOC_QUERYBUF 1
    [ 2097.828719] videobuf2_common: [cap-0000000007849065] vb2_mmap: buffer 1, plane 0 successfully mapped
      ioctl VIDIOC_QBUF 1
    [ 2097.840231] <j721e-csi2rx> ti_csi2rx_buffer_prepare
    [ 2097.848042] videobuf2_common: [cap-0000000007849065] vb2_core_qbuf: qbuf of buffer 1 succeeded
      ioctl VIDIOC_QUERYBUF 2
    [ 2097.856688] videobuf2_common: [cap-0000000007849065] vb2_mmap: buffer 2, plane 0 successfully mapped
      ioctl VIDIOC_QBUF 2
    [ 2097.868233] <j721e-csi2rx> ti_csi2rx_buffer_prepare
    [ 2097.876046] videobuf2_common: [cap-0000000007849065] vb2_core_qbuf: qbuf of buffer 2 succeeded
      ioctl VIDIOC_QUERYBUF 3
    [ 2097.884693] videobuf2_common: [cap-0000000007849065] vb2_mmap: buffer 3, plane 0 successfully mapped
      ioctl VIDIOC_QBUF 3
    [ 2097.896237] <j721e-csi2rx> ti_csi2rx_buffer_prepare
    [ 2097.904052] videobuf2_common: [cap-0000000007849065] vb2_core_qbuf: qbuf of buffer 3 succeeded
    [ 2097.912682] <vb2-v4l2> 2 vb2_streamon
     <medai_debug> ioctl VIDIOC_STREAMON
    [ 2097.921518] <vb2-core> 2 vb2_core_streamon begin
    [ 2097.931143] <vb2-core>   2.1 vb2_core_streamon->prepare_streaming
    [ 2097.938095] <vb2-core>   2.2 vb2_core_streamon->vb2_start_streaming
    [ 2097.945222] <vb2-core>   2.2.1 vb2_start_streaming->start_streaming
    [ 2097.952345] <j721e-csi2rx> ti_csi2rx_start_streaming begin
    [ 2097.962065] <mc-entity> media_pipeline_start begin
    [ 2097.967809] <mc-entity> media_pipeline_start end
    [ 2097.973300] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2097.979912] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2097.986520] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2097.993127] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2097.999773] <v4l2_subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 30102000.ticsi2rx
    [ 2098.009243] <j721e-csi2rx>   ti_csi2rx_sd_enable_streams 30102000.ticsi2rx pad:1
    [ 2098.017498] <v4l2_subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 cdns_csi2rx.30101000.csi-bridge
    [ 2098.028180] <cdns-csi2rx> 1) csi2rx_enable_streams cdns_csi2rx.30101000.csi-bridge pad:1
    [ 2098.037134] <cdns-csi2rx> 1.1) csi2rx_start
    [ 2098.042259] <cdns-csi2rx>   1.1.1) csi2rx_start->csi2rx_configure_ext_dphy
    [ 2098.050007] <cdns-csi2rx>   csi2rx_configure_ext_dphy->v4l2_get_link_freq link_freq:800000000
    [ 2098.059389] <cdns-csi2rx>    1.1.1.1)csi2rx_configure_ext_dphy->phy_power_on
    [ 2098.067297] <cdns-csi2rx>    1.1.1.2)csi2rx_configure_ext_dphy->phy_configure
    [ 2098.075408] <cdns-csi2rx> 1.2) csi2rx_enable_streams->v4l2_subdev_enable_streams remote_pad->index:4 sink:1
    [ 2098.086013] <v4l2_subdev> v4l2_subdev_enable_streams pad:4 streams_mask:0x1 max96724 1-0027
    [ 2098.095310] <max96724> max96724_enable_streams
    [ 2098.100616] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2098.107222] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2098.113828] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2098.120434] <max96724> v4l2_subdev_call->get_frame_desc pad:1
    [ 2098.127041] <max96724>     max96724_configure_ports_for_streaming->v4l2_subdev_state_get_stream_format
    [ 2098.137296] <v4l2_subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 max96717 1-0030
    [ 2098.146591] <v4l2_subdev> v4l2_subdev_enable_streams pad:0 streams_mask:0x1 isx031 5-0010
    [ 2098.155714] <j721e-csi2rx> ti_csi2rx_start_streaming end
    [ 2098.161886] <vb2-core>   2.2 vb2_core_streamon begin->vb2_start_streaming return 0
    [ 2098.170315] videobuf2_common: [cap-0000000007849065] vb2_core_streamon: successful
     <medai_debug> capture_frame->select 2s
    timeout!
      frame:0
     <medai_debug> capture_frame->select 2s
    timeout!
      frame:1
     <medai_debug> capture_frame->select 2s
    timeout!
      frame:2
     <medai_debug> capture_frame->select 2s
    

    MAX96724:

    0x108 0x11A 0x12C 0x13E Video locked: 1 1 1 1

    0x8D0 0x8D1 csi2_tx0_pkt_cnt: 0 1 8 0
                          0x8D2 0x8D3 phy0_pkt_cnt: 0 1 8 0

     max96724 is video locked ;

     csi2_tx0 is OK.

    vb2_core_streamon: successful

     How can I confirm the receipt of 30102000.ticsi2rx  ? 

  • Dear Donghui.

    per discussion, please check the configuration for reference, as below link.

    AM62P: Capturing images with the V4L2 application failed - Processors forum - Processors - TI E2E support forums

    please check the registers for CSI-RX?

    thanks a lot!

    yong

  • media-ctl -p -d /dev/media0
    Media controller API version 6.6.32
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.6.32
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 4 routes)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
       routes:
            0/0 -> 1/0 [ACTIVE]
            0/1 -> 2/0 [ACTIVE]
            0/2 -> 3/0 [ACTIVE]
            0/3 -> 4/0 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:1 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:2 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:3 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
       pad2: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
       pad3: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
       pad4: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
       pad5: Source
            -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
       pad6: Source
            -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 4 routes)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
       routes:
            0/0 -> 1/0 [ACTIVE]
            0/1 -> 1/1 [ACTIVE]
            0/2 -> 1/2 [ACTIVE]
            0/3 -> 1/3 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:1 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:2 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:3 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "max96724 1-0027":4 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:1 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:2 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            [stream:3 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
       pad2: Source
       pad3: Source
       pad4: Source
    
    - entity 15: max96724 1-0027 (6 pads, 5 links, 4 routes)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev2
       routes:
            0/0 -> 4/0 [ACTIVE]
            1/0 -> 4/1 [ACTIVE]
            2/0 -> 4/2 [ACTIVE]
            3/0 -> 4/3 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
            <- "max96717 1-0030":1 [ENABLED,IMMUTABLE]
       pad1: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
            <- "max96717 1-0031":1 [ENABLED,IMMUTABLE]
       pad2: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
            <- "max96717 1-0032":1 [ENABLED,IMMUTABLE]
       pad3: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
            <- "max96717 1-0033":1 [ENABLED,IMMUTABLE]
       pad4: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
            [stream:1 fmt:UYVY8_1X16/1920x1080 field:none]
            [stream:2 fmt:UYVY8_1X16/1920x1080 field:none]
            [stream:3 fmt:UYVY8_1X16/1920x1080 field:none]
            -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
       pad5: Source
    
    - entity 24: max96717 1-0030 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev3
       routes:
            0/0 -> 1/0 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "isx031 4-0010":0 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "max96724 1-0027":0 [ENABLED,IMMUTABLE]
    
    - entity 29: max96717 1-0031 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev4
       routes:
            0/0 -> 1/0 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "isx031 5-0011":0 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "max96724 1-0027":1 [ENABLED,IMMUTABLE]
    
    - entity 34: max96717 1-0032 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev5
       routes:
            0/0 -> 1/0 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "isx031 6-0012":0 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "max96724 1-0027":2 [ENABLED,IMMUTABLE]
    
    - entity 39: max96717 1-0033 (2 pads, 2 links, 1 route)
                 type V4L2 subdev subtype Unknown flags 0
                 device node name /dev/v4l-subdev6
       routes:
            0/0 -> 1/0 [ACTIVE]
       pad0: Sink
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            <- "isx031 7-0013":0 [ENABLED,IMMUTABLE]
       pad1: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            -> "max96724 1-0027":3 [ENABLED,IMMUTABLE]
    
    - entity 44: isx031 4-0010 (1 pad, 1 link, 1 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev7
       routes:
            0/0 -> 0/0 [ACTIVE]
       pad0: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
            -> "max96717 1-0030":0 [ENABLED,IMMUTABLE]
    
    - entity 48: isx031 5-0011 (1 pad, 1 link, 1 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev8
       routes:
            0/0 -> 0/0 [ACTIVE]
       pad0: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
            -> "max96717 1-0031":0 [ENABLED,IMMUTABLE]
    
    - entity 52: isx031 6-0012 (1 pad, 1 link, 1 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev9
       routes:
            0/0 -> 0/0 [ACTIVE]
       pad0: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
            -> "max96717 1-0032":0 [ENABLED,IMMUTABLE]
    
    - entity 56: isx031 7-0013 (1 pad, 1 link, 1 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev10
       routes:
            0/0 -> 0/0 [ACTIVE]
       pad0: Source
            [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
            -> "max96717 1-0033":0 [ENABLED,IMMUTABLE]
    
    - entity 62: 30102000.ticsi2rx context 0 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
       pad0: Sink
            <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 68: 30102000.ticsi2rx context 1 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
       pad0: Sink
            <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 74: 30102000.ticsi2rx context 2 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
       pad0: Sink
            <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 80: 30102000.ticsi2rx context 3 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
       pad0: Sink
            <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 86: 30102000.ticsi2rx context 4 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
       pad0: Sink
            <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 92: 30102000.ticsi2rx context 5 (1 pad, 1 link)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
       pad0: Sink
            <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    
    v4l2-ctl -d /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap=3  --stream-to=./uyvy_1920_1080.yuv --stream-count=10
    
    [ 1180.553355] <v4l2-ioctl> v4l_g_fmt
    [ 1180.557923] <j721e-csi2rx> 1 vb2_ops->ti_csi2rx_queue_setup
    [ 1180.566912] videobuf2_common: [cap-00000000328d61c4] __setup_offsets: buffer 0, plane 0 offset 0x00000000
    [ 1180.577712] videobuf2_common: [cap-00000000328d61c4] __setup_offsets: buffer 1, plane 0 offset 0x003f5000
    [ 1180.588596] videobuf2_common: [cap-00000000328d61c4] __setup_offsets: buffer 2, plane 0 offset 0x007ea000
    [ 1180.598205] videobuf2_common: [cap-00000000328d61c4] __vb2_queue_alloc: allocated 3 buffers, 1 plane(s) each
    [ 1180.608142] videobuf2_common: [cap-00000000328d61c4] vb2_mmap: buffer 0, plane 0 successfully mapped
    [ 1180.617321] videobuf2_common: [cap-00000000328d61c4] vb2_mmap: buffer 1, plane 0 successfully mapped
    [ 1180.626497] videobuf2_common: [cap-00000000328d61c4] vb2_mmap: buffer 2, plane 0 successfully mapped
    [ 1180.635633] <v4l2-ioctl> v4l_g_fmt
    [ 1180.639919] videobuf2_common: [cap-00000000328d61c4] vb2_core_qbuf: qbuf of buffer 0 succeeded
    [ 1180.648525] videobuf2_common: [cap-00000000328d61c4] vb2_core_qbuf: qbuf of buffer 1 succeeded
    [ 1180.657137] videobuf2_common: [cap-00000000328d61c4] vb2_core_qbuf: qbuf of buffer 2 succeeded
    [ 1180.665740] <v4l2-ioctl> v4l_g_fmt
    [ 1180.670011] <vb2-v4l2> 2 vb2_streamon
    [ 1180.674544] <vb2-core> 2 vb2_core_streamon begin
    [ 1180.680025] <vb2-core>   2.1 prepare_streaming
    [ 1180.685329] <vb2-core>   2.2 vb2_start_streaming
    [ 1180.690808] <j721e-csi2rx> 3 vb2_ops->ti_csi2rx_buffer_queue idx:0 vc:0 stream:0
    [ 1180.699060] <j721e-csi2rx> 3 vb2_ops->ti_csi2rx_buffer_queue idx:0 vc:0 stream:0
    [ 1180.707313] <j721e-csi2rx> 3 vb2_ops->ti_csi2rx_buffer_queue idx:0 vc:0 stream:0
    [ 1180.715574] <vb2-core>     2.2.1 call_qop start_streaming
    [ 1180.721832] <j721e-csi2rx> 4 vb2_ops->ti_csi2rx_start_streaming begin
    [ 1180.732511] <j721e-csi2rx>   4.1 video_device_pipeline_start
    [ 1180.739056] <mc-entity>  1)media_pipeline_start->media_pipeline_populate
    [ 1180.746676] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:1
    [ 1180.755187] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:2
    [ 1180.763617] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:3
    [ 1180.772043] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:4
    [ 1180.780469] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:5
    [ 1180.788895] <j721e-csi2rx> ti_csi2rx_link_validate->v4l2_subdev_call get_fmt pad:6
    [ 1180.797334] <max96724> Mapping sink_pad:0/sink_stream:0 to output VC 0
    [ 1180.804728] <max96724> Mapping sink_pad:1/sink_stream:0 to output VC 1
    [ 1180.812115] <max96724> Mapping sink_pad:2/sink_stream:0 to output VC 2
    [ 1180.819502] <max96724> Mapping sink_pad:3/sink_stream:0 to output VC 3
    [ 1180.826888] <j721e-csi2rx>   4.2 ti_csi2rx_get_vc route->sink_stream=stream:0 => 0
    [ 1180.835318] <j721e-csi2rx>   4.3 ti_csi2rx_dma_submit_pending
    [ 1180.841917] <j721e-csi2rx>   4.2.1 ti_csi2rx_start_dma idx:0 vc:0 stream:0
    [ 1180.849664] <j721e-csi2rx>   4.2.1 ti_csi2rx_start_dma idx:0 vc:0 stream:0
    [ 1180.857391] <j721e-csi2rx>   4.2.1 ti_csi2rx_start_dma idx:0 vc:0 stream:0
    [ 1180.865138] <j721e-csi2rx>   4.4 v4l2_subdev_enable_streams pad:1 streams_mask:1
    [ 1180.873398] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 30102000.ticsi2rx
    [ 1180.882434] <j721e-csi2rx>   ops-> ti_csi2rx_sd_enable_streams 30102000.ticsi2rx pad:1
    [ 1180.891209] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0xf cdns_csi2rx.30101000.csi-bridge
    [ 1180.901465] <cdns-csi2rx> 1) csi2rx_enable_streams cdns_csi2rx.30101000.csi-bridge pad:1
    [ 1180.910422] <cdns-csi2rx> 1.1) csi2rx_start num_lanes:4
    [ 1180.916594] <cdns-csi2rx>   1.1.1) csi2rx_start->csi2rx_configure_ext_dphy
    [ 1180.924342] <cdns-csi2rx>    1.1.1.1) v4l2_get_link_freq bpp:16 num_lanes:4 => link_freq: 51840000
    [ 1180.934167] cdns-csi2rx 30101000.csi-bridge: Guessing link frequency using bitdepth of stream 0.
    [ 1180.942943] cdns-csi2rx 30101000.csi-bridge: V4L2_CID_LINK_FREQ control is required for multi format sources.
    [ 1180.952854] <cdns-csi2rx>    1.1.1.2)phy_mipi_dphy_get_default_config_for_hsclk->phy_power_on link_freq:51840000
    [ 1180.963885] <cdns-csi2rx>    1.1.1.3)csi2rx_configure_ext_dphy->phy_power_on
    [ 1180.971793] <cdns-csi2rx>    1.1.1.4)csi2rx_configure_ext_dphy->phy_configure
    [ 1180.979914] <cdns-csi2rx> 1.2) v4l2_subdev_enable_streams remote_pad->index:4 sink:15
    [ 1180.988608] <subdev> v4l2_subdev_enable_streams pad:4 streams_mask:0xf max96724 1-0027
    [ 1180.997471] <max96724> max96724_enable_streams pad:4 streams_mask:0xf
    [ 1181.004784] <max96724> enable TX port 0
    [ 1181.009483] <max96724> enable RX port 0
    [ 1181.014183] <max96724> max96724_enable_streams->v4l2_subdev_enable_streams port 0 streams 0x1
    [ 1181.023563] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 max96717 1-0030
    [ 1181.032423] <subdev> v4l2_subdev_enable_streams pad:0 streams_mask:0x1 isx031 4-0010
    [ 1181.041111]  <isx031_utility> isx031_sensor_stream_on 0
    [ 1181.047606] <max96724> enable RX port 1
    [ 1181.052315] <max96724> max96724_enable_streams->v4l2_subdev_enable_streams port 1 streams 0x1
    [ 1181.061702] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 max96717 1-0031
    [ 1181.070564] <subdev> v4l2_subdev_enable_streams pad:0 streams_mask:0x1 isx031 5-0011
    [ 1181.079253]  <isx031_utility> isx031_sensor_stream_on 1
    [ 1181.085695] <max96724> enable RX port 2
    [ 1181.090395] <max96724> max96724_enable_streams->v4l2_subdev_enable_streams port 2 streams 0x1
    [ 1181.099780] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 max96717 1-0032
    [ 1181.108644] <subdev> v4l2_subdev_enable_streams pad:0 streams_mask:0x1 isx031 6-0012
    [ 1181.117331]  <isx031_utility> isx031_sensor_stream_on 2
    [ 1181.123763] <max96724> enable RX port 3
    [ 1181.128467] <max96724> max96724_enable_streams->v4l2_subdev_enable_streams port 3 streams 0x1
    [ 1181.137848] <subdev> v4l2_subdev_enable_streams pad:1 streams_mask:0x1 max96717 1-0033
    [ 1181.146707] <subdev> v4l2_subdev_enable_streams pad:0 streams_mask:0x1 isx031 7-0013
    [ 1181.155394]  <isx031_utility> isx031_sensor_stream_on 3
    [ 1181.161834] <j721e-csi2rx> 4 ti_csi2rx_start_streaming end
    [ 1181.168182] videobuf2_common: [cap-00000000328d61c4] vb2_core_streamon: successful
    [ 1181.175799] videobuf2_common: [cap-00000000328d61c4] __vb2_wait_for_done_vb: will sleep waiting for buffers
    [ 1181.185528] <vb2-core> wait_event_interruptible q->done_wq
    ^C[ 1186.226652] videobuf2_common: [cap-00000000328d61c4] __vb2_wait_for_done_vb: sleep was interrupted
    

    show ci2rx
    [  804.051743]   max_lanes:  4
    [  804.054541]   max_streams:4
    [  804.057325] reg:0x30101000 value:0x8c63164c
    [  804.061503]   MAX_LANE_NB             = 4
    [  804.065507]   NUM_STREAMS             = 4
    [  804.069519]   STREAMx_FIFO_MODE       = 1 1 1 1
    [  804.074046]   STREAMx_NUM_PIXELS      = 0 0 0 0
    [  804.078572]   STREAMx_MONITOR_PRESENT = 1 1 1 1
    [  804.083097] reg:0x30101004 value:0x0
    [  804.086668] reg:0x30101008 value:0x43210400
    [  804.090846]   LANE_NB                  = 4
    [  804.095028] reg:0x30101020 value:0x73
    [  804.098686] reg:0x30101040 value:0x1f01f
    [  804.102602]   DPHY Clock Lane   Enable = 1
    [  804.106693]   DPHY data  Lane 3 Enable = 1
    [  804.110784]   DPHY data  Lane 2 Enable = 1
    [  804.114880]   DPHY data  Lane 1 Enable = 1
    [  804.118971]   DPHY data  Lane 0 Enable = 1
    [  804.123061] reg:0x30101104 value:0x80000112
    [  804.123064]   RUNNING          = 1
    [  804.130635]   STREAM_FSM       = 2(0:IDLE 1:_WAIT_CTRL_DATA 2:STREAM_CTRL 3:STREAM_DATA 4:STREAM_CONV_PIX_NB)
    [  804.140532] reg:0x30101108 value:0x80000112
    [  804.144709]   VC_SELECT        = 0xf
    [  804.148281]   DATATYPE_SELECT0 = 0x0
    [  804.151858] reg:0x30101114 value:0x       0
    [  804.156088]   PACKET_SIZE              = 0x0
    [  804.160355]   Number of the last frame = 0x0
    [  804.164622] reg:0x30101124 value:0x       0
    [  804.168798]   FRAME_COUNTER              = 0x0
    [  804.173236]   FCC_EN                     = 0
    

    Dear  Jianzhong:

           We have confirmed the mipi output  from Max96724 using an oscilloscope. 

    But it still select timeout and blocked in:

        vb2_core_streamon: successful

         __vb2_wait_for_done_vb: will sleep waiting for buffers

    which register in 30102000.ticsi2rx  can  show the mipi recieve ?    

  • Thanks. It is OK now.  (Need to set link-frequencies = /bits/ 64 <400000000> in dts )

  • Dear Donghui.

    1. suggest to start from one camera case, then use v4l2-ctl to check the pipeline.


    as we discussed, this APN would be reference, www.ti.com/.../spradh2.pdf.
    based on AM62P LINUX SDK10.0, we bringup one IMX390 camera on AM62P SK board. here is the steps for your reference:
    1). build default SD card.
    https://dev.ti.com/tirex/explore/node?node=A__ASJBSnRiMQcRqUpwgcsa3Q__AM62P-ACADEMY__fp5YxRM__LATEST

    2). add imx390 dts to build process
    /opt/1Twork/repository/AM62P/ti-processor-sdk-linux-am62pxx-evm-10.00.07.04/Rules.make
    KERNEL_DEVICETREE_PREFIX=ti/k3-am62p5|ti/k3-am62x-sk|ti/k3-fpdlink-imx390
    then build corresponding dtbs
    a0224068local@a0224068local-Latitude-5289:/opt/1Twork/repository/AM62P/ti-processor-sdk-linux-am62pxx-evm-10.00.07.04$ make linux-dtbs
    3). copy these new dtbs to SD card.
    a0224068local@a0224068local-Latitude-5289:/opt/1Twork/repository/AM62P/ti-processor-sdk-linux-am62pxx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti/arch/arm64/boot/dts/ti$ sudo cp k3-fpdlink-imx390-rcm-0*.dtbo /media/a0224068local/root/boot/dtb/ti/

    update uEnv.txt in /media/a0224068local/uEnv.txt.
    name_overlays=ti/k3-am62x-sk-csi2-v3link-fusion.dtbo ti/k3-fpdlink-imx390-rcm-0-0.dtbo

    4). power on board with SD card boot mode. then run below commands in LINUX concole.
    root@am62pxx-evm:~# media-ctl -d 0 -V "'ds90ub953 4-0044':0 [fmt:SRGGB12_1X12/1936x1100 field: none]"
    root@am62pxx-evm:~# media-ctl -d 0 -V "'ds90ub960 4-0030':0 [fmt:SRGGB12_1X12/1936x1100 field: none]"
    root@am62pxx-evm:~# media-ctl -d 0 -V "'cdns_csi2rx.30101000.csi-bridge':0/0 [fmt:SRGGB12_1X12/1936x1100 field: none]"
    root@am62pxx-evm:~# media-ctl -d 0 -V "'30102000.ticsi2rx':0/0 [fmt:SRGGB12_1X12/1936x1100 field: none]"
    root@am62pxx-evm:~# v4l2-ctl --device /dev/video2 --set-fmt-video=width=1936,height=1100,pixelformat=RG12 --stream-mmap
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
    <<<<<<<<<<<<^C
    5) device info list in the end of this post, as reference.

    please check the pipeline is configured in right way on your board.

    and also please make sure that camera sensor/serializer/deserializer driver is ok.

    2. please add debug code in csi2rx driver. please notice, need do queue then wait for dma callback to finish one round of camere capture.
    /opt/1Twork/repository/ti-processor-sdk-linux-am62pxx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c

    log example:
    [ 35.182152] === ti_csi2rx_buffer_queue
    [ 35.186080] === ti_csi2rx_drain_dma, paddr = 0xa3110000, len = 0x8000
    [ 35.192763] === ti_csi2rx_drain_callback
    [ 35.196781] === ti_csi2rx_start_dma, vb2_buf = 0xa64b7000, len = 0x258000
    [ 35.235886] === ti_csi2rx_dma_callback

    root@am62pxx-evm:~# media-ctl --device /dev/media0 -p
    Media controller API version 6.6.32

    Media device information
    ------------------------
    driver j721e-csi2rx
    model TI-CSI2RX
    serial
    bus info platform:30102000.ticsi2rx
    hw revision 0x1
    driver version 6.6.32

    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev0
    routes:
    0/0 -> 1/0 [ACTIVE]
    pad0: Sink
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
    pad2: Source
    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
    pad3: Source
    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
    pad4: Source
    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
    pad5: Source
    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
    pad6: Source
    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]

    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev1
    routes:
    0/0 -> 1/0 [ACTIVE]
    pad0: Sink
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    <- "ds90ub960 4-0030":4 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source

    - entity 15: ds90ub960 4-0030 (6 pads, 2 links, 1 route)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev2
    routes:
    0/0 -> 4/0 [ACTIVE]
    pad0: Sink
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    <- "ds90ub953 4-0044":1 [ENABLED,IMMUTABLE]
    pad1: Sink
    pad2: Sink
    pad3: Sink
    pad4: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad5: Source

    - entity 24: ds90ub953 4-0044 (2 pads, 2 links, 1 route)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev3
    routes:
    0/0 -> 1/0 [ACTIVE]
    pad0: Sink
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    <- "imx390 6-0020":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100 field:none]
    -> "ds90ub960 4-0030":0 [ENABLED,IMMUTABLE]

    - entity 29: imx390 6-0020 (1 pad, 1 link, 2 routes)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev4
    routes:
    0/0 -> 0/0 [ACTIVE]
    0/0 -> 0/1 [INACTIVE]
    pad0: Source
    [stream:0 fmt:SRGGB12_1X12/1936x1100@1/30 field:none colorspace:smpte170m]
    -> "ds90ub953 4-0044":0 [ENABLED,IMMUTABLE]

    - entity 35: 30102000.ticsi2rx context 0 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]

    - entity 41: 30102000.ticsi2rx context 1 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]

    - entity 47: 30102000.ticsi2rx context 2 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video4
    pad0: Sink
    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]

    - entity 53: 30102000.ticsi2rx context 3 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video5
    pad0: Sink
    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]

    - entity 59: 30102000.ticsi2rx context 4 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video6
    pad0: Sink
    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]

    - entity 65: 30102000.ticsi2rx context 5 (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video7
    pad0: Sink
    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]

    thanks a lot!

    yong