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.

[参考译文] J722SXH01EVM:DPHY 未启用

Guru**** 2481465 points
Other Parts Discussed in Thread: AWR2243

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1458326/j722sxh01evm-dphy-not-enabled

器件型号:J722SXH01EVM
Thread 中讨论的其他器件:AWR2243

工具与软件:

大家好!

我已根据 imx219.c 为 AWR2243编写了一个定制驱动程序、并且能够使用 v4l2启动流。

以下是 media-ctl 输出:

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]

将所有节点配置为相同的帧格式后、我可以启动挂起的流。 未捕获任何数据。

初始化期间内核不抛出错误。

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

我检查了 DPHY_LANE_CONTROL (0x30101040)寄存器、发现其返回0x00000000、即未启用时钟或数据通道。

器件树叠加层如下:

// 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";
};

什么可能导致通道未在 DPHY 级别启用?

谢谢!

Jin

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我尝试手动写入 DPHY_LANE_CTRL 寄存器以启用数据通道0、1和 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
    

    然后、我启动流(传感器已在运行):

    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
    

    进程仍然挂起。 调试输出会显示静态器件配置和 DPHY 通道控制寄存器的驱动程序功能和寄存器值。  

    • DPHY_LANE_CTRL:似乎数据通道0和1、时钟在配置后复位
    • STATIC_CFG_REG:在配置期间、内部数据路径宽度从16位变为32位、但根据驱动器情况、它应该是8位? 扩展 VC 配置从 NONE 变为16VDC。

    读取 ERROR_IRQ (0x30102020)会返回0x00000100、这是一个无效的访问 IRQ。 我想这可能是因为我手动写入了 DPHY 通道控制寄存器?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    使用 此页面 作为参考、验证是否正确配置了传感器的链路频率。  运行以下命令以解决实体之间的格式不匹配问题:

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

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

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

    谢谢!

    Fabiana