J722SXH01EVM: DPHY not enabled

Part Number: J722SXH01EVM
Other Parts Discussed in Thread: AWR2243

Tool/software:

Hi all,

I have written a custom driver for the AWR2243 based on imx219.c and am able to start a stream using v4l2.

Here is the media-ctl output:

root@j722s-evm:/# media-ctl -p
Media controller API version 6.6.32

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

Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt: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]
        pad5: Source
                -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
        pad6: Source
                -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]

- entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
        routes:
                0/0 -> 1/0 [ACTIVE]
        pad0: Sink
                [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                <- "imx219-dummy":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]                                                                                                                                                                   CTRL-A Z for hel-> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE] Offline | ttyUSB2                                                                                                                                                                                                                    pad2: Source
        pad3: Source
        pad4: Source

- entity 15: imx219-dummy (1 pad, 1 link, 0 routes)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
        pad0: Source
                [stream:0 fmt:SRGGB8_1X8/4096x64 field:none colorspace:raw xfer:none quantization:full-range
                 crop.bounds:(0,0)/4096x64
                 crop:(0,0)/4096x64]
                -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

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

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

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

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

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

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

After configuring all the nodes to be the same frame format, I can start the stream, which hangs. No data is captured.

No error is thrown by the kernel during initialization.

root@j722s-evm:/# dmesg| grep csi
[    8.417891] platform imx219-dummy: Fixed dependency cycle(s) with /bus@f0000/ticsi2rx@30102000/csi-bridge@30101000
[    8.430287] platform 30101000.csi-bridge: Fixed dependency cycle(s) with /imx219-dummy
[    9.292152] cdns-csi2rx 30101000.csi-bridge: Probed CSI2RX with 2/4 lanes, 4 streams, external D-PHY

I checked the DPHY_LANE_CONTROL (0x30101040) register, and found that it returns 0x00000000, meaning that no clock or data lanes are enabled.

The device tree overlay is below:

// SPDX-License-Identifier: GPL-2.0-only
// Definitions for Dummy CSI2 sensor
/dts-v1/;
/plugin/;

&{/} {

    imx219_dummy: imx219-dummy {
        compatible = "sony,imx219-dummy";
        status = "okay";

//        	clocks = <&clk_imx219_fixed>;
//	      	clock-names = "xclk";
		// Add explicit dependency on CSI2RX
		//cdns_csi2rx0-supply;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;	

			port@0 {
				reg=<0>;
				imx219_dummy_out: endpoint {
					remote-endpoint = <&csi2rx0_in_sensor>;
//					bus-type = <4>; /* CSI2 DPHY */
	               	link-frequencies = /bits/ 64 <300000000>;
	                clock-lanes = <0>;
	                data-lanes = <1 2>;
				};
			};
		};
    };
};

&cdns_csi2rx0 {
	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		csi0_port0:port@0 {
			reg = <0>;
			status = "okay";

			csi2rx0_in_sensor: endpoint {
				remote-endpoint = <&imx219_dummy_out>;
				bus-type = <4>; /* CSI2 DPHY */
				clock-lanes = <0>;
				data-lanes = <1 2>;
			};
		};
	};
};

&ti_csi2rx0 {
	status = "okay";
};

&dphy0 {
	status = "okay";
};

What could be causing the lanes to not be enabled at the DPHY level?

Thank you,

Jin

  • I tried manually writing to the DPHY_LANE_CTRL register to enable data lane 0, 1, and clock:

    root@j722s-evm:/# devmem2 0x30101040 w 0x13
    /dev/mem opened.
    Memory mapped at address 0xffff85126000.
    Read at address  0x30101040 (0xffff85126040): 0x00000000
    Write at address 0x30101040 (0xffff85126040): 0x00000013, readback 0x00000013
    

    I then start the stream (the sensor is already running):

    root@j722s-evm:/# v4l2-ctl -d /dev/video2 \
    >     --set-fmt-video=width=4096,height=64,pixelformat=RGGB \
    >     --stream-mmap \
    >     --stream-count=10 \
    >     --stream-to=radar.raw \
    >     --stream-skip=0
    [  273.607490] imx219: in imx219_get_frame_desc
    [  273.611844] STATIC_CFG_REG: 43210100
    [  273.615438] DPHY_LANE_CTRL_REG: 13
    [  273.618937] cdns-csi2rx: link frequency is 300000000
    [  273.624284] STATIC_CFG_REG after config: 43210200
    [  273.629004] DPHY_LANE_CTRL_REG after config: 13013
    [  273.633910] imx219: in imx219_set_stream
    [  273.637834] imx219: in to_imx219
    [  273.641052] imx219: in imx219_start_streaming
    ^C[  303.107024] imx219: in imx219_set_stream
    [  303.110997] imx219: in to_imx219
    [  303.114263] imx219: stopping streaming
    [  303.118025] imx219: in imx219_stop_streaming
    
    root@j722s-evm:/# ls -l radar.raw 
    -rw-r--r-- 1 root root 0 Nov 20 13:12 radar.raw
    

    The process still hangs. The debug prints shows driver functions and register values for the static device config and DPHY lane control registers. 

    • DPHY_LANE_CTRL: Seems data lanes 0 and 1, and clock are reset after configuration
    • STATIC_CFG_REG: The internal datapath width goes from 16-bit to 32-bit during configuration, but it should be 8-bit based on the driver? The extended VC config goes from none to 16 VCs.

    Reading the ERROR_IRQS (0x30102020) returns 0x00000100, an invalid access IRQ. I think this might be because I manually wrote to the DPHY lane control register?

  • Hi,

    Validate that the link frequency for the sensor is configured correctly using this page as a reference. Run the following commands to resolve the format mismatch among the entities:

    media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:SRGGB8_1X8/4096x64 field:none]'

    media-ctl -V '"30102000.ticsi2rx":0 [fmt:SRGGB8_1X8/4096x64 field:none]'

    FAQs: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1403223/faq-most-common-problems-encountered-when-developing-camera-applications-on-the-am6x

    Thank you,

    Fabiana