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.

AM625SIP: Request for Support on Camera View Development Issue (TI AM6254)

Part Number: AM625SIP
Other Parts Discussed in Thread: TEST2

Dear Expert,

We have encountered several issues and are currently stuck with our camera view development on TI AM6254.

Could you please help check and guide us on how to fix the issue below?

May we know, how to confirm CSI2Rx recieved data correctly and also its output?

The connection setup is as follows:

Camera (1, 2, 3, 4) → Video Decoder (TP2855) → AM62x CSI -> Framebuffer display on LCD

root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUYV,width=1920,height=1080 !  videoconvert ! videoscale !  fbdevsink
WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1920, height=(int)1080
root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video0 !  videoconvert ! videoscale !  fbdevsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 9996.003008] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../gst-plugins-good-1.20.6/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.109949575
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Freeing pipeline ...
root@am62xx-evm:/tmp# dmesg | grep csi2rx
[    0.256738] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
[    0.351396] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
[  394.447682] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
[  547.372966] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev

root@am62xx-evm:/tmp# media-ctl -p
Media controller API version 6.1.33

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

Device topology
- entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none]
                <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
                -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]

- entity 7: 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:YUYV8_1X16/1920x1080 field:none]
                <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
                -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
        pad2: Source
        pad3: Source
        pad4: Source

- entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
        pad0: Source
                [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]

  • Attached full log:

    Error writing session log (ASCII mode) to file: C:\\PROGRA~2\\Mobatek\\MOBAXT~1\\[com COM13]  (2026-03-09_165513)  COM13  (USB Serial Port(COM13)).log
    
    root@am62xx-evm:/tmp# clear
    root@am62xx-evm:/tmp# dmesg | grep CSI
    [    0.054894] SCSI subsystem initialized
    [    0.113592] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
    [    0.351396] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [    5.414175] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [    5.414229] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [    5.414257] tp2855 1-0044: tp2855: xvclk enabled
    [    5.414265] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.414271] tp2855 1-0044: using device tree for GPIO lookup
    [    5.414296] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.426738] tp2855 1-0044: tp2855: hardware reset performed
    [    5.428103] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [    5.428191] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.450861] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [  123.174964] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  123.175070] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  123.175135] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  123.175198] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  220.355059] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [  221.891717] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  221.891823] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  221.891890] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  221.891954] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  329.259289] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [  337.915741] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  337.915847] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  337.915912] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  337.915975] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  394.446684] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  512.431477] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  512.431601] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  512.431666] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  512.431730] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  547.372059] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  660.833133] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [  693.179204] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9226.583821] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9226.583945] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9226.584010] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9226.584073] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9315.871601] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 9348.393541] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:/tmp# ls /dev/video*
    /dev/video0  /dev/video1  /dev/video2  /dev/video3
    root@am62xx-evm:/tmp# ls /dev/media*
    /dev/media0
    root@am62xx-evm:/tmp# ls /dev/
    autofs              i2c-1               mmcblk1             mtdblock4           ptypc               tty10               tty30               tty50               ttyS11              ttypd               vcsa5
    block               initctl             mmcblk1p1           mtdblock5           ptypd               tty11               tty31               tty51               ttyS2               ttype               vcsa6
    btrfs-control       input               mmcblk1p2           mtdblock6           ptype               tty12               tty32               tty52               ttyS3               ttypf               vcsu
    bus                 kmsg                mqueue              net                 ptypf               tty13               tty33               tty53               ttyS4               udev_network_queue  vcsu1
    char                log                 mtd0                null                random              tty14               tty34               tty54               ttyS5               uinput              vcsu2
    console             loop-control        mtd0ro              port                rfkill              tty15               tty35               tty55               ttyS6               urandom             vcsu3
    cpu_dma_latency     loop0               mtd1                pps0                rpmsg0              tty16               tty36               tty56               ttyS7               v4l                 vcsu4
    crypto              loop1               mtd1ro              ptmx                rpmsg_ctrl0         tty17               tty37               tty57               ttyS8               v4l-subdev0         vcsu5
    cuse                loop2               mtd2                ptp0                rtc                 tty18               tty38               tty58               ttyS9               v4l-subdev1         vcsu6
    disk                loop3               mtd2ro              pts                 rtc0                tty19               tty39               tty59               ttyp0               v4l-subdev2         vfio
    dma_heap            loop4               mtd3                ptyp0               rtc1                tty2                tty4                tty6                ttyp1               vcs                 video0
    dri                 loop5               mtd3ro              ptyp1               shm                 tty20               tty40               tty60               ttyp2               vcs1                video1
    fb                  loop6               mtd4                ptyp2               snapshot            tty21               tty41               tty61               ttyp3               vcs2                video2
    fb0                 loop7               mtd4ro              ptyp3               snd                 tty22               tty42               tty62               ttyp4               vcs3                video3
    fd                  mapper              mtd5                ptyp4               stderr              tty23               tty43               tty63               ttyp5               vcs4                zero
    full                media0              mtd5ro              ptyp5               stdin               tty24               tty44               tty7                ttyp6               vcs5
    fuse                mem                 mtd6                ptyp6               stdout              tty25               tty45               tty8                ttyp7               vcs6
    gpiochip0           mmcblk0             mtd6ro              ptyp7               tee0                tty26               tty46               tty9                ttyp8               vcsa
    gpiochip1           mmcblk0boot0        mtdblock0           ptyp8               teepriv0            tty27               tty47               ttyGS0              ttyp9               vcsa1
    gpiochip2           mmcblk0boot1        mtdblock1           ptyp9               tty                 tty28               tty48               ttyS0               ttypa               vcsa2
    hugepages           mmcblk0p1           mtdblock2           ptypa               tty0                tty29               tty49               ttyS1               ttypb               vcsa3
    i2c-0               mmcblk0rpmb         mtdblock3           ptypb               tty1                tty3                tty5                ttyS10              ttypc               vcsa4
    root@am62xx-evm:/tmp# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 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]
    
    - entity 7: 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:YUYV8_1X16/1920x1080 field:none]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
            pad2: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
            pad3: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:/tmp#  media-ctl -d /dev/media0 -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 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]
    
    - entity 7: 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:YUYV8_1X16/1920x1080 field:none]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
            pad2: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
            pad3: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:/tmp#   v4l2-ctl --list-devices
    j721e-csi2rx (platform:30102000.ticsi2rx):
            /dev/video0
            /dev/video1
            /dev/video2
            /dev/video3
            /dev/media0
    
    root@am62xx-evm:/tmp# v4l2-ctl --list-formats -d /dev/video0
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
            [1]: 'UYVY' (UYVY 4:2:2)
            [2]: 'YVYU' (YVYU 4:2:2)
            [3]: 'VYUY' (VYUY 4:2:2)
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
    root@am62xx-evm:/tmp# v4l2-ctl --list-formats -d /dev/video1
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
            [1]: 'UYVY' (UYVY 4:2:2)
            [2]: 'YVYU' (YVYU 4:2:2)
            [3]: 'VYUY' (VYUY 4:2:2)
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
    root@am62xx-evm:/tmp# v4l2-ctl --list-formats -d /dev/video2
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
            [1]: 'UYVY' (UYVY 4:2:2)
            [2]: 'YVYU' (YVYU 4:2:2)
            [3]: 'VYUY' (VYUY 4:2:2)
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
    root@am62xx-evm:/tmp# v4l2-ctl --list-formats -d /dev/video3
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
            [1]: 'UYVY' (UYVY 4:2:2)
            [2]: 'YVYU' (YVYU 4:2:2)
            [3]: 'VYUY' (VYUY 4:2:2)
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
    root@am62xx-evm:/tmp# yavta --capture=1 --format=YUYV --size=1920x1080 --file=frame.raw /dev/video0
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/s[ 9796.303759] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    ource: mono/EoF
    Buffer 0/0 mapped at address 0xffffbaebb000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffbaac6000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffba6d1000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffba2dc000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffb9ee7000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffb9af2000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffb96fd000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb9308000.
    Unable to start streaming: Operation not supported (95).
    8 buffers released.
    root@am62xx-evm:/tmp# dmesg | grep CSI
    [    0.054894] SCSI subsystem initialized
    [    0.113592] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
    [    0.351396] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:/tmp# dmesg | grep csi2rx
    [    0.256738] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351396] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [  394.447682] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  547.372966] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  660.833745] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  693.179809] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9315.872176] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9348.394147] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9796.303759] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:/tmp#
    root@am62xx-evm:/tmp# gst-launch-1.0 videotestsrc ! videoscale ! video/x-raw,width=1920,height=1080 ! videoconvert ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:15.188791275
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUYV,width=1920,height=1080 !  videoconvert ! videoscale !  fbdevsink
    WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1920, height=(int)1080
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video0 !  videoconvert ! videoscale !  fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [ 9996.003008] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    ../gst-plugins-good-1.20.6/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.109949575
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Freeing pipeline ...
    root@am62xx-evm:/tmp# dmesg | grep csi2rx
    [    0.256738] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351396] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [  394.447682] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  547.372966] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  660.833745] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [  693.179809] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9315.872176] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9348.394147] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9796.303759] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 9996.003008] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:/tmp#
    

  • Hi Paul,

    My concern is line 384 of the full log that you have shared. It states that operation is not supported.

    Are you returning -EOPNOTSUPP from any of your functions? Otherwise, it seems like there might be an error in the driver code for TP2855 where V4L2 is not calling the IOCTL.

    Regards,
    Jay

  • Hi Jay,

    Thank you for your support.

    We would like to share our code, V4L2 setup, and new logs.

    (Today, we are unable to attach files on this site, so we are sharing the content as plain text.)

    Could you please provide further hints or guidance? If the issue is related to the decoder driver code, could you also share a similar reference driver for a video decoder that works with the AM62x?

    Thank you.

  • 1) TP2855

    // SPDX-License-Identifier: GPL-2.0
    /*
     * tp2855 driver v4 - Optimized for TI AM62
     *
     * Copyright (C) 2020 Rockchip Electronics Co., Ltd.
     * Refined 2026 for TI AM62 setup.
     * v4: Enhanced s_stream logging, fixed set_fmt/get_fmt TRY support.
     */
    
    #include <linux/clk.h>
    #include <linux/device.h>
    #include <linux/delay.h>
    #include <linux/gpio/consumer.h>
    #include <linux/i2c.h>
    #include <linux/module.h>
    #include <linux/pm_runtime.h>
    #include <linux/regulator/consumer.h>
    #include <linux/sysfs.h>
    #include <linux/slab.h>
    #include <linux/version.h>
    #include <media/v4l2-subdev.h>
    #include <media/v4l2-fwnode.h>
    #include <media/v4l2-mediabus.h>
    #include <media/v4l2-ctrls.h>
    #include <media/v4l2-async.h>
    #include <media/media-entity.h>
    #include <linux/pinctrl/consumer.h>
    #include <linux/videodev2.h>
    #include <linux/interrupt.h>
    #include <linux/kthread.h>
    
    #define DRIVER_VERSION KERNEL_VERSION(0, 0x04, 0x0)
    #define TP2855_XVCLK_FREQ 27000000
    #define TP2855_LINK_FREQ_594M (594000000UL >> 1)
    #define TP2855_NAME "tp2855"
    #define TP2855_VERSION "V4.0-STABLE"
    
    #define PAD_MAX 4
    
    struct regval {
        u8 addr;
        u8 val;
    };
    
    struct tp2855_mode {
        u32 bus_fmt;
        u32 width;
        u32 height;
        struct v4l2_fract max_fps;
        u32 mipi_freq_idx;
        u32 bpp;
        const struct regval *global_reg_list;
        u32 vc[PAD_MAX];
    };
    
    struct tp2855 {
        struct i2c_client *client;
        struct clk *xvclk;
        struct gpio_desc *reset_gpio;
    
        struct v4l2_subdev subdev;
        struct media_pad pads[PAD_MAX];
        struct v4l2_ctrl_handler ctrl_handler;
        struct v4l2_ctrl *pixel_rate;
        struct mutex mutex;
        const struct tp2855_mode *cur_mode;
    
        int streaming;
        unsigned int nlanes;
        u32 bus_fmt;
    };
    
    #define to_tp2855(sd) container_of(sd, struct tp2855, subdev)
    
    static const struct regval common_setting_594M_1080p_25fps_regs[] = {
        {0x40, 0x04}, {0xf5, 0x00}, {0x02, 0x40}, {0x07, 0xc0}, {0x0b, 0xc0},
        {0x0c, 0x03}, {0x0d, 0x50}, {0x15, 0x03}, {0x16, 0xd2}, {0x17, 0x80},
        {0x18, 0x29}, {0x19, 0x38}, {0x1a, 0x47}, {0x1c, 0x0a}, {0x1d, 0x50},
        {0x20, 0x30}, {0x21, 0x84}, {0x22, 0x36}, {0x23, 0x3c},
        {0x2b, 0x60}, {0x2c, 0x0a}, {0x2d, 0x30}, {0x2e, 0x70}, {0x30, 0x48},
        {0x31, 0xbb}, {0x32, 0x2e}, {0x33, 0x90}, {0x35, 0x05}, {0x38, 0x00},
        {0x39, 0x1C}, {0x40, 0x08}, {0x01, 0xf0}, {0x02, 0x01}, {0x08, 0x0f},
        {0x20, 0x44}, {0x34, 0xe4}, {0x15, 0x0C}, {0x25, 0x08}, {0x26, 0x06},
        {0x27, 0x11}, {0x29, 0x0a}, {0x33, 0x07}, {0x33, 0x00}, {0x14, 0x33},
        {0x14, 0xb3}, {0x14, 0x33},
    };
    
    static const struct tp2855_mode supported_modes[] = {
        {
            .bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16,
            .width = 1920,
            .height = 1080,
            .max_fps = { .numerator = 1, .denominator = 25 },
            .global_reg_list = common_setting_594M_1080p_25fps_regs,
            .mipi_freq_idx = 0,
            .bpp = 8,
            .vc = { 0, 1, 2, 3 },
        },
    };
    
    static const u32 tp2855_formats[] = {
        MEDIA_BUS_FMT_YUYV8_1X16,
        MEDIA_BUS_FMT_UYVY8_2X8,
    };
    
    static const s64 link_freq_items[] = { TP2855_LINK_FREQ_594M };
    
    static int tp2855_write_reg(struct i2c_client *client, u8 reg, u8 val)
    {
        struct i2c_msg msg;
        u8 buf[2] = { reg, val };
        int ret;
    
        msg.addr = client->addr;
        msg.flags = client->flags;
        msg.buf = buf;
        msg.len = 2;
    
        ret = i2c_transfer(client->adapter, &msg, 1);
        if (ret >= 0) {
            usleep_range(300, 400);
            return 0;
        }
        dev_err(&client->dev, "tp2855 write 0x%x=0x%x failed\n", reg, val);
        return ret;
    }
    
    static int tp2855_write_array(struct i2c_client *client, const struct regval *regs, int size)
    {
        int i, ret = 0;
        for (i = 0; i < size; i++) {
            ret = tp2855_write_reg(client, regs[i].addr, regs[i].val);
            if (ret) break;
        }
        return ret;
    }
    
    static int tp2855_start_stream(struct tp2855 *tp2855)
    {
        struct i2c_client *client = tp2855->client;
        int ret;
    
        dev_info(&client->dev, "tp2855: starting stream, writing %ld registers\n",
                ARRAY_SIZE(common_setting_594M_1080p_25fps_regs));
    
        ret = tp2855_write_array(client, tp2855->cur_mode->global_reg_list,
                ARRAY_SIZE(common_setting_594M_1080p_25fps_regs));
        if (ret) {
            dev_err(&client->dev, "tp2855: failed to write init sequence (i2c error %d)\n", ret);
            return ret;
        }
    
        // Final check of register 0x40 (Streaming control)
        {
            u8 val = 0;
            struct i2c_msg msgs[2];
            u8 reg = 0x40;
            msgs[0].addr = client->addr; msgs[0].flags = 0; msgs[0].len = 1; msgs[0].buf = ®
            msgs[1].addr = client->addr; msgs[1].flags = I2C_M_RD; msgs[1].len = 1; msgs[1].buf = &val;
            i2c_transfer(client->adapter, msgs, 2);
            dev_info(&client->dev, "tp2855: streaming status: Reg 0x40=0x%02x\n", val);
        }
    
        return 0;
    }
    
    static int tp2855_stop_stream(struct tp2855 *tp2855)
    {
        struct i2c_client *client = tp2855->client;
    
        tp2855_write_reg(client, 0x40, 0x08);
        tp2855_write_reg(client, 0x23, 0x02);
        dev_info(&client->dev, "tp2855: stream stopped\n");
    
        return 0;
    }
    
    static int tp2855_set_stream(struct v4l2_subdev *sd, int on)
    {
        struct tp2855 *tp2855 = to_tp2855(sd);
        struct i2c_client *client = tp2855->client;
        int ret = 0;
    
        dev_info(&client->dev, "tp2855_set_stream: entry on=%d\n", on);
    
        mutex_lock(&tp2855->mutex);
    
        if (tp2855->streaming == on) {
            mutex_unlock(&tp2855->mutex);
            return 0;
        }
    
        if (on) {
            ret = pm_runtime_resume_and_get(&client->dev);
            if (ret < 0) {
                dev_err(&client->dev, "tp2855: failed to resume pm_runtime: %d\n", ret);
                goto err_unlock;
            }
            dev_info(&client->dev, "tp2855: pm_runtime resumed successfully\n");
    
            ret = tp2855_start_stream(tp2855);
            if (ret < 0) {
                pm_runtime_put(&client->dev);
                goto err_unlock;
            }
        } else {
            tp2855_stop_stream(tp2855);
            pm_runtime_put(&client->dev);
        }
    
        tp2855->streaming = on;
    
    err_unlock:
        mutex_unlock(&tp2855->mutex);
        dev_info(&client->dev, "tp2855_set_stream: exit ret=%d\n", ret);
        return ret;
    }
    
    static int tp2855_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt)
    {
        struct tp2855 *tp2855 = to_tp2855(sd);
        const struct tp2855_mode *mode = &supported_modes[0];
        int i;
    
        dev_info(&tp2855->client->dev, "tp2855_set_fmt: entry pad=%u which=%s\n",
                fmt->pad, (fmt->which == V4L2_SUBDEV_FORMAT_TRY) ? "TRY" : "ACTIVE");
    
        mutex_lock(&tp2855->mutex);
    
        // Validate format code
        for (i = 0; i < ARRAY_SIZE(tp2855_formats); i++) {
            if (fmt->format.code == tp2855_formats[i])
                break;
        }
        if (i == ARRAY_SIZE(tp2855_formats))
            fmt->format.code = MEDIA_BUS_FMT_YUYV8_1X16;
    
        fmt->format.width = mode->width;
        fmt->format.height = mode->height;
        fmt->format.field = V4L2_FIELD_NONE;
        fmt->format.colorspace = V4L2_COLORSPACE_SRGB;
        fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601;
        fmt->format.quantization = V4L2_QUANTIZATION_LIM_RANGE;
        fmt->format.xfer_func = V4L2_XFER_FUNC_709;
    
        if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
            struct v4l2_mbus_framefmt *try_fmt = v4l2_subdev_get_try_format(sd, state, fmt->pad);
            *try_fmt = fmt->format;
    #endif
        } else {
            tp2855->bus_fmt = fmt->format.code;
            tp2855->cur_mode = mode;
        }
    
        mutex_unlock(&tp2855->mutex);
    
        dev_info(&tp2855->client->dev, "tp2855: set_fmt complete: %dx%d code: 0x%x\n",
                fmt->format.width, fmt->format.height, fmt->format.code);
    
        return 0;
    }
    
    static int tp2855_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt)
    {
        struct tp2855 *tp2855 = to_tp2855(sd);
    
        if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
            fmt->format = *v4l2_subdev_get_try_format(sd, state, fmt->pad);
    #endif
            return 0;
        }
    
        mutex_lock(&tp2855->mutex);
        fmt->format.width = tp2855->cur_mode->width;
        fmt->format.height = tp2855->cur_mode->height;
        fmt->format.code = tp2855->bus_fmt;
        fmt->format.field = V4L2_FIELD_NONE;
        fmt->format.colorspace = V4L2_COLORSPACE_SRGB;
        fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601;
        fmt->format.quantization = V4L2_QUANTIZATION_LIM_RANGE;
        fmt->format.xfer_func = V4L2_XFER_FUNC_709;
        mutex_unlock(&tp2855->mutex);
    
        return 0;
    }
    
    static int tp2855_enum_mbus_code(struct v4l2_subdev *sd,
            struct v4l2_subdev_state *state,
            struct v4l2_subdev_mbus_code_enum *code)
    {
        if (code->index >= ARRAY_SIZE(tp2855_formats))
            return -EINVAL;
    
        code->code = tp2855_formats[code->index];
        return 0;
    }
    
    static int tp2855_enum_frame_size(struct v4l2_subdev *sd,
            struct v4l2_subdev_state *state,
            struct v4l2_subdev_frame_size_enum *fse)
    {
        int i;
    
        if (fse->index >= ARRAY_SIZE(supported_modes))
            return -EINVAL;
    
        for (i = 0; i < ARRAY_SIZE(tp2855_formats); i++) {
            if (fse->code == tp2855_formats[i])
                break;
        }
        if (i == ARRAY_SIZE(tp2855_formats))
            return -EINVAL;
    
        fse->min_width = supported_modes[fse->index].width;
        fse->max_width = supported_modes[fse->index].width;
        fse->max_height = supported_modes[fse->index].height;
        fse->min_height = supported_modes[fse->index].height;
    
        return 0;
    }
    
    static int tp2855_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
            struct v4l2_mbus_config *cfg)
    {
        struct tp2855 *tp2855 = to_tp2855(sd);
    
        cfg->type = V4L2_MBUS_CSI2_DPHY;
        cfg->bus.mipi_csi2.num_data_lanes = tp2855->nlanes;
        cfg->bus.mipi_csi2.flags = 0;
    
        return 0;
    }
    
    static const struct v4l2_subdev_pad_ops tp2855_subdev_pad_ops = {
        .enum_mbus_code = tp2855_enum_mbus_code,
        .enum_frame_size = tp2855_enum_frame_size,
        .get_fmt = tp2855_get_fmt,
        .set_fmt = tp2855_set_fmt,
        .get_mbus_config = tp2855_g_mbus_config,
    };
    
    static int tp2855_initialize_controls(struct tp2855 *tp2855)
    {
        struct v4l2_ctrl_handler *handler = &tp2855->ctrl_handler;
        int ret;
    
        v4l2_ctrl_handler_init(handler, 2);
        v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, 0, 0, link_freq_items);
        tp2855->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, 0, 148500000, 1, 148500000);
        tp2855->subdev.ctrl_handler = handler;
    
        if (handler->error) {
            ret = handler->error;
            v4l2_ctrl_handler_free(handler);
            return ret;
        }
    
        return 0;
    }
    
    static const struct v4l2_subdev_video_ops tp2855_video_ops = {
        .s_stream = tp2855_set_stream,
    };
    
    static const struct v4l2_subdev_ops tp2855_subdev_ops = {
        .video = &tp2855_video_ops,
        .pad = &tp2855_subdev_pad_ops,
    };
    
    static int tp2855_probe(struct i2c_client *client)
    {
        struct device *dev = &client->dev;
        struct tp2855 *tp2855;
        struct v4l2_subdev *sd;
        int ret, i;
    
        dev_info(dev, "tp2855: probing start (Version: %s)...\n", TP2855_VERSION);
    
        tp2855 = devm_kzalloc(dev, sizeof(*tp2855), GFP_KERNEL);
        if (!tp2855) return -ENOMEM;
    
        tp2855->client = client;
        tp2855->cur_mode = &supported_modes[0];
        tp2855->bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16;
        mutex_init(&tp2855->mutex);
    
        {
            struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = V4L2_MBUS_CSI2_DPHY };
            struct fwnode_handle *endpoint = fwnode_graph_get_next_endpoint(dev_fwnode(dev), NULL);
            if (endpoint) {
                ret = v4l2_fwnode_endpoint_parse(endpoint, &bus_cfg);
                if (!ret) tp2855->nlanes = bus_cfg.bus.mipi_csi2.num_data_lanes;
                fwnode_handle_put(endpoint);
            } else {
                tp2855->nlanes = 4;
            }
        }
    
        tp2855->xvclk = devm_clk_get(dev, "xvclk");
        if (!IS_ERR(tp2855->xvclk)) clk_prepare_enable(tp2855->xvclk);
    
        tp2855->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
        if (!IS_ERR(tp2855->reset_gpio)) {
            gpiod_set_value_cansleep(tp2855->reset_gpio, 1);
            usleep_range(10000, 11000);
            gpiod_set_value_cansleep(tp2855->reset_gpio, 0);
        }
    
        sd = &tp2855->subdev;
        v4l2_i2c_subdev_init(sd, client, &tp2855_subdev_ops);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
    
        for (i = 0; i < PAD_MAX; i++) tp2855->pads[i].flags = MEDIA_PAD_FL_SOURCE;
        media_entity_pads_init(&sd->entity, PAD_MAX, tp2855->pads);
    
        tp2855_initialize_controls(tp2855);
    
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
        pm_runtime_idle(dev);
    
        ret = v4l2_async_register_subdev_sensor(sd);
        if (!ret) dev_info(dev, "tp2855: probe succeeded!\n");
    
        return ret;
    }
    
    static void tp2855_remove(struct i2c_client *client)
    {
        struct v4l2_subdev *sd = i2c_get_clientdata(client);
        struct tp2855 *tp2855 = to_tp2855(sd);
    
        v4l2_async_unregister_subdev(sd);
        v4l2_ctrl_handler_free(&tp2855->ctrl_handler);
        pm_runtime_disable(&client->dev);
        mutex_destroy(&tp2855->mutex);
    }
    
    static const struct i2c_device_id tp2855_id[] = { { "tp2855", 0 }, { } };
    MODULE_DEVICE_TABLE(i2c, tp2855_id);
    
    static const struct of_device_id tp2855_of_match[] = { { .compatible = "tp2855" }, { } };
    MODULE_DEVICE_TABLE(of, tp2855_of_match);
    
    static struct i2c_driver tp2855_i2c_driver = {
        .driver = { .name = "tp2855", .of_match_table = tp2855_of_match },
        .probe_new = tp2855_probe,
        .remove = tp2855_remove,
        .id_table = tp2855_id,
    };
    
    module_i2c_driver(tp2855_i2c_driver);
    MODULE_AUTHOR("Vicent Chi / Optimized for AM62");
    MODULE_DESCRIPTION("tp2855 sensor driver v4");
    MODULE_LICENSE("GPL v2");
    

  • 2) device tree

    techpoint: tp2855@44 {
        compatible = "tp2855";
        status = "okay";
        reg = <0x44>;
        clocks = <&tp2855_clk>;
        clock-names = "xvclk";
        pinctrl-names = "default";
        pinctrl-0 = <&csi2mcugpio0_pins_default>;
        reset-gpios = <&mcu_gpio0 8 GPIO_ACTIVE_LOW>;
        interrupt-parent = <&mcu_gpio0>;
        interrupts = <7 IRQ_TYPE_EDGE_FALLING>; //IRQ_TYPE_EDGE_FALLING
        irq-gpios = <&mcu_gpio0 7 GPIO_ACTIVE_LOW>; //IRQ_TYPE_EDGE_FALLING
        irq-flags = <2>;
        port {
            csi2_cam0: endpoint {
                remote-endpoint = <&csi2rx0_in_sensor>;
                clock-lanes = <0>;
                data-lanes = <1 2 3 4>; /* Support 4 cameras */
                link-frequencies = /bits/ 64 <297000000>; /* Match driver supported modes */
            };
        };
    };
    
    ---
    
    &cdns_csi2rx0 {
        status = "okay";
        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";
            csi0_port0: port@0 {
                reg = <0>;
                status = "okay";
    
                csi2rx0_in_sensor: endpoint {
                    remote-endpoint = <&csi2_cam0>;
                    bus-type = <4>; /* CSI2 DPHY. */
                    clock-lanes = <0>;
                    /* link-frequencies = /bits/ 64 <800000000>;*/
                    data-lanes = <1 2 3 4>; /* data-lanes = < 1 2 3 4 > */
                };
            };
        };
    };
    

  • 3) New log (too long, error when we upload, we split it to multiple upload here)

    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    root@am62xx-evm:~# ls /dev/video*
    /dev/video0 /dev/video1 /dev/video2 /dev/video3
    root@am62xx-evm:~# ls /dev/m*
    /dev/media0 /dev/mmcblk1p1 /dev/mtd3 /dev/mtdblock0
    /dev/mem /dev/mmcblk1p2 /dev/mtd3ro /dev/mtdblock1
    /dev/mmcblk0 /dev/mtd0 /dev/mtd4 /dev/mtdblock2
    /dev/mmcblk0boot0 /dev/mtd0ro /dev/mtd4ro /dev/mtdblock3
    /dev/mmcblk0boot1 /dev/mtd1 /dev/mtd5 /dev/mtdblock4
    /dev/mmcblk0p1 /dev/mtd1ro /dev/mtd5ro /dev/mtdblock5
    /dev/mmcblk0rpmb /dev/mtd2 /dev/mtd6 /dev/mtdblock6
    /dev/mmcblk1 /dev/mtd2ro /dev/mtd6ro
    
    /dev/mapper:
    control
    
    /dev/mqueue:
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver j721e-csi2rx
    model TI-CSI2RX
    serial
    bus info platform:30102000.ticsi2rx
    hw revision 0x1
    driver version 6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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/640x480 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/640x480 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]
    
    - entity 7: 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev2
    pad0: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad2: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad3: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    ERROR: pipeline doesn't want to preroll.
    Execution ended after 0:00:00.000732020
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:~# cd /tmp/
    root@am62xx-evm:/tmp# vi set_entity.sh
    root@am62xx-evm:/tmp# chmod +x set_entity.sh
    root@am62xx-evm:/tmp# ./set_entity.sh
    --- Synchronizing Media Pipeline to 1080p YUYV ---
    Setting Sensor (Entity 13) ...
    Setting CSI-2 Bridge Sink (Entity 7, Pad 0) ...
    Setting CSI-2 Bridge Source (Entity 7, Pad 1) ...
    Setting TI CSI2RX Sink (Entity 1, Pad 0) ...
    Setting Video Node /dev/video0 ...
    --- Current Topology ---
    - entity 1: 30102000.ticsi2rx (5 pads, 5 links, 1 route)
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    - entity 7: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    Done.
    root@am62xx-evm:/tmp# cat set_entity.sh
    #!/bin/bash
    
    # Configuration settings
    FMT="fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range"
    
    echo "--- Synchronizing Media Pipeline to 1080p YUYV ---"
    
    # 1. Set Sensor (Entity 13)
    echo "Setting Sensor (Entity 13) ..."
    media-ctl -d /dev/media0 -V "'tp2855 1-0044':0 [$FMT]"
    
    # 2. Set CSI-2 Bridge Sink (Entity 7, Pad 0)
    echo "Setting CSI-2 Bridge Sink (Entity 7, Pad 0) ..."
    media-ctl -d /dev/media0 -V "'cdns_csi2rx.30101000.csi-bridge':0 [$FMT]"
    
    # 3. Set CSI-2 Bridge Source (Entity 7, Pad 1)
    echo "Setting CSI-2 Bridge Source (Entity 7, Pad 1) ..."
    media-ctl -d /dev/media0 -V "'cdns_csi2rx.30101000.csi-bridge':1 [$FMT]"
    
    # 4. Set TI CSI2RX Sink (Entity 1, Pad 0)
    echo "Setting TI CSI2RX Sink (Entity 1, Pad 0) ..."
    media-ctl -d /dev/media0 -V "'30102000.ticsi2rx':0 [$FMT]"
    
    # 5. Set Video Node (/dev/video0)
    echo "Setting Video Node /dev/video0 ..."
    v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=YUYV,colorspace=srgb,xfer=709,ycbcr=601,quantization=lim-range
    
    # 6. Verify Result
    echo "--- Current Topology ---"
    media-ctl -p | grep -E "entity (1|7|13)|fmt:"
    
    echo "Done."
    
    root@am62xx-evm:/tmp# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver j721e-csi2rx
    model TI-CSI2RX
    serial
    bus info platform:30102000.ticsi2rx
    hw revision 0x1
    driver version 6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 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]
    
    - entity 7: 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:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev2
    pad0: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad2: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad3: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:/tmp# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.285700] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [ 381.694232] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694295] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694329] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694362] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967868] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967977] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968042] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968106] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    ame.raw /dev/video0p# yavta --capture=1 --format=YUYV --size=1920x1080 --file=fra
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    [ 497.388842] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffb5abb000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffb56c6000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffb52d1000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffb4edc000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffb4ae7000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffb46f2000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffb42fd000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb3f08000.
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.285700] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [ 381.694232] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694295] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694329] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694362] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967868] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967977] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968042] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968106] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:/tmp# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:/tmp# vi check_tp2855_reg_status.sh
    root@am62xx-evm:/tmp# chmod +x check_tp2855_reg_status.sh
    root@am62xx-evm:/tmp# ./check_tp2855_reg_status.sh
    
    ==============================================
    TP2855 CAMERA INPUT STATUS
    ==============================================
    
    ------------- Camera Channel 0 -------------
    Status : NO CAMERA SIGNAL
    Registers : 0x01=0x9b 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ------------- Camera Channel 1 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 25 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x1f 0x02=0xc2 0x03=0x0e 0x15=0x13
    
    ------------- Camera Channel 2 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 30 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x13 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ------------- Camera Channel 3 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 30 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x13 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ==============================================
    TP2855 CSI OUTPUT CONFIGURATION
    ==============================================
    Registers:
    0x15 = 0x13
    0x2A = 0x30
    0x2B = 0x4a
    0x2C = 0x0a
    
    Decoded Output:
    Pixel format : YUYV (YUV422)
    Interface : MIPI CSI-2
    Output : CSI2 video packets
    Destination : AM62x CSI2RX
    ame.raw /dev/video1p# yavta --capture=1 --format=YUYV --size=1920x1080 --file=fra
    Device /dev/video1 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffb977b000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffb9386000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffb8f91000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffb8b9c000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffb87a7000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffb83b2000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffb7fbd000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb7bc8000.
    Unable to start streaming: No such device (19).
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.285700] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [ 381.694232] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694295] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694329] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694362] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967868] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967977] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968042] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968106] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 497.387948] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:/tmp# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video0 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    ERROR: pipeline doesn't want to preroll.
    Execution ended after 0:00:00.000539120
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video1 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.000933995
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video2 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.000845800
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:/tmp# gst-launch-1.0 v4l2src device=/dev/video3 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.000919195
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:/tmp# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 497.388842] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.285700] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [ 381.694232] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694295] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694329] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694362] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967868] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967977] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968042] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968106] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 497.387948] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 1100.065231] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:/tmp# i2cget -f -y 1 0x44 0x2D
    0x30
    root@am62xx-evm:/tmp# i2cget -f -y 1 0x44 0x2E
    0x70
    root@am62xx-evm:/tmp# dmesg | grep csi2rx
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 497.388842] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    ! videoscale ! fbdevsink-launch-1.0 v4l2src device=/dev/video0 ! videoconvert !
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    [ 1254.341411] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    ../gst-plugins-good-1.20.6/sys/v4l2/gstv4l2src.c(777): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.115348805
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Freeing pipeline ...
    ame.raw /dev/video0p# yavta --capture=1 --format=YUYV --size=1920x1080 --file=fra
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    8 buffers requested.
    l[ 1291.000187] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    ength: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffff851ab000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffff84db6000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffff849c1000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffff845cc000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffff841d7000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffff83de2000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffff839ed000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffff835f8000.
    root@am62xx-evm:/tmp# dmesg | grep csi
    [ 0.256831] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351572] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 497.388842] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 1254.341411] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    [ 1291.000187] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:/tmp# dmesg | grep tp2855
    [ 6.886799] tp2855 1-0044: tp2855: probing start (Version: V3.5-DUAL-FIXED)...
    [ 6.886985] tp2855 1-0044: tp2855: detected 4 data lanes from DT
    [ 6.887060] tp2855 1-0044: tp2855: xvclk enabled
    [ 6.887082] tp2855 1-0044: GPIO lookup for consumer reset
    [ 6.887099] tp2855 1-0044: using device tree for GPIO lookup
    [ 6.887158] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.899108] tp2855 1-0044: tp2855: hardware reset performed
    [ 6.899488] tp2855 1-0044: tp2855: IRQ 275 requested successfully
    [ 6.899594] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.901303] tp2855 1-0044: tp2855: probe succeeded! (4 source pads enabled)
    [ 140.064184] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064293] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064357] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 140.064421] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.285700] tp2855 1-0044: tp2855: set_fmt 1920x1080, code: 0x2011 (YUYV8_1X16)
    [ 381.694232] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694295] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694329] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 381.694362] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967868] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.967977] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968042] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 402.968106] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 497.387948] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 1100.065231] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 1254.340801] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    [ 1290.999605] tp2855 1-0044: tp2855: get_fmt 1920x1080, code: 0x2011
    root@am62xx-evm:/tmp#
    U-Boot SPL 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    NOTICE: BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE: BL31: Built : 00:42:57, Jan 13 2023
    
    
    U-Boot 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    
    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    DRAM: 2 GiB
    Core: 69 devices, 30 uclasses, devicetree: separate
    MMC: mmc@fa10000: 0, mmc@fa00000: 1
    Net: eth0: ethernet@8000000port@1
    Hit any key to stop autoboot: 0
    SD/MMC found on device 1
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    OK
    
    root@am62xx-evm:~# ls /dev/video*
    /dev/video0 /dev/video1 /dev/video2 /dev/video3
    root@am62xx-evm:~# ls /dev/media*
    /dev/media0
    root@am62xx-evm:~# ls /dev/
    autofs i2c-1 mmcblk1 mtdblock4 ptypc tty10 tty30 tty50 ttyS11 ttypd vcsa5
    block initctl mmcblk1p1 mtdblock5 ptypd tty11 tty31 tty51 ttyS2 ttype vcsa6
    btrfs-control input mmcblk1p2 mtdblock6 ptype tty12 tty32 tty52 ttyS3 ttypf vcsu
    bus kmsg mqueue net ptypf tty13 tty33 tty53 ttyS4 udev_network_queue vcsu1
    char log mtd0 null random tty14 tty34 tty54 ttyS5 uinput vcsu2
    console loop-control mtd0ro port rfkill tty15 tty35 tty55 ttyS6 urandom vcsu3
    cpu_dma_latency loop0 mtd1 pps0 rpmsg0 tty16 tty36 tty56 ttyS7 v4l vcsu4
    crypto loop1 mtd1ro ptmx rpmsg_ctrl0 tty17 tty37 tty57 ttyS8 v4l-subdev0 vcsu5
    cuse loop2 mtd2 ptp0 rtc tty18 tty38 tty58 ttyS9 v4l-subdev1 vcsu6
    disk loop3 mtd2ro pts rtc0 tty19 tty39 tty59 ttyp0 v4l-subdev2 vfio
    dma_heap loop4 mtd3 ptyp0 rtc1 tty2 tty4 tty6 ttyp1 vcs video0
    dri loop5 mtd3ro ptyp1 shm tty20 tty40 tty60 ttyp2 vcs1 video1
    fb loop6 mtd4 ptyp2 snapshot tty21 tty41 tty61 ttyp3 vcs2 video2
    fb0 loop7 mtd4ro ptyp3 snd tty22 tty42 tty62 ttyp4 vcs3 video3
    fd mapper mtd5 ptyp4 stderr tty23 tty43 tty63 ttyp5 vcs4 zero
    full media0 mtd5ro ptyp5 stdin tty24 tty44 tty7 ttyp6 vcs5
    fuse mem mtd6 ptyp6 stdout tty25 tty45 tty8 ttyp7 vcs6
    gpiochip0 mmcblk0 mtd6ro ptyp7 tee0 tty26 tty46 tty9 ttyp8 vcsa
    gpiochip1 mmcblk0boot0 mtdblock0 ptyp8 teepriv0 tty27 tty47 ttyGS0 ttyp9 vcsa1
    gpiochip2 mmcblk0boot1 mtdblock1 ptyp9 tty tty28 tty48 ttyS0 ttypa vcsa2
    hugepages mmcblk0p1 mtdblock2 ptypa tty0 tty29 tty49 ttyS1 ttypb vcsa3
    i2c-0 mmcblk0rpmb mtdblock3 ptypb tty1 tty3 tty5 ttyS10 ttypc vcsa4
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [ 5.992122] tp2855 1-0044: tp2855: probing start (Version: V4.0-STABLE)...
    [ 5.992187] tp2855 1-0044: GPIO lookup for consumer reset
    [ 5.992193] tp2855 1-0044: using device tree for GPIO lookup
    [ 5.992222] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.003200] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.071961] tp2855 1-0044: tp2855: probe succeeded!
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver j721e-csi2rx
    model TI-CSI2RX
    serial
    bus info platform:30102000.ticsi2rx
    hw revision 0x1
    driver version 6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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/640x480 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/640x480 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]
    
    - entity 7: 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev2
    pad0: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad2: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad3: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# vi set_entity.sh
    root@am62xx-evm:~# cat set_entity.sh
    #!/bin/bash
    
    # CSI setup script v4.1 for TP2855 (1080p YUYV) on TI AM62
    # Sets entities 1 and 7 to match entity 13.
    
    FMT="fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range"
    
    echo "--- Synchronizing Entities 1 and 7 to match Sensor (13) ---"
    
    echo "1. Configuring CSI-2 Bridge (Entity 7) pad 0 (Sink) ..."
    media-ctl -d /dev/media0 -V "'cdns_csi2rx.30101000.csi-bridge':0 [$FMT]"
    
    echo "2. Configuring CSI-2 Bridge (Entity 7) pad 1 (Source) ..."
    media-ctl -d /dev/media0 -V "'cdns_csi2rx.30101000.csi-bridge':1 [$FMT]"
    
    echo "3. Configuring TI CSI2RX (Entity 1) pad 0 (Sink) ..."
    media-ctl -d /dev/media0 -V "'30102000.ticsi2rx':0 [$FMT]"
    
    echo "4. Configuring Video Node /dev/video0 ..."
    v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=YUYV,colorspace=srgb,xfer=709,ycbcr=601,quantization=lim-range
    root@am62xx-evm:~# chmod +x set_entity.sh
    root@am62xx-evm:~# ./set_entity.sh
    --- Synchronizing Entities 1 and 7 to match Sensor (13) ---
    1. Configuring CSI-2 Bridge (Entity 7) pad 0 (Sink) ...
    2. Configuring CSI-2 Bridge (Entity 7) pad 1 (Source) ...
    3. Configuring TI CSI2RX (Entity 1) pad 0 (Sink) ...
    4. Configuring Video Node /dev/video0 ...
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver j721e-csi2rx
    model TI-CSI2RX
    serial
    bus info platform:30102000.ticsi2rx
    hw revision 0x1
    driver version 6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 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]
    
    - entity 7: 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:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    pad4: Source
    
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev2
    pad0: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad2: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    pad3: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    
    - entity 22: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 28: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video1
    pad0: Sink
    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 34: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video2
    pad0: Sink
    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 40: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
    type Node subtype V4L flags 0
    device node name /dev/video3
    pad0: Sink
    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# yavta --capture=1 --format=YUYV --size=1920x1080 --file=frame.raw /dev/video0
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffb36bb000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffb32c6000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffb2ed1000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffb2adc000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffb26e7000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffb22f2000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffb1efd000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb1b08000.
    Unable to start streaming: Operation not supported (95).
    8 buffers released.
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:~# dmesg | grep tp2855
    [ 5.992122] tp2855 1-0044: tp2855: probing start (Version: V4.0-STABLE)...
    [ 5.992187] tp2855 1-0044: GPIO lookup for consumer reset
    [ 5.992193] tp2855 1-0044: using device tree for GPIO lookup
    [ 5.992222] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.003200] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.071961] tp2855 1-0044: tp2855: probe succeeded!
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.001302185
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:~# dmesg | grep tp2855
    [ 5.992122] tp2855 1-0044: tp2855: probing start (Version: V4.0-STABLE)...
    [ 5.992187] tp2855 1-0044: GPIO lookup for consumer reset
    [ 5.992193] tp2855 1-0044: using device tree for GPIO lookup
    [ 5.992222] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.003200] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.071961] tp2855 1-0044: tp2855: probe succeeded!
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video1 ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.000807150
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:~# yavta --capture=1 --format=YUYV --size=1920x1080 --file=frame.raw /dev/video1
    Device /dev/video1 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: YUYV (56595559) 1920x1080 (stride 3840) field none buffer size 4147200
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffbb80b000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffbb416000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffbb021000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffbac2c000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffba837000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffba442000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffba04d000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb9c58000.
    Unable to start streaming: No such device (19).
    8 buffers released.
    root@am62xx-evm:~# dmesg | grep csi
    [ 0.256905] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [ 0.351910] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [ 674.782104] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    root@am62xx-evm:~# vi check_tp2855_reg.sh
    root@am62xx-evm:~# vi check_tp2855_reg.sh
    root@am62xx-evm:~# rm check_tp2855_reg.sh
    root@am62xx-evm:~# vi check_tp2855_reg.sh
    root@am62xx-evm:~# cat check_tp2855_reg.sh
    #!/bin/sh
    
    BUS=1
    ADDR=0x44
    
    decode_fps() {
    case "$1" in
    0x0f) echo "30 fps";;
    0x0e) echo "25 fps";;
    0x0d) echo "20 fps";;
    0x0c) echo "15 fps";;
    *) echo "Unknown";;
    esac
    }
    
    decode_res() {
    case "$1" in
    0xc2) echo "1920x1080";;
    0xc1) echo "1280x720";;
    0xc0) echo "960x576 / SD";;
    *) echo "Unknown";;
    esac
    }
    
    decode_yuv() {
    val=$(( $1 ))
    order=$(( (val >> 4) & 0x3 ))
    
    case "$order" in
    0) echo "UYVY (YUV422)";;
    1) echo "YUYV (YUV422)";;
    2) echo "VYUY (YUV422)";;
    3) echo "YVYU (YUV422)";;
    esac
    }
    
    echo ""
    echo "=============================================="
    echo " TP2855 CAMERA INPUT STATUS"
    echo "=============================================="
    
    for ch in 0 1 2 3
    do
    echo ""
    echo "------------- Camera Channel $ch -------------"
    
    i2cset -f -y $BUS $ADDR 0x40 $ch
    
    r1=$(i2cget -f -y $BUS $ADDR 0x01)
    r2=$(i2cget -f -y $BUS $ADDR 0x02)
    r3=$(i2cget -f -y $BUS $ADDR 0x03)
    r15=$(i2cget -f -y $BUS $ADDR 0x15)
    
    video_loss=$(( (r1 & 0x80) >> 7 ))
    
    if [ "$video_loss" -eq 1 ]; then
    echo "Status : NO CAMERA SIGNAL"
    else
    echo "Status : Camera detected"
    echo "Resolution : $(decode_res $r2)"
    echo "Frame Rate : $(decode_fps $r3)"
    echo "Pixel Format : $(decode_yuv $r15)"
    fi
    
    echo "Registers : 0x01=$r1 0x02=$r2 0x03=$r3 0x15=$r15"
    done
    
    echo ""
    echo "=============================================="
    echo " TP2855 CSI OUTPUT CONFIGURATION"
    echo "=============================================="
    
    yuv=$(i2cget -f -y $BUS $ADDR 0x15)
    mipi=$(i2cget -f -y $BUS $ADDR 0x2A)
    lane=$(i2cget -f -y $BUS $ADDR 0x2B)
    clk=$(i2cget -f -y $BUS $ADDR 0x2C)
    
    echo "Registers:"
    echo "0x15 = $yuv"
    echo "0x2A = $mipi"
    echo "0x2B = $lane"
    echo "0x2C = $clk"
    
    val=$((yuv))
    order=$(( (val >> 4) & 0x3 ))
    
    case "$order" in
    0) pix="UYVY";;
    1) pix="YUYV";;
    2) pix="VYUY";;
    3) pix="YVYU";;
    esac
    
    echo ""
    echo "Decoded Output:"
    echo "Pixel format : $pix (YUV422)"
    echo "Interface : MIPI CSI-2"
    echo "Output : CSI2 video packets"
    echo "Destination : AM62x CSI2RX"
    echo "":x
    
    root@am62xx-evm:~# chmod +x check_tp2855_reg.sh
    root@am62xx-evm:~# ./check_tp2855_reg.sh
    
    ==============================================
    TP2855 CAMERA INPUT STATUS
    ==============================================
    
    ------------- Camera Channel 0 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 30 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x19 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ------------- Camera Channel 1 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 25 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x1f 0x02=0xc2 0x03=0x0e 0x15=0x13
    
    ------------- Camera Channel 2 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 30 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x13 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ------------- Camera Channel 3 -------------
    Status : Camera detected
    Resolution : 1920x1080
    Frame Rate : 30 fps
    Pixel Format : YUYV (YUV422)
    Registers : 0x01=0x13 0x02=0xc2 0x03=0x0f 0x15=0x13
    
    ==============================================
    TP2855 CSI OUTPUT CONFIGURATION
    ==============================================
    Registers:
    0x15 = 0x13
    0x2A = 0x30
    0x2B = 0x4a
    0x2C = 0x0a
    
    Decoded Output:
    Pixel format : YUYV (YUV422)
    Interface : MIPI CSI-2
    Output : CSI2 video packets
    Destination : AM62x CSI2RX
    :x
    root@am62xx-evm:~# i2cget -f -y 1 0x44 0x2D
    0x30
    root@am62xx-evm:~# i2cget -f -y 1 0x44 0x2E
    0x70
    root@am62xx-evm:~# lsmod | grep tp2855
    tp2855 16384 1
    root@am62xx-evm:~# dmesg | grep -i tp2855
    [ 5.992122] tp2855 1-0044: tp2855: probing start (Version: V4.0-STABLE)...
    [ 5.992187] tp2855 1-0044: GPIO lookup for consumer reset
    [ 5.992193] tp2855 1-0044: using device tree for GPIO lookup
    [ 5.992222] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.003200] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.071961] tp2855 1-0044: tp2855: probe succeeded!
    root@am62xx-evm:~# media-ctl -p | grep -A 5 "tp2855"
    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
    pad1: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
    pad2: Source
    pad3: Source
    --
    - entity 13: tp2855 1-0044 (4 pads, 1 link, 0 route)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev2
    pad0: Source
    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    root@am62xx-evm:~#
    root@am62xx-evm:~# v4l2-ctl --verbose --device /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=YUYV --stream-mmap
    VIDIOC_QUERYCAP: ok
    VIDIOC_G_FMT: ok
    VIDIOC_S_FMT: ok
    Format Video Capture:
    Width/Height : 1920/1080
    Pixel Format : 'YUYV' (YUYV 4:2:2)
    Field : None
    Bytes per Line : 3840
    Size[ 2624.287505] cdns-csi2rx 30101000.csi-bridge: Failed to start streams 0x1 on subdev
    Image : 4147200
    Colorspace : sRGB
    Transfer Function : Default (maps to sRGB)
    YCbCr/HSV Encoding: Default (maps to ITU-R 601)
    Quantization : Default (maps to Limited Range)
    Flags :
    VIDIOC_REQBUFS returned 0 (Success)
    VIDIOC_QUERYBUF returned 0 (Success)
    VIDIOC_QUERYBUF returned 0 (Success)
    VIDIOC_QUERYBUF returned 0 (Success)
    VIDIOC_QUERYBUF returned 0 (Success)
    VIDIOC_QBUF returned 0 (Success)
    VIDIOC_QBUF returned 0 (Success)
    VIDIOC_QBUF returned 0 (Success)
    VIDIOC_QBUF returned 0 (Success)
    VIDIOC_STREAMON returned -1 (Operation not supported)
    root@am62xx-evm:~# dmesg | grep -i tp2855
    [ 5.992122] tp2855 1-0044: tp2855: probing start (Version: V4.0-STABLE)...
    [ 5.992187] tp2855 1-0044: GPIO lookup for consumer reset
    [ 5.992193] tp2855 1-0044: using device tree for GPIO lookup
    [ 5.992222] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [ 6.003200] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [ 6.071961] tp2855 1-0044: tp2855: probe succeeded!
    root@am62xx-evm:~#
    

  • 3) New log 

    Part2 merged with above reply

  • Hi Paul,

    It is taking me a bit longer to figure out where the Not Supported error is coming from. I'll try to comment on that by tomorrow.

    I have another concern though, In the TP2855 driver, it looks like you have made 4 pads that I assume correspond to the different cameras that might be connected. The SHIM IP expects everything to be routed through one source pad with multiple routes. You might have to route those.

    Also, I edited your replies with correct formatting and merged the 2 parts of the logs into one. In future, you can use the "Code" option in the "Insert" menu to add code without needing to upload files. As for the file upload issue, we are trying to see what might be causing it.

    Regards,
    Jay

  • Hi Jay,

    Based on the suggestions in the previous communication, we focused on modifying the TP2855 driver code. Below is the update.

    1) TP2855 (Modified to ver 2)

         

    2)  - Test1: Camera 1 -> TP2855-> CSI2Rx AM63 -> Frambuffer LCD

          Able to see a few white color bars on the screen/LCD.

          Look abnormal and photo is here: (https://drive.google.com/file/d/1wG2kZNXCAE-0bSQ2h383AIbzMZ4Lf_0f/view?usp=sharing)

         - Test2:  TP2855 issue color bar -> CSI2Rx AM63 -> Frambuffer LCD
           root@am62xx-evm:~# i2cset -f -y 1 0x44 0x40 0x00
           root@am62xx-evm:~# i2cset -f -y 1 0x44 0x2A 0x38

          Able to see clear/clean solid color bar on screen/LCD

          Look normal and photo is here: (https://drive.google.com/file/d/1qCTzOa43qtBxkNG8bPEBD10JgOZhTBJV/view?usp=sharing)

        

    3) V4L2 setting and log

    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"tp2855 1-0044":0 [fmt:YUYV8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:YUYV8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:YUYV8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"30102000.ticsi2rx":0 [fmt:YUYV8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=YUYV
    media-ctl -proot@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1920x1080 field:none]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 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]
    
    - entity 7: 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:YUYV8_1X16/1920x1080 field:none]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x40 0x00
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x2A 0x38
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 !  videoconvert ! videoscale !  fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    0:10:44.6 / 99:99:99.
    ...
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256987] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351950] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    [  658.807823] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    [  693.636670] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    [  730.806663] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    [  791.155413] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    [ 1212.885607] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    [ 1328.839395] j721e-csi2rx 30102000.ticsi2rx: Failed to drain DMA. Next frame might be bogus
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.564624] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.564701] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.564709] tp2855 1-0044: using device tree for GPIO lookup
    [    5.564736] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.575462] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.578198] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   23.271163] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x2011
    [   60.638315] tp2855 1-0044: tp2855_set_stream: entry on=1
    [   60.638357] tp2855 1-0044: tp2855: starting stream, writing init regs
    [   60.700467] tp2855 1-0044: tp2855: streaming status: Reg 0x40=0x08
    [   60.700498] tp2855 1-0044: tp2855_set_stream: exit ret=0
    root@am62xx-evm:~#
    

  • 1) TP2855 (Modified to ver 2) < reupload

    Failed to attached this code here or on Insert -> Code, but paint text here.


    1 // SPDX-License-Identifier: GPL-2.0
    2 /*
    3 * tp2855 driver v5 - Simplified for TI AM62 Pipeline Validation Fix
    4 *
    5 * Copyright (C) 2020 Rockchip Electronics Co., Ltd.
    6 * Refined 2026 for TI AM62 setup.
    7 * v5: Simplified pads to 1 for easier media pipeline validation.
    8 * Enhanced format support and verbose logging for set_stream.
    9 */
    10
    11 #include <linux/clk.h>
    12 #include <linux/device.h>
    13 #include <linux/delay.h>
    14 #include <linux/gpio/consumer.h>
    15 #include <linux/i2c.h>
    16 #include <linux/module.h>
    17 #include <linux/pm_runtime.h>
    18 #include <linux/regulator/consumer.h>
    19 #include <linux/sysfs.h>
    20 #include <linux/slab.h>
    21 #include <linux/version.h>
    22 #include <media/v4l2-subdev.h>
    23 #include <media/v4l2-fwnode.h>
    24 #include <media/v4l2-mediabus.h>
    25 #include <media/v4l2-ctrls.h>
    26 #include <media/v4l2-async.h>
    27 #include <media/media-entity.h>
    28 #include <linux/pinctrl/consumer.h>
    29 #include <linux/videodev2.h>
    30 #include <linux/interrupt.h>
    31 #include <linux/kthread.h>
    32
    33 #define DRIVER_VERSION KERNEL_VERSION(0, 0x05, 0x0)
    34 #define TP2855_XVCLK_FREQ 27000000
    35 #define TP2855_LINK_FREQ_594M (594000000UL >> 1)
    36 #define TP2855_NAME "tp2855"
    37 #define TP2855_VERSION "V5.0-PIPELINE-FIX"
    38
    39 /* Simplified to 1 pad for initial validation fix */
    40 #define PAD_MAX 1
    41
    42 struct regval {
    43 u8 addr;
    44 u8 val;
    45 };
    46
    47 struct tp2855_mode {
    48 u32 bus_fmt;
    49 u32 width;
    50 u32 height;
    51 struct v4l2_fract max_fps;
    52 u32 mipi_freq_idx;
    53 u32 bpp;
    54 const struct regval *global_reg_list;
    55 };
    56
    57 struct tp2855 {
    58 struct i2c_client *client;
    59 struct clk *xvclk;
    60 struct gpio_desc *reset_gpio;
    61
    62 struct v4l2_subdev subdev;
    63 struct media_pad pads[PAD_MAX];
    64 struct v4l2_ctrl_handler ctrl_handler;
    65 struct v4l2_ctrl *pixel_rate;
    66 struct mutex mutex;
    67 const struct tp2855_mode *cur_mode;
    68
    69 int streaming;
    70 unsigned int nlanes;
    71 u32 bus_fmt;
    72 };
    73
    74 #define to_tp2855(sd) container_of(sd, struct tp2855, subdev)
    75
    76 static const struct regval common_setting_594M_1080p_25fps_regs[] = {
    77 {0x40, 0x04}, {0xf5, 0x00}, {0x02, 0x40}, {0x07, 0xc0}, {0x0b, 0xc0},
    78 {0x0c, 0x03}, {0x0d, 0x50}, {0x15, 0x03}, {0x16, 0xd2}, {0x17, 0x80},
    79 {0x18, 0x29}, {0x19, 0x38}, {0x1a, 0x47}, {0x1c, 0x0a}, {0x1d, 0x50},
    80 {0x20, 0x30}, {0x21, 0x84}, {0x22, 0x36}, {0x23, 0x3c},
    81 {0x2b, 0x60}, {0x2c, 0x0a}, {0x2d, 0x30}, {0x2e, 0x70}, {0x30, 0x48},
    82 {0x31, 0xbb}, {0x32, 0x2e}, {0x33, 0x90}, {0x35, 0x05}, {0x38, 0x00},
    83 {0x39, 0x1C}, {0x40, 0x08}, {0x01, 0xf0}, {0x02, 0x01}, {0x08, 0x0f},
    84 {0x20, 0x44}, {0x34, 0xe4}, {0x15, 0x0C}, {0x25, 0x08}, {0x26, 0x06},
    85 {0x27, 0x11}, {0x29, 0x0a}, {0x33, 0x07}, {0x33, 0x00}, {0x14, 0x33},
    86 {0x14, 0xb3}, {0x14, 0x33},
    87 };
    88
    89 static const struct tp2855_mode supported_modes[] = {
    90 {
    91 .bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16,
    92 .width = 1920,
    93 .height = 1080,
    94 .max_fps = { .numerator = 1, .denominator = 25 },
    95 .global_reg_list = common_setting_594M_1080p_25fps_regs,
    96 .mipi_freq_idx = 0,
    97 .bpp = 8,
    98 },
    99 };
    100
    101 static const u32 tp2855_formats[] = {
    102 MEDIA_BUS_FMT_YUYV8_1X16,
    103 MEDIA_BUS_FMT_UYVY8_1X16,
    104 };
    105
    106 static const s64 link_freq_items[] = { TP2855_LINK_FREQ_594M };
    107
    108 static int tp2855_write_reg(struct i2c_client *client, u8 reg, u8 val)
    109 {
    110 struct i2c_msg msg;
    111 u8 buf[2] = { reg, val };
    112 int ret;
    113
    114 msg.addr = client->addr;
    115 msg.flags = client->flags;
    116 msg.buf = buf;
    117 msg.len = 2;
    118
    119 ret = i2c_transfer(client->adapter, &msg, 1);
    120 if (ret >= 0) {
    121 usleep_range(300, 400);
    122 return 0;
    123 }
    124 dev_err(&client->dev, "tp2855 write 0x%x=0x%x failed\n", reg, val);
    125 return ret;
    126 }
    127
    128 static int tp2855_write_array(struct i2c_client *client, const struct regval *regs, int size)
    129 {
    130 int i, ret = 0;
    131 for (i = 0; i < size; i++) {
    132 ret = tp2855_write_reg(client, regs[i].addr, regs[i].val);
    133 if (ret) break;
    134 }
    135 return ret;
    136 }
    137
    138 static int tp2855_start_stream(struct tp2855 *tp2855)
    139 {
    140 struct i2c_client *client = tp2855->client;
    141 int ret;
    142
    143 dev_info(&client->dev, "tp2855: starting stream, writing init regs\n");
    144
    145 ret = tp2855_write_array(client, tp2855->cur_mode->global_reg_list,
    146 ARRAY_SIZE(common_setting_594M_1080p_25fps_regs));
    147 if (ret) {
    148 dev_err(&client->dev, "tp2855: failed to write init sequence (%d)\n", ret);
    149 return ret;
    150 }
    151
    152 // Final check of register 0x40
    153 {
    154 u8 val = 0;
    155 struct i2c_msg msgs[2];
    156 u8 reg = 0x40;
    157 msgs[0].addr = client->addr; msgs[0].flags = 0; msgs[0].len = 1; msgs[0].buf = &reg;
    158 msgs[1].addr = client->addr; msgs[1].flags = I2C_M_RD; msgs[1].len = 1; msgs[1].buf = &val;
    159 i2c_transfer(client->adapter, msgs, 2);
    160 dev_info(&client->dev, "tp2855: streaming status: Reg 0x40=0x%02x\n", val);
    161 }
    162
    163 return 0;
    164 }
    165
    166 static int tp2855_stop_stream(struct tp2855 *tp2855)
    167 {
    168 struct i2c_client *client = tp2855->client;
    169
    170 tp2855_write_reg(client, 0x40, 0x08);
    171 tp2855_write_reg(client, 0x23, 0x02);
    172 dev_info(&client->dev, "tp2855: stream stopped\n");
    173
    174 return 0;
    175 }
    176
    177 static int tp2855_set_stream(struct v4l2_subdev *sd, int on)
    178 {
    179 struct tp2855 *tp2855 = to_tp2855(sd);
    180 struct i2c_client *client = tp2855->client;
    181 int ret = 0;
    182
    183 dev_info(&client->dev, "tp2855_set_stream: entry on=%d\n", on);
    184
    185 mutex_lock(&tp2855->mutex);
    186
    187 if (tp2855->streaming == on) {
    188 mutex_unlock(&tp2855->mutex);
    189 return 0;
    190 }
    191
    192 if (on) {
    193 ret = pm_runtime_resume_and_get(&client->dev);
    194 if (ret < 0) {
    195 dev_err(&client->dev, "tp2855: pm_runtime resume failed: %d\n", ret);
    196 goto err_unlock;
    197 }
    198 ret = tp2855_start_stream(tp2855);
    199 if (ret < 0) {
    200 pm_runtime_put(&client->dev);
    201 goto err_unlock;
    202 }
    203 } else {
    204 tp2855_stop_stream(tp2855);
    205 pm_runtime_put(&client->dev);
    206 }
    207
    208 tp2855->streaming = on;
    209
    210 err_unlock:
    211 mutex_unlock(&tp2855->mutex);
    212 dev_info(&client->dev, "tp2855_set_stream: exit ret=%d\n", ret);
    213 return ret;
    214 }
    215
    216 static int tp2855_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt)
    217 {
    218 struct tp2855 *tp2855 = to_tp2855(sd);
    219 const struct tp2855_mode *mode = &supported_modes[0];
    220 int i;
    221
    222 dev_info(&tp2855->client->dev, "tp2855_set_fmt: pad=%u which=%d code=0x%x\n",
    223 fmt->pad, fmt->which, fmt->format.code);
    224
    225 mutex_lock(&tp2855->mutex);
    226
    227 for (i = 0; i < ARRAY_SIZE(tp2855_formats); i++) {
    228 if (fmt->format.code == tp2855_formats[i])
    229 break;
    230 }
    231 if (i == ARRAY_SIZE(tp2855_formats))
    232 fmt->format.code = MEDIA_BUS_FMT_YUYV8_1X16;
    233
    234 fmt->format.width = mode->width;
    235 fmt->format.height = mode->height;
    236 fmt->format.field = V4L2_FIELD_NONE;
    237 fmt->format.colorspace = V4L2_COLORSPACE_SRGB;
    238 fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601;
    239 fmt->format.quantization = V4L2_QUANTIZATION_LIM_RANGE;
    240 fmt->format.xfer_func = V4L2_XFER_FUNC_709;
    241
    242 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
    243 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
    244 struct v4l2_mbus_framefmt *try_fmt = v4l2_subdev_get_try_format(sd, state, fmt->pad);
    245 if (try_fmt) *try_fmt = fmt->format;
    246 #endif
    247 } else {
    248 tp2855->bus_fmt = fmt->format.code;
    249 tp2855->cur_mode = mode;
    250 }
    251
    252 mutex_unlock(&tp2855->mutex);
    253 return 0;
    254 }
    255
    256 static int tp2855_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt)
    257 {
    258 struct tp2855 *tp2855 = to_tp2855(sd);
    259
    260 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
    261 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
    262 struct v4l2_mbus_framefmt *try_fmt = v4l2_subdev_get_try_format(sd, state, fmt->pad);
    263 if (try_fmt) fmt->format = *try_fmt;
    264 #endif
    265 return 0;
    266 }
    267
    268 mutex_lock(&tp2855->mutex);
    269 fmt->format.width = tp2855->cur_mode->width;
    270 fmt->format.height = tp2855->cur_mode->height;
    271 fmt->format.code = tp2855->bus_fmt;
    272 fmt->format.field = V4L2_FIELD_NONE;
    273 fmt->format.colorspace = V4L2_COLORSPACE_SRGB;
    274 fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601;
    275 fmt->format.quantization = V4L2_QUANTIZATION_LIM_RANGE;
    276 fmt->format.xfer_func = V4L2_XFER_FUNC_709;
    277 mutex_unlock(&tp2855->mutex);
    278
    279 return 0;
    280 }
    281
    282 static int tp2855_enum_mbus_code(struct v4l2_subdev *sd,
    283 struct v4l2_subdev_state *state,
    284 struct v4l2_subdev_mbus_code_enum *code)
    285 {
    286 if (code->index >= ARRAY_SIZE(tp2855_formats))
    287 return -EINVAL;
    288
    289 code->code = tp2855_formats[code->index];
    290 return 0;
    291 }
    292
    293 static int tp2855_enum_frame_size(struct v4l2_subdev *sd,
    294 struct v4l2_subdev_state *state,
    295 struct v4l2_subdev_frame_size_enum *fse)
    296 {
    297 if (fse->index >= ARRAY_SIZE(supported_modes))
    298 return -EINVAL;
    299
    300 fse->min_width = supported_modes[fse->index].width;
    301 fse->max_width = supported_modes[fse->index].width;
    302 fse->min_height = supported_modes[fse->index].height;
    303 fse->max_height = supported_modes[fse->index].height;
    304
    305 return 0;
    306 }
    307
    308 static int tp2855_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
    309 struct v4l2_mbus_config *cfg)
    310 {
    311 struct tp2855 *tp2855 = to_tp2855(sd);
    312
    313 cfg->type = V4L2_MBUS_CSI2_DPHY;
    314 cfg->bus.mipi_csi2.num_data_lanes = tp2855->nlanes;
    315 cfg->bus.mipi_csi2.flags = 0;
    316
    317 return 0;
    318 }
    319
    320 static const struct v4l2_subdev_pad_ops tp2855_subdev_pad_ops = {
    321 .enum_mbus_code = tp2855_enum_mbus_code,
    322 .enum_frame_size = tp2855_enum_frame_size,
    323 .get_fmt = tp2855_get_fmt,
    324 .set_fmt = tp2855_set_fmt,
    325 .get_mbus_config = tp2855_g_mbus_config,
    326 };
    327
    328 static int tp2855_initialize_controls(struct tp2855 *tp2855)
    329 {
    330 struct v4l2_ctrl_handler *handler = &tp2855->ctrl_handler;
    331
    332 v4l2_ctrl_handler_init(handler, 2);
    333 v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, 0, 0, link_freq_items);
    334 tp2855->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, 0, 148500000, 1, 148500000);
    335 tp2855->subdev.ctrl_handler = handler;
    336
    337 return handler->error;
    338 }
    339
    340 static const struct v4l2_subdev_video_ops tp2855_video_ops = {
    341 .s_stream = tp2855_set_stream,
    342 };
    343
    344 static const struct v4l2_subdev_ops tp2855_subdev_ops = {
    345 .video = &tp2855_video_ops,
    346 .pad = &tp2855_subdev_pad_ops,
    347 };
    348
    349 static int tp2855_probe(struct i2c_client *client)
    350 {
    351 struct device *dev = &client->dev;
    352 struct tp2855 *tp2855;
    353 struct v4l2_subdev *sd;
    354 int ret, i;
    355
    356 dev_info(dev, "tp2855: probing start (v5 - simplified pads)...\n");
    357
    358 tp2855 = devm_kzalloc(dev, sizeof(*tp2855), GFP_KERNEL);
    359 if (!tp2855) return -ENOMEM;
    360
    361 tp2855->client = client;
    362 tp2855->cur_mode = &supported_modes[0];
    363 tp2855->bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16;
    364 mutex_init(&tp2855->mutex);
    365
    366 {
    367 struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = V4L2_MBUS_CSI2_DPHY };
    368 struct fwnode_handle *endpoint = fwnode_graph_get_next_endpoint(dev_fwnode(dev), NULL);
    369 if (endpoint) {
    370 ret = v4l2_fwnode_endpoint_parse(endpoint, &bus_cfg);
    371 if (!ret) tp2855->nlanes = bus_cfg.bus.mipi_csi2.num_data_lanes;
    372 fwnode_handle_put(endpoint);
    373 } else {
    374 tp2855->nlanes = 4;
    375 }
    376 }
    377
    378 tp2855->xvclk = devm_clk_get(dev, "xvclk");
    379 if (!IS_ERR(tp2855->xvclk)) clk_prepare_enable(tp2855->xvclk);
    380
    381 tp2855->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
    382 if (!IS_ERR(tp2855->reset_gpio)) {
    383 gpiod_set_value_cansleep(tp2855->reset_gpio, 1);
    384 usleep_range(10000, 11000);
    385 gpiod_set_value_cansleep(tp2855->reset_gpio, 0);
    386 }
    387
    388 sd = &tp2855->subdev;
    389 v4l2_i2c_subdev_init(sd, client, &tp2855_subdev_ops);
    390 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
    391 sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
    392
    393 for (i = 0; i < PAD_MAX; i++) tp2855->pads[i].flags = MEDIA_PAD_FL_SOURCE;
    394 media_entity_pads_init(&sd->entity, PAD_MAX, tp2855->pads);
    395
    396 tp2855_initialize_controls(tp2855);
    397
    398 pm_runtime_set_active(dev);
    399 pm_runtime_enable(dev);
    400 pm_runtime_idle(dev);
    401
    402 ret = v4l2_async_register_subdev_sensor(sd);
    403 if (!ret) dev_info(dev, "tp2855: probe succeeded (v5)!\n");
    404
    405 return ret;
    406 }
    407
    408 static void tp2855_remove(struct i2c_client *client)
    409 {
    410 struct v4l2_subdev *sd = i2c_get_clientdata(client);
    411 struct tp2855 *tp2855 = to_tp2855(sd);
    412
    413 v4l2_async_unregister_subdev(sd);
    414 v4l2_ctrl_handler_free(&tp2855->ctrl_handler);
    415 pm_runtime_disable(&client->dev);
    416 mutex_destroy(&tp2855->mutex);
    417 }
    418
    419 static const struct i2c_device_id tp2855_id[] = { { "tp2855", 0 }, { } };
    420 MODULE_DEVICE_TABLE(i2c, tp2855_id);
    421
    422 static const struct of_device_id tp2855_of_match[] = { { .compatible = "tp2855" }, { } };
    423 MODULE_DEVICE_TABLE(of, tp2855_of_match);
    424
    425 static struct i2c_driver tp2855_i2c_driver = {
    426 .driver = { .name = "tp2855", .of_match_table = tp2855_of_match },
    427 .probe_new = tp2855_probe,
    428 .remove = tp2855_remove,
    429 .id_table = tp2855_id,
    430 };
    431
    432 module_i2c_driver(tp2855_i2c_driver);
    433 MODULE_AUTHOR("Vicent Chi / Optimized for AM62");
    434 MODULE_DESCRIPTION("tp2855 sensor driver v5");
    435 MODULE_LICENSE("GPL v2");
    436

  • Hi Paul

    2)  - Test1: Camera 1 -> TP2855-> CSI2Rx AM63 -> Frambuffer LCD

          Able to see a few white color bars on the screen/LCD.

          Look abnormal and photo is here: (https://drive.google.com/file/d/1wG2kZNXCAE-0bSQ2h383AIbzMZ4Lf_0f/view?usp=sharing)

         - Test2:  TP2855 issue color bar -> CSI2Rx AM63 -> Frambuffer LCD
           root@am62xx-evm:~# i2cset -f -y 1 0x44 0x40 0x00
           root@am62xx-evm:~# i2cset -f -y 1 0x44 0x2A 0x38

          Able to see clear/clean solid color bar on screen/LCD

          Look normal and photo is here: (https://drive.google.com/file/d/1qCTzOa43qtBxkNG8bPEBD10JgOZhTBJV/view?usp=sharing)

    Can you please clarify if in Test2, the data stream is coming from the camera or not?

    Please share the value of the following registers, for both the test cases, while the stream is running :
    info_irqs 0x30101020
    error_irqs 0x30101028
    stream0_status 0x30101104
    dphy_status 0x30101048

    Also, please set the link frequency in the csi2rx endpoint as well. In the device tree that you shared, is is commented out. It should also be the same between both the tp2855 and cdns_csi2rx node.

    Regards,
    Jay

  • Hi Jay

    I would like to clearify below:

    [

    Test 1: "We connected a camera physically to the board."

    In Test 1, when we cover the camera or move the camera around, we can see the gray/white color bars on the LCD screen change (becoming darker or brighter). This indicates that a camera data stream is being input to the system.

    ]

    Test 2: "We unplugged the camera and physically removed it."

    In Test 2, we configured the Techpoint TP2855 video decoder to output a test color bar pattern to the Texas Instruments AM62 SoC by writing to the TP2855 registers using I²C commands. As a result, we were able to see solid color bars on the LCD screen.This confirms that no camera data stream is coming from the camera, because there is no physical connection between the camera and our board.

    Test1 register values while streaming:

    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffffbb5d1000.
    Read at address 0x30101020 (0xffffbb5d1020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffff81d46000.
    Read at address 0x30101028 (0xffff81d46028): 0x00020100
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffff7fcae000.
    Read at address 0x30101104 (0xffff7fcae104): 0x80000133
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffff9b2dc000.
    Read at address 0x30101048 (0xffff9b2dc048): 0x00222206

    Test2 register values while streaming:

    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffff96892000.
    Read at address 0x30101020 (0xffff96892020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffff9dbd7000.
    Read at address 0x30101028 (0xffff9dbd7028): 0x00020110
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffffaa704000.
    Read at address 0x30101104 (0xffffaa704104): 0x80000133
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffff9379b000.
    Read at address 0x30101048 (0xffff9379b048): 0x00222206
    root@am62xx-evm:~#

    For the link frequency setting, I set all to 297000000 now, we will build and share new test results next Monday. Thank for your comment. 

    In TP2855 driver code. 

    #define TP2855_LINK_FREQ_594M           (594000000UL >> 1)

    In DTS:

    tp2855_clk: clk_tp2855 {
                    #clock-cells = <0>;
                    compatible = "fixed-clock";
                    clock-frequency = <27000000>;
            };
    
    techpoint: tp2855@44 {
                    compatible = "tp2855";
                    status = "okay";
                    reg = <0x44>;
                    clocks = <&tp2855_clk>;
                    clock-names = "xvclk";
                    pinctrl-names = "default";
                    pinctrl-0 = <&csi2mcugpio0_pins_default>;
                    reset-gpios = <&mcu_gpio0 8 GPIO_ACTIVE_LOW>;
                    interrupt-parent = <&mcu_gpio0>;
                    interrupts = <7 IRQ_TYPE_EDGE_FALLING>;  //IRQ_TYPE_EDGE_FALLING
                    irq-gpios = <&mcu_gpio0 7 GPIO_ACTIVE_LOW>; //IRQ_TYPE_EDGE_FALLING
                    irq-flags = <2>;
                    port {
                            csi2_cam0: endpoint {
                                    remote-endpoint = <&csi2rx0_in_sensor>;
                                    clock-lanes = <0>;
                                    data-lanes = <1 2 3 4>; /* Support 4 cameras */
                                    link-frequencies = /bits/ 64 <297000000>; /* Match driver supported modes */
                            };
                    };
            };
    
    
    &cdns_csi2rx0 {
        status = "okay";
        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";
            csi0_port0: port@0 {
                reg = <0>;
                status = "okay";
    
                csi2rx0_in_sensor: endpoint {
                    remote-endpoint = <&csi2_cam0>;
                    bus-type = <4>; /* CSI2 DPHY. */
                    clock-lanes = <0>;
                    link-frequencies = /bits/ 64 <297000000>;
                    data-lanes = <1 2 3 4>; /* data-lanes = < 1 2 3 4 >  */
                };
            };
        };
    };
    
    &ti_csi2rx0 {
            status = "okay";
    };
    
    &dphy0 {
            status = "okay";
    };
    
    &dss {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&main_dss0_pins_default>;
    };
    

    Below is full log, both Test1 and Test 2:

    U-Boot 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    DRAM:  2 GiB
    Core:  69 devices, 30 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    SD/MMC found on device 1
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    OK
    
    root@am62xx-evm:~# media-ctl -d /dev/media0 -r
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"tp2855 1-0044":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"30102000.ticsi2rx":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY
    media-ctl -proot@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 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]
    
    - entity 7: 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]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256621] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351536] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.491556] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.491636] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.491644] tp2855 1-0044: using device tree for GPIO lookup
    [    5.491671] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.502947] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.503893] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   38.125636] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    root@am62xx-evm:~# echo "this is Test1, no camera connected"
    this is Test1, no camera connected
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! fbdevsink > gst.log 2>&1 &
    [1] 681
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256621] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351536] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.491556] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.491636] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.491644] tp2855 1-0044: using device tree for GPIO lookup
    [    5.491671] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.502947] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.503893] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   38.125636] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    [   95.982970] tp2855 1-0044: tp2855_set_stream: entry on=1
    [   95.983012] tp2855 1-0044: tp2855: starting stream, writing init regs
    [   96.024098] tp2855 1-0044: tp2855: streaming status: Reg 0x40=0x08
    [   96.024556] tp2855 1-0044: tp2855_set_stream: exit ret=0
    root@am62xx-evm:~# set TP2855 issue color bar pattern
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x40 0x00
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x2A 0x38
    root@am62xx-evm:~#
    root@am62xx-evm:~# on screen/lcd now, it shows half back and another half green solid color bar
    -sh: on: command not found
    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffffbb5d1000.
    Read at address  0x30101020 (0xffffbb5d1020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffff81d46000.
    Read at address  0x30101028 (0xffff81d46028): 0x00020100
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffff7fcae000.
    Read at address  0x30101104 (0xffff7fcae104): 0x80000133
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffff9b2dc000.
    Read at address  0x30101048 (0xffff9b2dc048): 0x00222206
    root@am62xx-evm:~#
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.491556] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.491636] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.491644] tp2855 1-0044: using device tree for GPIO lookup
    [    5.491671] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.502947] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.503893] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   38.125636] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    [   95.982970] tp2855 1-0044: tp2855_set_stream: entry on=1
    [   95.983012] tp2855 1-0044: tp2855: starting stream, writing init regs
    [   96.024098] tp2855 1-0044: tp2855: streaming status: Reg 0x40=0x08
    [   96.024556] tp2855 1-0044: tp2855_set_stream: exit ret=0
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256621] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351536] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# reboot
    [  329.352124] [gtp_shutdown:1945]
    [  329.358406] reboot: Restarting system
    
    U-Boot SPL 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 00:42:57, Jan 13 2023
    
    
    U-Boot 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    DRAM:  2 GiB
    Core:  69 devices, 30 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    SD/MMC found on device 1
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    OK
    
    root@am62xx-evm:~# media-ctl -d /dev/media0 -r
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"tp2855 1-0044":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"30102000.ticsi2rx":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY
    media-ctl -p
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 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]
    
    - entity 7: 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]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256829] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351577] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.472350] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.472447] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.472453] tp2855 1-0044: using device tree for GPIO lookup
    [    5.472488] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.482989] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.483983] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   29.766947] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! fbdevsink > gst.log 2>&1 &
    [1] 683
    root@am62xx-evm:~# cat gst.log
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    root@am62xx-evm:~# cat gst.log
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    root@am62xx-evm:~# cat gst.log
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    root@am62xx-evm:~# On screen now, there 2 white color bar, when we use hour hand to cover camera, the gray color in the color bar changing a bit harder white.
    -sh: On: command not found
    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffff96892000.
    Read at address  0x30101020 (0xffff96892020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffff9dbd7000.
    Read at address  0x30101028 (0xffff9dbd7028): 0x00020110
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffffaa704000.
    Read at address  0x30101104 (0xffffaa704104): 0x80000133
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffff9379b000.
    Read at address  0x30101048 (0xffff9379b048): 0x00222206
    root@am62xx-evm:~# then, we unpluged camera, on the LCD , the gray clor bar dispeared slowly
    -sh: then,: command not found
    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffff94561000.
    Read at address  0x30101020 (0xffff94561020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffff9760e000.
    Read at address  0x30101028 (0xffff9760e028): 0x00020110
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffffa4132000.
    Read at address  0x30101104 (0xffffa4132104): 0x80000133
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffffbd8c8000.
    Read at address  0x30101048 (0xffffbd8c8048): 0x00333306
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.472350] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.472447] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.472453] tp2855 1-0044: using device tree for GPIO lookup
    [    5.472488] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.482989] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    5.483983] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [   29.766947] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    [   71.804826] tp2855 1-0044: tp2855_set_stream: entry on=1
    [   71.804866] tp2855 1-0044: tp2855: starting stream, writing init regs
    [   71.875891] tp2855 1-0044: tp2855: streaming status: Reg 0x40=0x08
    [   71.876376] tp2855 1-0044: tp2855_set_stream: exit ret=0
    root@am62xx-evm:~# dmesg | grep csi
    [    0.256829] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351577] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# cat
    --set-fmt-video=width=1920,height=1080,pixelformat=YUYV  --stream-mmap                                            .bash_history                                            gst.log
    --stream-count=1                                         --stream-to=frame.raw                                    .cache/                                                  test.raw
    root@am62xx-evm:~# cat gst.log
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    

  • Hi Paul,

    The second test suggests that the stream from TP2855 -> CSI is fine. In that case, it might be worthwhile to look at the configuration from sensor -> TP2855.

    But, one interesting point that should be noted is that there are malformed packets coming from the decoder(in test2). You are seeing CRC errors(value of error_irq register):

    It could be a potential link frequency issue, if you are using more than one sensor streams. As a test, you could try increasing the link frequency and see if the sensor output stabilizes.

    Regards,
    Jay

  • Hi Jay

    Is it possible that this issue is caused by the packet or bus format? E.g YUYV8_1X16 vs YUYV8_2X8, etc
     static const struct tp2855_mode supported_modes[] = {
        {
            .bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16,
            .width = 1920,
            .height = 1080,
            .max_fps = { .numerator = 1, .denominator = 25 },
            .global_reg_list = common_setting_594M_1080p_25fps_regs,
            .mipi_freq_idx = 0,
            .bpp = 8,
        },
    };

    May you guide us on how to debug the malformed packets received by the SoC?

    Again: Test1 (a Camera connected), we try the link frequency setting 297000000 or 594000000 but the result is the same.

    Below we try to set to 594000000 and view a camera (ony one camera is physically connected to the board)

    Test 1 Full log:

    root@am62xx-evm:~# dmesg | grep csi
    [    0.256585] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351461] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.915259] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.915338] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.915345] tp2855 1-0044: using device tree for GPIO lookup
    [    5.915374] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.926858] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    6.071994] tp2855 1-0044: tp2855: probe succeeded (v5)!
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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/640x480 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/640x480 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]
    
    - entity 7: 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"tp2855 1-0044":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"30102000.ticsi2rx":0 [fmt:UYVY8_1X16/1920x1080 field:none]'
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 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]
    
    - entity 7: 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]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# dmesg | grep tp2855
    [    5.915259] tp2855 1-0044: tp2855: probing start (v5 - simplified pads)...
    [    5.915338] tp2855 1-0044: GPIO lookup for consumer reset
    [    5.915345] tp2855 1-0044: using device tree for GPIO lookup
    [    5.915374] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/bus@f0000/i2c@20010000/tp2855@44[0]' - status (0)
    [    5.926858] tp2855 1-0044: Consider updating driver tp2855 to match on endpoints
    [    6.071994] tp2855 1-0044: tp2855: probe succeeded (v5)!
    [  132.818893] tp2855 1-0044: tp2855_set_fmt: pad=0 which=1 code=0x200f
    root@am62xx-evm:~# dmesg | grep  csi
    [    0.256585] i2c 1-0044: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
    [    0.351461] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 4/4 lanes, 4 streams, external D-PHY
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x40 0x08
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x28 0x00
    root@am62xx-evm:~# i2cset -f -y 1 0x44 0x21 0x12
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! fbdevsink > gst.log 2>&1 &
    [1] 758
    root@am62xx-evm:~# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffffa6147000.
    Read at address  0x30101020 (0xffffa6147020): 0x00000002
    root@am62xx-evm:~# devmem2 0x30101028
    /dev/mem opened.
    Memory mapped at address 0xffffba415000.
    Read at address  0x30101028 (0xffffba415028): 0x00020100
    root@am62xx-evm:~# devmem2 0x30101104
    /dev/mem opened.
    Memory mapped at address 0xffffa9dd3000.
    Read at address  0x30101104 (0xffffa9dd3104): 0x80000113
    root@am62xx-evm:~# devmem2 0x30101048
    /dev/mem opened.
    Memory mapped at address 0xffff88484000.
    Read at address  0x30101048 (0xffff88484048): 0x00333306
    
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --get-fmt-video
    Format Video Capture:
            Width/Height      : 3840/2160
            Pixel Format      : 'YUYV' (YUYV 4:2:2)
            Field             : None
            Bytes per Line    : 7680
            Size Image        : 16588800
            Colorspace        : sRGB
            Transfer Function : Rec. 709
            YCbCr/HSV Encoding: Rec. 709
            Quantization      : Limited Range
            Flags             :
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --all
    Driver Info:
            Driver name      : j721e-csi2rx
            Card type        : j721e-csi2rx
            Bus info         : platform:30102000.ticsi2rx
            Driver version   : 6.1.33
            Capabilities     : 0xa4200001
                    Video Capture
                    I/O MC
                    Streaming
                    Extended Pix Format
                    Device Capabilities
            Device Caps      : 0x24200001
                    Video Capture
                    I/O MC
                    Streaming
                    Extended Pix Format
    Media Driver Info:
            Driver name      : j721e-csi2rx
            Model            : TI-CSI2RX
            Serial           :
            Bus info         : platform:30102000.ticsi2rx
            Media version    : 6.1.33
            Hardware revision: 0x00000001 (1)
            Driver version   : 6.1.33
    Interface Info:
            ID               : 0x03000015
            Type             : V4L Video
    Entity Info:
            ID               : 0x00000013 (19)
            Name             : 30102000.ticsi2rx context 0
            Function         : V4L2 I/O
            Pad 0x01000014   : 0: Sink
              Link 0x02000017: from remote pad 0x1000003 of entity '30102000.ticsi2rx' (Video Interface Bridge): Data, Enabled, Immutable
    Priority: 2
    Video input : 0 (30102000.ticsi2rx context 0: ok)
    Format Video Capture:
            Width/Height      : 3840/2160
            Pixel Format      : 'YUYV' (YUYV 4:2:2)
            Field             : None
            Bytes per Line    : 7680
            Size Image        : 16588800
            Colorspace        : sRGB
            Transfer Function : Rec. 709
            YCbCr/HSV Encoding: Rec. 709
            Quantization      : Limited Range
            Flags             :
    root@am62xx-evm:~#
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [1]: 'UYVY' (UYVY 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [2]: 'YVYU' (YVYU 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [3]: 'VYUY' (VYUY 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
    root@am62xx-evm:~#
    
    

    Test1 Demo: It seems camera data is inputing. 

  • Hi Paul,

    I am afraid I can't help much because, the TP2855 -> CSI2RX link is validated using the other test case(TP2855 test pattern).

    Here are a few things that I would recommend though:
    1. I don't see the sensor in your media graph? Is it always streaming? Could that be causing issues with TP2855 hardware
    2. Have you been able to validate the sensor -> TP2855 link in some way, where you can confirm that the data being received by the decoder is correct?
    3. Please have a look at the registers for TP2855 to see if that is reporting any errors.

    The basic rationale is to figure out where the error originates from.

    Regards,
    Jay

  • Hi Jay

    Thank for your support.

    We will try to confirm the input/out of front end nodes (cam->tp2855) first. Then we will reach you later. 

    (FYI, after modifying registers for TP2855, we are able to see some small part of real image of camera on screen now

    oot@am62xx-evm:~# devmem2 0x30101020

    /dev/mem opened.

    Memory mapped at address 0xffff97cc7000.

    Read at address  0x30101020 (0xffff97cc7020): 0x00000032

    root@am62xx-evm:~# devmem2 0x30101028

    /dev/mem opened.

    Memory mapped at address 0xffff9b068000.

    Read at address  0x30101028 (0xffff9b068028): 0x00021930

    root@am62xx-evm:~# devmem2 0x30101104

    /dev/mem opened.

    Memory mapped at address 0xffff8dcbb000.

    Read at address  0x30101104 (0xffff8dcbb104): 0x80000133

    root@am62xx-evm:~# devmem2 0x30101048

    /dev/mem opened.

    Memory mapped at address 0xffff9914a000.

    Read at address  0x30101048 (0xffff9914a048): 0x00333306

    ).

  • Hi Paul,

    This is good news. This could indicate some configuration issue. Can you let me know what the registers you changed do?

    Also, the error IRQ value indicates that there is some CRC and ECC errors being encountered:

    Please reply here if you need further help.

    Regards,
    Jay

  • Hi Jay

    We are guided to configure/adjust below register, howeverwe may still face timing issue (log shows: A lot of buffers are being dropped.) between the decoder and MIPI Rx (TI AM62x_'s CSI2Rx)

    Register Default value TPI driver value MIPI standard timing value
    0x25 0x04 0x04 0x03(min)
    0x26 0x06 0x03 0x02(min)~0x05(max)
    0x27 0x03 0x09 0x08(min)
    0x28 0x18 0x18(default) 0x18(default)
    0x29 0x02 0x02 0x18(default)

    Some time (ramdonly) we could see a full image of real camera show out on LCD, sometime it split into two-part, or black green, etc as below:

    Log:

    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720 ! videoconvert ! fbdevsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Redistribute latency...
    WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of buffers are being dropped.
    Additional debug info:
    ../gstreamer-1.20.6/libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0:
    There may be a timestamping problem, or this computer is too slow.
    0:00:01.4 / 99:99:99.

    ----------------

    FYI, our camera spec (till now, we tested only 1 camera)

    1) Target setting for Our 4-Camera, 4-Lane 

    • AHD 720P,  
    • HD30,     //720p30 
    • STD_HDA,  //AHD 
    • MIPI_4CH4LANE_297M,  //up to 4x720p 30fps

    2) DTS:  link-frequencies = /bits/ 64 <594000000>; 

    3) Pixel_rate in TP2855 driver: 

    #define TP2855_PIXEL_RATE 110592000 /* 4CAM * (1290*720@30fps = 27.648Mhz) = 110.592MHz */

    tp2855->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, 0, TP2855_PIXEL_RATE, 1, TP2855_PIXEL_RATE);

  • Hi Paul,

    I am not sure what the I2C writes accomplish. Can you provide what changes these register writes do?

    The primary issue with your calculation is that it doesn't account for overhead. I would suggest taking around 25% overhead in your case. This might just be a link frequency problem. What I would suggest is to derive the pixel_rate with overhead and derive the link frequency using that.

    link_frequency = (pixel_rate * bpp) / (2 * num_lanes)

    In your case, bpp is 16(YUY2 format) and num_lanes is 4.

    Regards,
    Jay

  • Hi Jay

    The registers are about setting MIPI output timing from TP2855; Tx.

    i2cset -f -y 1 0x44 0x40 0x08 # select page (0x08 MIPI page), 0x44 is TP2855 address
    i2cset -f -y 1 0x44 0x25 0x03
    i2cset -f -y 1 0x44 0x26 0x02
    i2cset -f -y 1 0x44 0x27 0x08
    i2cset -f -y 1 0x44 0x28 0x18
    i2cset -f -y 1 0x44 0x29 0x18

    Our latest test, we try to set the given MIPI standard timing value but still failed; only green/black screen shows out.

    We are suggested to check/adjust the same timing for both Tx and Rx (AM62x). 

    Any registers that we can set or read out to confirm those timing of AM62x? Or any suggestion, please let me know. Thanks.

    "Regarding MIPI timing in the MIPI RX (AP), you will be able to adjust the T_TERM value as follows.

    Generally, you can adjust the prepare timing regarding MIPI timing between MIPI TX and MIPI RX.

    If you look below for the AP MIPI RX, it appears that you can adjust the (T3-PREPARE + T3-PREBEGIN value  = T_TERM)."

  • Hi Paul,

    gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720 ! videoconvert ! fbdevsink

    There are a few issues with the pipeline itself.

    1. Please use kmssink with sync=true instead of fbdevsink
    2. videoconvert is a software implementation of the color conversion. It might be inefficient.

    Here are a couple of debugging steps that I would like to do (ruling out issues further down the pipeline) before we move further with a debug on the CSI side:

    1. Can you do a frame capture using yavta, save the frames to a file and see if the resulting frames are incorrect? This will isolate the issue just to CSI. Example command:

    yavta -s 1280x720 -f UYVY -Fframe-#.yuv /dev/video0

    2. Please run this pipeline to see some statistics being printed and see if the display side could be an issue. If there is an issue upstream, you will see buffer drops here as well:

    gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720 ! fpsdisplaysink text-overlay=false name=fpssink video-sink="kmssink sync=false" sync=false -v

    3. A command to test if the display itself is working fine. Just see if the output looks correct:

    kmscube
    kmstest --flip

    4. If videoconvert is necessary, you can use ticolorconvert node instead.

    5. Please replace fbdevsink with kmssink sync=false

    If the first test itself fails, there is definitely a CSI issue. For further correspondence, please use yavta. This will only use the CSI peripheral and make debugging simpler.

    Regards,
    Jay

  • Hi Jay, 

    (we build OS image with tisdk-base-image option. So kmscube, modetest CMD are not available, we will build with tisdk-default-image option for weston, etc and test again).

    We'd like to share all output logs about your debug comments as below.

    all_log_20260403.txt

    1. kmstest--flip CMD output:

    2. Output of  gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=10/1 ! videoconvert ! fbdevsink  

    Change framerate=30/1 => framerate=10/1

     

  • Hi Paul,

    The kmstest result shows that the display is fine. My primary concern is that the pipeline is doing a CPU copy instead of going through the DMA

    Can you do a frame capture using yavta, save the frames to a file and see if the resulting frames are incorrect? This will isolate the issue just to CSI. Example command:

    Can you try this? Or use v4l2-ctl for capturing data? This will only use the CSI capture and we can see if the issue is because of that.

    Regards,
    Jay

  • Hi Jay

    Below is our latest update: (old board/camera we were failed to capture camera image; only green color was shown)

    1. We use another/replace new custom board; more stable output regarding to the test pattern (color bar) that outputs from TP2855 to AM62x.

    2. We also use/replace another camera (TVI 720P , not AHD 720P )

    The camera output appears to be in slow motion. Please refer to the capture/replay test results below in detail.

    Current status:

    • Camera → (Rx) TP2855: We have confirmed that the TVI camera input is correct based on register values and the image displayed on the LCD.
    • TP2855 (Tx) <-->(Rx) AM62x: We suspect this may be related to a MIPI timing issue (as mentioned in the previous comment regarding T_TERM).

    Could you please guide us on how to configure and verify the MIPI timing from the AM62x side?

    Note:
    For the TP2855, only three register values are available for timing adjustment.

    ------------------------------------------------------------------------------------------------------------------------------

    Tests' output: (using gst, v4l3, and yavta cmd, we can see real camera image but just abnormal)

    1. KMSTEST

    root@am62xx-evm:~# kmstest
    Connector 0/@40: DPI-1
    Crtc 0/@38: 800x480@46.90 26.000 800/40/128/88/+ 480/10/2/33/+ 47 (46.90) 0x5 0x48
    Plane 0/@31: 0,0-800x480
    Fb 50 800x480-XR24
    press enter to exit

    2. Captured by yavta and v4l2 cmd log:

     

    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=150 --stream-to=v4l2_video_5s.yuv
    <<<<<<<<<<<<<<<<<<< 17.32 fps
    <<<<<<<<<<<<<<<< 16.95 fps
    <<<<<<<<<<<<<<<< 16.63 fps
    <<<<<<<<<<<<<<<<< 16.59 fps
    <<<<<<<<<<<<<<<< 16.47 fps
    <<<<<<<<<<<<<<<< 16.39 fps
    <<<<<<<<<<<<<<<<< 16.40 fps
    <<<<<<<<<<<<<<< 16.36 fps
    <<<<<<<<<<<<<<<< 16.32 fps
    <<
    root@am62xx-evm:~# ls
    v4l2_video_5s.yuv
    root@am62xx-evm:~# ls -lh
    -rw-r--r--    1 root     root      263.7M Apr  8 01:41 v4l2_video_5s.yuv
    root@am62xx-evm:~#
    root@am62xx-evm:~# yavta -c150 -f YUYV -s 1280x720 --file=yavta_video_5s.yuv /dev/video0
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    8 buffers requested.
    length: 1843200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffb1dee000.
    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffffb1c2c000.
    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffffb1a6a000.
    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffffb18a8000.
    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffffb16e6000.
    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffffb1524000.
    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffffb1362000.
    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffffb11a0000.
    0 (0) [-] any 0 1843200 B 60.518168 60.518224 173.883 fps ts mono/EoF
    1 (1) [-] any 1 1843200 B 60.526709 60.576268 117.082 fps ts mono/EoF
    2 (2) [-] any 2 1843200 B 60.592919 60.631353 15.103 fps ts mono/EoF
    3 (3) [-] any 3 1843200 B 60.676677 60.685596 11.939 fps ts mono/EoF
    4 (4) [-] any 4 1843200 B 60.718886 60.740452 23.692 fps ts mono/EoF
    5 (5) [-] any 5 1843200 B 60.718962 60.795028 13157.895 fps ts mono/EoF
    6 (6) [-] any 6 1843200 B 60.992926 60.993050 3.650 fps ts mono/EoF
    7 (7) [-] any 7 1843200 B 61.076410 61.076460 11.978 fps ts mono/EoF
    8 (0) [-] any 8 1843200 B 61.118933 61.140583 23.517 fps ts mono/EoF
    9 (1) [-] any 9 1843200 B 61.119019 61.195211 11627.907 fps ts mono/EoF
    10 (2) [-] any 10 1843200 B 61.202705 61.250110 11.949 fps ts mono/EoF
    11 (3) [-] any 11 1843200 B 61.393154 61.393921 5.251 fps ts mono/EoF
    12 (4) [-] any 12 1843200 B 61.476553 61.476594 11.991 fps ts mono/EoF
    13 (5) [-] any 13 1843200 B 61.518906 61.531243 23.611 fps ts mono/EoF
    14 (6) [-] any 14 1843200 B 61.518985 61.586118 12658.228 fps ts mono/EoF
    15 (7) [-] any 15 1843200 B 61.729872 61.729911 4.742 fps ts mono/EoF
    16 (0) [-] any 16 1843200 B 61.792831 61.792858 15.883 fps ts mono/EoF
    17 (1) [-] any 17 1843200 B 61.918875 61.918930 7.934 fps ts mono/EoF
    18 (2) [-] any 18 1843200 B 62.129995 62.130040 4.737 fps ts mono/EoF
    19 (3) [-] any 19 1843200 B 62.192801 62.192832 15.922 fps ts mono/EoF
    20 (4) [-] any 20 1843200 B 62.235719 62.247901 23.300 fps ts mono/EoF
    21 (5) [-] any 21 1843200 B 62.318960 62.318999 12.013 fps ts mono/EoF
    22 (6) [-] any 22 1843200 B 62.530227 62.531009 4.733 fps ts mono/EoF
    23 (7) [-] any 23 1843200 B 62.592830 62.598400 15.974 fps ts mono/EoF
    24 (0) [-] any 24 1843200 B 62.635491 62.653260 23.441 fps ts mono/EoF
    25 (1) [-] any 25 1843200 B 62.719113 62.719145 11.959 fps ts mono/EoF
    26 (2) [-] any 26 1843200 B 62.909723 62.909866 5.246 fps ts mono/EoF
    27 (3) [-] any 27 1843200 B 62.992942 62.992984 12.016 fps ts mono/EoF
    28 (4) [-] any 28 1843200 B 63.035448 63.047887 23.526 fps ts mono/EoF
    29 (5) [-] any 29 1843200 B 63.119254 63.119297 11.932 fps ts mono/EoF
    30 (6) [-] any 30 1843200 B 63.309363 63.309398 5.260 fps ts mono/EoF
    31 (7) [-] any 31 1843200 B 63.393051 63.393092 11.949 fps ts mono/EoF
    32 (0) [-] any 32 1843200 B 63.435438 63.452511 23.592 fps ts mono/EoF
    33 (1) [-] any 33 1843200 B 63.709370 63.709430 3.651 fps ts mono/EoF
    34 (2) [-] any 34 1843200 B 63.835394 63.835435 7.935 fps ts mono/EoF
    35 (3) [-] any 35 1843200 B 63.835462 63.890325 14705.882 fps ts mono/EoF
    36 (4) [-] any 36 1843200 B 64.109392 64.109532 3.651 fps ts mono/EoF
    37 (5) [-] any 37 1843200 B 64.151970 64.170474 23.486 fps ts mono/EoF
    38 (6) [-] any 38 1843200 B 64.152402 64.224759 2314.815 fps ts mono/EoF
    39 (7) [-] any 39 1843200 B 64.235516 64.279058 12.032 fps ts mono/EoF
    40 (0) [-] any 40 1843200 B 64.509320 64.509381 3.652 fps ts mono/EoF
    41 (1) [-] any 41 1843200 B 64.635480 64.635520 7.926 fps ts mono/EoF
    42 (2) [-] any 42 1843200 B 64.909320 64.909462 3.652 fps ts mono/EoF
    43 (3) [-] any 43 1843200 B 64.992843 64.992886 11.973 fps ts mono/EoF
    44 (4) [-] any 44 1843200 B 65.035334 65.047816 23.534 fps ts mono/EoF
    45 (5) [-] any 45 1843200 B 65.309255 65.309292 3.651 fps ts mono/EoF
    46 (6) [-] any 46 1843200 B 65.393032 65.393077 11.936 fps ts mono/EoF
    47 (7) [-] any 47 1843200 B 65.435242 65.447989 23.691 fps ts mono/EoF
    48 (0) [-] any 48 1843200 B 65.435321 65.502879 12658.228 fps ts mono/EoF
    49 (1) [-] any 49 1843200 B 65.709243 65.709293 3.651 fps ts mono/EoF
    50 (2) [-] any 50 1843200 B 65.835353 65.835433 7.930 fps ts mono/EoF
    51 (3) [-] any 51 1843200 B 65.835433 65.890880 12500.000 fps ts mono/EoF
    52 (4) [-] any 52 1843200 B 66.109232 66.109344 3.652 fps ts mono/EoF
    53 (5) [-] any 53 1843200 B 66.151907 66.180590 23.433 fps ts mono/EoF
    54 (6) [-] any 54 1843200 B 66.152302 66.235960 2531.646 fps ts mono/EoF
    55 (7) [-] any 55 1843200 B 66.235194 66.291263 12.064 fps ts mono/EoF
    56 (0) [-] any 56 1843200 B 66.235264 66.347113 14285.714 fps ts mono/EoF
    57 (1) [-] any 57 1843200 B 66.318866 66.402366 11.961 fps ts mono/EoF
    58 (2) [-] any 58 1843200 B 66.592536 66.592696 3.654 fps ts mono/EoF
    59 (3) [-] any 59 1843200 B 66.676228 66.676272 11.949 fps ts mono/EoF
    60 (4) [-] any 60 1843200 B 66.718512 66.731917 23.650 fps ts mono/EoF
    61 (5) [-] any 61 1843200 B 66.929590 66.929758 4.738 fps ts mono/EoF
    62 (6) [-] any 62 1843200 B 66.992521 66.992554 15.890 fps ts mono/EoF
    63 (7) [-] any 63 1843200 B 67.118563 67.118623 7.934 fps ts mono/EoF
    64 (0) [-] any 64 1843200 B 67.329480 67.329578 4.741 fps ts mono/EoF
    65 (1) [-] any 65 1843200 B 67.329603 67.389268 8130.081 fps ts mono/EoF
    66 (2) [-] any 66 1843200 B 67.392489 67.444155 15.902 fps ts mono/EoF
    67 (3) [-] any 67 1843200 B 67.435248 67.498923 23.387 fps ts mono/EoF
    68 (4) [-] any 68 1843200 B 67.518641 67.553450 11.991 fps ts mono/EoF
    69 (5) [-] any 69 1843200 B 67.518719 67.607693 12820.513 fps ts mono/EoF
    70 (6) [-] any 70 1843200 B 67.729463 67.729569 4.745 fps ts mono/EoF
    71 (7) [-] any 71 1843200 B 67.729581 67.784467 8474.576 fps ts mono/EoF
    72 (0) [-] any 72 1843200 B 67.792503 67.839415 15.893 fps ts mono/EoF
    73 (1) [-] any 73 1843200 B 67.835134 67.894198 23.457 fps ts mono/EoF
    74 (2) [-] any 74 1843200 B 67.918794 67.948691 11.953 fps ts mono/EoF
    75 (3) [-] any 75 1843200 B 67.918871 68.003078 12987.013 fps ts mono/EoF
    76 (4) [-] any 76 1843200 B 68.109109 68.109141 5.257 fps ts mono/EoF
    77 (5) [-] any 77 1843200 B 68.192647 68.192681 11.971 fps ts mono/EoF
    78 (6) [-] any 78 1843200 B 68.235056 68.247406 23.580 fps ts mono/EoF
    79 (7) [-] any 79 1843200 B 68.235140 68.302210 11904.762 fps ts mono/EoF
    80 (0) [-] any 80 1843200 B 68.318871 68.356981 11.943 fps ts mono/EoF
    81 (1) [-] any 81 1843200 B 68.509070 68.509118 5.258 fps ts mono/EoF
    82 (2) [-] any 82 1843200 B 68.592742 68.592783 11.951 fps ts mono/EoF
    83 (3) [-] any 83 1843200 B 68.635044 68.647536 23.640 fps ts mono/EoF
    84 (4) [-] any 84 1843200 B 68.635105 68.702285 16393.443 fps ts mono/EoF
    85 (5) [-] any 85 1843200 B 68.718840 68.757395 11.942 fps ts mono/EoF
    86 (6) [-] any 86 1843200 B 68.718913 68.811698 13698.630 fps ts mono/EoF
    87 (7) [-] any 87 1843200 B 68.929439 68.929493 4.750 fps ts mono/EoF
    88 (0) [-] any 88 1843200 B 68.992327 68.992355 15.901 fps ts mono/EoF
    89 (1) [-] any 89 1843200 B 69.075882 69.075917 11.968 fps ts mono/EoF
    90 (2) [-] any 90 1843200 B 69.118396 69.130651 23.522 fps ts mono/EoF
    91 (3) [-] any 91 1843200 B 69.201811 69.201839 11.988 fps ts mono/EoF
    92 (4) [-] any 92 1843200 B 69.201878 69.256662 14925.373 fps ts mono/EoF
    93 (5) [-] any 93 1843200 B 69.285514 69.311603 11.957 fps ts mono/EoF
    94 (6) [-] any 94 1843200 B 69.475655 69.475736 5.259 fps ts mono/EoF
    95 (7) [-] any 95 1843200 B 69.559268 69.559308 11.960 fps ts mono/EoF
    96 (0) [-] any 96 1843200 B 69.601643 69.614261 23.599 fps ts mono/EoF
    97 (1) [-] any 97 1843200 B 69.601726 69.669341 12048.193 fps ts mono/EoF
    98 (2) [-] any 98 1843200 B 69.875614 69.875696 3.651 fps ts mono/EoF
    99 (3) [-] any 99 1843200 B 69.959362 69.959399 11.941 fps ts mono/EoF
    100 (4) [-] any 100 1843200 B 70.001616 70.019231 23.666 fps ts mono/EoF
    101 (5) [-] any 101 1843200 B 70.001677 70.074209 16393.443 fps ts mono/EoF
    102 (6) [-] any 102 1843200 B 70.275653 70.275790 3.650 fps ts mono/EoF
    103 (7) [-] any 103 1843200 B 70.401655 70.401733 7.936 fps ts mono/EoF
    104 (0) [-] any 104 1843200 B 70.675604 70.675775 3.650 fps ts mono/EoF
    
    105 (1) [-] any 105 1843200 B 70.759154 84.015523 11.969 fps ts mono/EoF
    106 (2) [-] any 106 1843200 B 70.801625 84.073733 23.545 fps ts mono/EoF
    107 (3) [-] any 107 1843200 B 70.885392 84.128794 11.938 fps ts mono/EoF
    108 (4) [-] any 108 1843200 B 70.885519 84.183173 7874.016 fps ts mono/EoF
    109 (5) [-] any 109 1843200 B 71.075822 84.237524 5.255 fps ts mono/EoF
    110 (6) [-] any 110 1843200 B 71.159241 84.291899 11.988 fps ts mono/EoF
    111 (7) [-] any 111 1843200 B 71.201556 84.346932 23.632 fps ts mono/EoF
    112 (0) [-] any 112 1843200 B 84.084531 84.402006 0.078 fps ts mono/EoF
    113 (1) [-] any 113 1843200 B 84.294913 84.457146 4.753 fps ts mono/EoF
    114 (2) [-] any 114 1843200 B 84.295082 84.511878 5917.160 fps ts mono/EoF
    115 (3) [-] any 115 1843200 B 84.357976 84.566542 15.900 fps ts mono/EoF
    116 (4) [-] any 116 1843200 B 84.401059 84.621240 23.211 fps ts mono/EoF
    117 (5) [-] any 117 1843200 B 84.484144 84.675567 12.036 fps ts mono/EoF
    118 (6) [-] any 118 1843200 B 84.484214 84.730611 14285.714 fps ts mono/EoF
    119 (7) [-] any 119 1843200 B 84.694881 84.785509 4.747 fps ts mono/EoF
    120 (0) [-] any 120 1843200 B 84.695073 84.840216 5208.333 fps ts mono/EoF
    121 (1) [-] any 121 1843200 B 84.757990 84.895073 15.894 fps ts mono/EoF
    122 (2) [-] any 122 1843200 B 84.800677 84.949989 23.426 fps ts mono/EoF
    123 (3) [-] any 123 1843200 B 84.884250 85.004514 11.966 fps ts mono/EoF
    124 (4) [-] any 124 1843200 B 84.884315 85.058863 15384.615 fps ts mono/EoF
    125 (5) [-] any 125 1843200 B 85.095011 85.113529 4.746 fps ts mono/EoF
    126 (6) [-] any 126 1843200 B 85.095203 85.168474 5208.333 fps ts mono/EoF
    127 (7) [-] any 127 1843200 B 85.158059 85.223472 15.909 fps ts mono/EoF
    128 (0) [-] any 128 1843200 B 85.200663 85.278463 23.472 fps ts mono/EoF
    129 (1) [-] any 129 1843200 B 85.284365 85.333911 11.947 fps ts mono/EoF
    130 (2) [-] any 130 1843200 B 85.474575 85.474636 5.257 fps ts mono/EoF
    131 (3) [-] any 131 1843200 B 85.558249 85.558289 11.951 fps ts mono/EoF
    132 (4) [-] any 132 1843200 B 85.600581 85.613274 23.623 fps ts mono/EoF
    133 (5) [-] any 133 1843200 B 85.600666 85.668213 11764.706 fps ts mono/EoF
    134 (6) [-] any 134 1843200 B 85.874546 85.874606 3.651 fps ts mono/EoF
    135 (7) [-] any 135 1843200 B 86.000625 86.000674 7.932 fps ts mono/EoF
    136 (0) [-] any 136 1843200 B 86.274548 86.274684 3.651 fps ts mono/EoF
    137 (1) [-] any 137 1843200 B 86.400608 86.400690 7.933 fps ts mono/EoF
    138 (2) [-] any 138 1843200 B 86.400715 86.460315 9345.794 fps ts mono/EoF
    139 (3) [-] any 139 1843200 B 86.674565 86.674735 3.652 fps ts mono/EoF
    140 (4) [-] any 140 1843200 B 86.717216 86.739180 23.446 fps ts mono/EoF
    141 (5) [-] any 141 1843200 B 86.800766 86.800804 11.969 fps ts mono/EoF
    142 (6) [-] any 142 1843200 B 86.800839 86.855959 13698.630 fps ts mono/EoF
    143 (7) [-] any 143 1843200 B 87.074650 87.074740 3.652 fps ts mono/EoF
    144 (0) [-] any 144 1843200 B 87.117149 87.139099 23.530 fps ts mono/EoF
    145 (1) [-] any 145 1843200 B 87.117226 87.193670 12987.013 fps ts mono/EoF
    146 (2) [-] any 146 1843200 B 87.200941 87.248169 11.945 fps ts mono/EoF
    147 (3) [-] any 147 1843200 B 87.200995 87.302563 18518.519 fps ts mono/EoF
    148 (4) [-] any 148 1843200 B 87.328026 87.357228 7.872 fps ts mono/EoF
    149 (5) [-] any 149 1843200 B 87.391103 87.411731 15.854 fps ts mono/EoF
    Captured 150 frames in 26.899313 seconds (5.576351 fps, 10278329.267897 B/s).
    8 buffers released.
    root@am62xx-evm:~#
    root@am62xx-evm:~# ls -lh
    -rw-r--r--    1 root     root      263.7M Apr  8 01:41 v4l2_video_5s.yuv
    -rw-r--r--    1 root     root      263.7M Apr  8 01:44 yavta_video_5s.yuv
    root@am62xx-evm:~#

     Replay the captured v4l2 file:

     

     Replay the captured yavta file:

    Captured/replay by gstreamer:

  • Hi Paul,

    I have looped in some colleagues from the hardware team. One of us will try to respond to your thread in a couple of days.

    Regards,
    Jay

  • Hi Jay

    Thank you for your support. We are looking forward to get feedback from your hardware team soon.

    For your information, our AHD camera (12V) is now working. We identified the issue—it was caused by an incorrect connection to our board, which supplied overvoltage (>24V).

    Both AHD and TVI camera inputs are now functioning normally; however, they are still showing the same symptom.

  • Hi Paul,

    Can you clarify what symptom is still visible? Are the problems in the previous replies no longer present?

    Regards,
    Jay

  • Hi Paul,

    Please advise what the DPHY-TX side is configured to for the below parameters. I would like to confirm these are as per MIPI and fall within conformant values of the DPHY-RX side (AM62x).

    • TLPX
    • THS-PREPARE
    • THS-ZERO

    Best regards,

    Luis Parga

  • Hi Luis & Jay

    1. Below is the paremeters of DPHY-TX decoder side (HS Transmitter AC Characteristic)

     

    2. The current symptom remains the same as reported in our previous comment dated April 8th.

    We would like to share the results of a new test performed today on both cameras:

    a) The initial frames are displayed abnormally.
    b) The video then transitions into slow motion, etc.

    SW setting: (We try to config diff values but it produces the same symptom )

    - In tp2855 device driver: 
    static const struct tp2855_mode supported_modes[] = {
        {
            .bus_fmt = MEDIA_BUS_FMT_YUYV8_1X16,
            .width = 1280,
            .height = 720,
            .max_fps = { .numerator = 1, .denominator = 25 }, // 25 or 30
            .global_reg_list = common_setting_297_4ch_4lane_720p_30fps_regs,
            .mipi_freq_idx = 0,
            .bpp = 8,  //8 or 16
        },
    };
    tp2855->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, 0, 297000000, 1, 297000000); // or 148500000
    - In DTS: 
    link-frequencies = /bits/ 64 <297000000>;  // 297000000 or  594000000
    data-lanes = <1 2 3 4>; /* data-lanes = < 1 2 3 4 > */
    - View cmd ( as below, or add  ", framerate=30/1", "framerate=25/1" produce the same result)
    gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720 ! videoconvert ! fbdevsink

    TVI 702p 1280*720 Cam output:

    AHD 702p 1280*720 Cam output:

  • Thanks Paul,

    Aren't TLPX, THS-PREPARE, and THS-PREPARE + THS-ZERO programmable for the TPS2855? If so, what are these specifically programmed to? Have you tried other link frequencies? You can try for example a link frequency of 800MHz (data rate of 1.6Gbps), but we need to make sure both the TX and RX side are set to the same link frequency. Also, when the data rate is greater or equal to 1.5Gbps, we need to ensure the TX side is sending an initial deskew calibration pattern. Please note that AM62x does not support periodic deskew calibration; only initial deskew cal is supported by our DPHY.

    Best regards,

    Luis Parga

  • Hello Luis, 

    Yes, they are programmable by adjusting the register values (0x25–0x29) via i2c command, as mentioned in my previous comment on April 2nd. We will provide more detailed information and adjustment guidelines for the TP2855 as below.

    Default Tx setting values:

    TP2855 MIPI Tx timing control regsiter:

    First, could you please check whether the current (default) TX timing configuration matches the RX's? 

    Below are the Tx timing values provided by the decoder vendor when using the following register settings: Reg 0x25 = 3, Reg 0x26 = 2, and Reg 0x27 = 8. We can use these as a baseline for further adjustment.

    It may be better to adjust only one side (e.g., RX), while keeping the other side fixed to ensure proper alignment.

    We previously tested link frequencies of 297 MHz and 594 MHz (800 MHz has not been tested yet). It seems that 594 MHz should be sufficient, as we are using 4 lanes to transmit data from 4 cameras. However, we have currently tested with only one camera, and the issue still exists.

    1)This is the MIPI standard timing. Please refer to the red box.

    2) Regarding to this issue, a suggestion to adjust MIPI timing in the MIPI RX (AP-AM62) is the T_TERM value which the prepare timing. Any comment, please let's know. Thank you. 

    T3-PREPARE + T3-PREBEGIN value = T_TERM.

  • Hi Paul,

    Thanks for your response.

    Timing parameters look good for both TX and RX side. However, I do not know whether RX data rate is correctly set to 594Mbps as well. Can you please share this information? Regarding the T_TERM adjustment, I do not believe this is adding to the problem, but you can experiment with increasing/decreasing it to see how this impacts your system.

    Can you share what the 4 PHY_BAND_CTL registers read on the RX side for the case when you have data rate on TX side set to 594Mbps?

    Best regards,

    Luis Parga

  • Hi Luis, 

    Could you please confirm whether the following is correct? Also, please advise on what we should check next. Thank you.

    For comparison, we tested both 297 MHz and 594 MHz configurations. The link frequencies were set to the same values on both the TX and RX sides.

    We also measured the Rx clock (MIPI_CKP/N) at 297 MHz, as shown below. (When we change it to 594 MHz, the clock increases accordingly.)

  • Hi Luis,

    Do you have any feedback for us?

    Based on our observations so far, the camera output frame rate is around 11–16 fps (as shown in the logs we shared on April 8). This may be due to frame drops or errors.

    For your information:

    1. There is no 800 MHz setting available on the TX side (maximum is 594 MHz), and 800 MHz is out of specification.

    2. We tried adjusting some TX register values related to T_TERM, but although it caused some changes in the on-screen output, it did not improve performance.

  • Hi Paul,

    My apologies for the delay responding. Thanks for confirming the DPHY-TX (TPS2855 video decoder) and CSI-RX (AM62x) link frequencies are indeed matching. Can you also confirm frame rate for the camera sensor is less than 60FPS? Do you have horizontal and vertical resolution matching too? It seems like the AM62x CSI-RX is missing SoF and/or EoF intermittently. I still believe we have a mismatch issue somewhere, but I have not been able to pin point it. Is there any way to confirm full functionality of the camera sensors? What is the correct resolution (1280x720 or 1920x1080? Can we focus on making sure the camera sensors are working as expected?

    Best regards,

    Luis Parga

  • Hi Luis,

    Thank you for your support.

    The two cameras we are currently testing both output 1280×720 (720p) and are standard products available on the market. We have also verified them using the TP2855 EVK board, where they work properly. In addition, these cameras have been successfully used in our other projects with different AP/SoCs.

    When using gst-launch-1.0, we observed that the frame rate is below 30 FPS (naver reach to 60 FPS). The TP2855 passes the camera stream to the AM62, and on the TP2855 side we can confirm that both HLOCK and VLOCK are stable, indicating that the camera input is normal.

    1. Could you please advise how to verify the CSI TX/RX data signals or waveform?

    2. Currently, we only have the TP2855 register settings and have developed a TP2855 SW driver for the AM62x. There may be an issue in our implementation. Could you recommend any existing video driver  that has already been validated on AM62x? We would like to use it as a reference and try.

    Thank you.

  • Hi Paul,

    Can you provide scope captures on the RX side? Also, the below registers should be in general good to use for debugging this issue. 

    CSIRX_ERROR_DEBUG 3010 1074h

     

     DL0 to DL3 : 3011 0C18, 3011 0C24, 3011 0C34, 3011 0C40

     

    CSIRX_INTEGRATION_DEBUG 3010 1060h

     

    CSIRX_STREAM0_MONITOR_FRAME 3010 1114h

    Hi Jay,

    Can you help to provide working driver that Paul can use as a reference?

    Best regards,

    Luis Parga

  • Hi Luis,

    Below is scope capture.If something is wrong, please provide guideline.

    The regsiters are captured during a Camera streaming.

    1) CSIRX_ERROR_DEBUG 3010 1074h

    root@am62xx-evm:~# devmem2 0x30101074 w
    /dev/mem opened.
    Memory mapped at address 0xffff9d045000.
    Read at address 0x30101074 (0xffff9d045074): 0x8012005E

    2) DL0 to DL3 : 3011 0C18, 3011 0C24, 3011 0C34, 3011 0C40

    root@am62xx-evm:~# devmem2 0x30110C18 w
    /dev/mem opened.
    Memory mapped at address 0xffff90e63000.
    Read at address 0x30110C18 (0xffff90e63c18): 0x00000580
    root@am62xx-evm:~# devmem2 0x30110C24 w
    /dev/mem opened.
    Memory mapped at address 0xffff93b49000.
    Read at address 0x30110C24 (0xffff93b49c24): 0x0000056B
    root@am62xx-evm:~# devmem2 0x30110C34 w
    /dev/mem opened.
    Memory mapped at address 0xffffa4d08000.
    Read at address 0x30110C34 (0xffffa4d08c34): 0x00000580
    root@am62xx-evm:~# devmem2 0x30110C40 w
    /dev/mem opened.
    Memory mapped at address 0xffff853c9000.
    Read at address 0x30110C40 (0xffff853c9c40): 0x00000510

    3) CSIRX_INTEGRATION_DEBUG 3010 1060h

    root@am62xx-evm:~# devmem2 0x30101060 w
    /dev/mem opened.
    Memory mapped at address 0xffffb0e38000.
    Read at address 0x30101060 (0xffffb0e38060): 0x20000000

    4) CSIRX_STREAM0_MONITOR_FRAME 3010 1114h

    root@am62xx-evm:~# devmem2 0x30101114 w
    /dev/mem opened.
    Memory mapped at address 0xffffbedfb000.
    Read at address 0x30101114 (0xffffbedfb114): 0x00000000

    *Attached demo video (same enviroment and test as before but we use sync=false; Displays frames as fast as possible - Ignores timestamps)

    View camea CMD: gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=720 ! videoconvert ! fbdevsink sync=false

    - Start frames abnronal -> becomes shorter

    - Slow motion -> becomes faster

  • Hi Paul,

    My apologies for the delayed response and thanks for providing the data requested. The scope captures do not seem to be appropriately taken, but we can skip that for now. I don't see anything in the register timing/error data provided so far pointing to the root cause, but I have an idea. Can we make sure TPS2855 and AM62x are matching in resolution (1280x720) and UYVY and then run the below command? We need to make sure the entire hardware pipeline is aligned. I have a feeling that what was causing the previous streaming timeouts, buffer drops, and failed-to-drain-DMA kernel errors was the fact that the camera sensors can only output 720p, but we were forcing the AM62x SoC to look for 1080p.

    gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=UYVY,width=1280,height=720 ! waylandsink sync=false

    Please advise on the results.

    Best regards,

    Luis Parga

  • Hi Luis, 

    Thank for your comment.

    The provided gst-launch command outputs/displays to waylandsink (not fbdevsink). We previously tried both fbdevsink and waylandsink, but both produced the same symptom. We will try again using the io-mode=4 option. If we get diff result we will share here.

    However, instead of testing different output sinks, we are currently trying to capture and save the stream directly, as shown in Tests 1~4 below. Could you please provide your comments on this?

    Please check the link below for the captured files and replay results:

    https://drive.google.com/drive/folders/1WlxmonsxYlyyX73YKBVBncIZQczxuKkX?usp=sharing

    Test1: (fps25)
    root@am62xx-evm:~#timeout 10 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=25/1 ! filesink location=fps25_direct_video_auto.yuy2
    Replay on Win10: C:\> ffplay -f rawvideo -pixel_format yuyv422 -video_size 1280x720 -framerate 25 fps25_direct_video_auto.yuy2
    >>>Replay demo: test1_demo.mp4

    Test2:(fps30)
    root@am62xx-evm:~#timeout 10 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=30/1 ! filesink location=fps30_direct_video_auto.yuy2
    Replay on Win10 C:\> ffplay -f rawvideo -pixel_format yuyv422 -video_size 1280x720 -framerate 30 fps30_direct_video_auto.yuy2
    >>>Replay demo: test2_demo.mp4

    Test3:(fps25)
    root@am62xx-evm:~# timeout 10 gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=25/1 ! filesink location=fps25_direct_video_mode4.yuy2
    Replay on Win10 C:\> ffplay -f rawvideo -pixel_format yuyv422 -video_size 1280x720 -framerate 25 fps25_direct_video_mode4.yuy2
    >>>Replay demo: test3_demo.mp4

    Test4:(fps30)
    root@am62xx-evm:~# timeout 10 gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUY2,width=1280,height=720,framerate=30/1 ! filesink location=fps30_direct_video_mode4.yuy2
    Replay on Win10 C:\> ffplay -f rawvideo -pixel_format yuyv422 -video_size 1280x720 -framerate 30 fps30_direct_video_mode4.yuy2
    >>>Replay demo: test4_demo.mp4

    Thanks.

  • Hi Luis, 

    FYI, with waylandsink result

    1) Below command is not able to run, it requires "videoconvert" option

    gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=UYVY,width=1280,height=720 ! waylandsink sync=false

    Log:

    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUYV,width=1280,height=720 ! waylandsink sync=false
    WARNING: erroneous pipeline: could not link v4l2src0 to waylandsink0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1280, height=(int)720

    2) Add  "videoconvert" option (both commands produce simliar output as demo video below)

    gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=1280,height=720 ! videoconvert ! waylandsink sync=false

    gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUY2,width=1280,height=720 ! videoconvert ! waylandsink sync=false

  • Hi Paul,

    As I go thru your data above, can you also try the below command with 'YUYV'?

    gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUYV,width=1280,height=720 ! videoconvert ! waylandsink sync=false

    Thanks,

    Luis Parga

  • Hi Luis, 

    Format=YUYV seems not to be a valid GStreamer caps naming, so the command is not runable. 

    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUYV,width=1280,height=720 ! videoconvert ! waylandsink sync=false
    WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1280, height=(int)720
    root@am62xx-evm:~#

    Full Log:

    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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/640x480 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/640x480 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]
    
    - entity 7: 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/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# media-ctl -d /dev/media0 -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
     quantization:lim-range]'
    media-ctl -d /dev/media0 -V '"30102000.ticsi2rx":0 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
    media-ctl -d /dev/media0 -V '"30102000.ticsi2rx":1 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
    v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=YUYV --verbose
    media-ctl -proot@am62xx-evm:~# media-ctl -d /dev/media0 -V '"cdns_csi2rx.30101000.csi-bridge":1 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 -V '"30102000.ticsi2rx":0 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
    root@am62xx-evm:~# media-ctl -d /dev/media0 -V '"30102000.ticsi2rx":1 [fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]'
    root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=YUYV --verbose
    VIDIOC_QUERYCAP: ok
    VIDIOC_G_FMT: ok
    VIDIOC_S_FMT: ok
    Format Video Capture:
            Width/Height      : 1280/720
            Pixel Format      : 'YUYV' (YUYV 4:2:2)
            Field             : None
            Bytes per Line    : 2560
            Size Image        : 1843200
            Colorspace        : sRGB
            Transfer Function : Default (maps to sRGB)
            YCbCr/HSV Encoding: Default (maps to ITU-R 601)
            Quantization      : Default (maps to Limited Range)
            Flags             :
    root@am62xx-evm:~# media-ctl -p
    Media controller API version 6.1.33
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.33
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 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:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 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]
    
    - entity 7: 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:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    <- "tp2855 1-0044":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 13: tp2855 1-0044 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:YUYV8_1X16/1280x720 field:none colorspace:srgb xfer:709 ycbcr:601 quantization:lim-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video0
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video1
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=YUYV,width=1280,height=720 ! videoconvert ! waylandsink sync=false
    WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1280, height=(int)720
    root@am62xx-evm:~#
    root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUYV,width=1280,height=720 ! videoconvert ! waylandsink sync=false
    WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0, neither element can handle caps video/x-raw, format=(string)YUYV, width=(int)1280, height=(int)720
    root@am62xx-evm:~# v4l2-ctl --device=/dev/video0 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
            Type: Video Capture
    
            [0]: 'YUYV' (YUYV 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [1]: 'UYVY' (UYVY 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [2]: 'YVYU' (YVYU 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [3]: 'VYUY' (VYUY 4:2:2)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [4]: 'BA81' (8-bit Bayer BGBG/GRGR)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
                    Size: Stepwise 16x1 - 16384x16384 with step 16/1
            [8]: 'BG10' (10-bit Bayer BGBG/GRGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [9]: 'GB10' (10-bit Bayer GBGB/RGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [10]: 'BA10' (10-bit Bayer GRGR/BGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [11]: 'RG10' (10-bit Bayer RGRG/GBGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [12]: 'BG12' (12-bit Bayer BGBG/GRGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [13]: 'GB12' (12-bit Bayer GBGB/RGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [14]: 'BA12' (12-bit Bayer GRGR/BGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [15]: 'RG12' (12-bit Bayer RGRG/GBGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [16]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [17]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [18]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [19]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [20]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [21]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [22]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
            [23]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
                    Size: Stepwise 8x1 - 8192x16384 with step 8/1
    root@am62xx-evm:~#
    root@am62xx-evm:~# v4l2-ctl \
    > --device=/dev/video0 \
    > --set-fmt-video=width=1280,height=720,pixelformat=YUYV \
    --stream-mmap \
    > --stream-mmap \
    > --stream-to=/tmp/out.yuv
    <<<<<<<<<<<<<<<<<<<< 18.74 fps
    <<<<<<<<<<<<<<<<<< 18.36 fps
    <<<<<<<<<<<<<<<<<< 18.04 fps
    <<<<<<<<<<<<<<<<< 17.93 fps
    <<<<<<<<<<<<<<<<<< 17.83 fps
    <<<<<<<<<<<<<<<<<< 17.87 fps
    <<<<<<<<<<<<<<<<< 17.83 fps
    <<<<<<<<<<<<<<<<<< 17.77 fps
    <<<<<<<<<<<<<<<<< 17.75 fps
    <<<<<<<<<<<<<<<<<< 17.77 fps
    <<<<<<<<<<<<<<<<<< 17.75 fps
    <<<<<<<<<<<<<<<<< 17.73 fps
    <<<<<<<<<<<<<<<<<< 17.70 fps
    <<<<<<<<<<<<<<<<< 17.61 fps
    <<<<<<<<<<<<<<<<<< 17.60 fps
    ^C
    root@am62xx-evm:~#