您尚未登录。

楼主 # 2025-10-17 18:11:26

Yning
会员
注册时间: 2025-10-17
已发帖子: 1
积分: 1

RV1106如何适配DVP摄像头?

在为RV1106适配OV2640摄像头时遇到如下问题
media-ctl查看链路正常连接,使用示波器抓取摄像头数据发现正常工作,但无法正常抓图。
查看/proc/rkcif-dvp查询到信息如下:
Driver Version:v00.02.00
Work Mode:ping pong
Monitor Mode:idle
aclk_cif:339428572
hclk_cif:148500000
dclk_cif:339428572
pclk_cif:0
i0clk_cif:0
i1clk_cif:0
rx0clk_cif:0
rx1clk_cif:0
isp0clk_cif:0
sclk_m0_cif:24000000
sclk_m1_cif:24000000
pclk_vepu_cif:0

Media device information
------------------------
driver          rkcif
model           rkcif-dvp
serial
bus info
hw revision     0x0
driver version  5.10.160

Device topology
- entity 1: stream_cif_dvp_id0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "ov2640 0-0030":0 [ENABLED]

- entity 5: stream_cif_dvp_id1 (1 pad, 0 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
        pad0: Sink

- entity 9: stream_cif_dvp_id2 (1 pad, 0 link)
            type Node subtype V4L flags 0
            device node name /dev/video2
        pad0: Sink

- entity 13: stream_cif_dvp_id3 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video3
        pad0: Sink

- entity 17: rkcif_scale_ch0 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video4
        pad0: Sink

- entity 21: rkcif_scale_ch1 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video5
        pad0: Sink

- entity 25: rkcif_scale_ch2 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video6
        pad0: Sink

- entity 29: rkcif_scale_ch3 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video7
        pad0: Sink

- entity 33: rkcif_tools_id0 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video8
        pad0: Sink

- entity 37: rkcif_tools_id1 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video9
        pad0: Sink

- entity 41: rkcif_tools_id2 (1 pad, 0 link)
             type Node subtype V4L flags 0
             device node name /dev/video10
        pad0: Sink

- entity 45: ov2640 0-0030 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:UYVY8_2X8/800x600@1/30 field:none colorspace:srgb
                 crop.bounds:(0,0)/1600x1200
                 crop:(0,0)/1600x1200]
                -> "stream_cif_dvp_id0":0 [ENABLED]

- entity 47: rkcif-dvp-sof (0 pad, 0 link)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev1
开机日志如下:
[    6.696230] : get_remote_sensor: video pad[0] is null
[    6.696241] : rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[    6.696252] : rkcif_scale_set_fmt: req(80, 60) src out(0, 0)
我的设备树配置如下:
&i2c0 {
    status = "okay";
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0m0_xfer>;
   
    /* OV2640 摄像头节点 */
    ov2640: ov2640@30 {
        compatible = "ovti,ov2640";    /* 与驱动匹配 */
        reg = <0x30>;
        clocks = <&cru CLK_VICAP_M1>;
        clock-names = "xvclk";
        pinctrl-names = "default";
        pinctrl-0 = <&vicapm1_pins>;
        assigned-clocks = <&cru CLK_VICAP_M1>;
        assigned-clock-rates = <24000000>;
       
        rockchip,camera-module-index = <0>;
        rockchip,camera-module-facing = "back";
       
        port {
            cam_para_out1: endpoint {
                remote-endpoint = <&cif_para_in>;
            };
        };
    };
};

/* CIF 节点 */
&rkcif {
    status = "okay";
};

/* CIF DVP 接口 */
&rkcif_dvp {
    status = "okay";

    port {
        /* Parallel bus endpoint */
        cif_para_in: endpoint {
            //sensor端endpoint名
            remote-endpoint = <&cam_para_out1>;
            //sensor端相关配置参数
            bus-width = <8>;
            hsync-active = <0>;
            vsync-active = <0>;
            pclk-sample = <1>;
        };
    };
};

&rkcif_dvp_sditf {
    status = "okay";
    port {
        /* parallel endpoint */
        dvp_sditf: endpoint {
            //isp 虚拟设备端port名
            remote-endpoint = <&isp_in>;
            //sensor端相关配置参数
            bus-width = <8>;
            hsync-active = <0>;
            vsync-active = <0>;
            pclk-sample = <1>;
        };
    };
};

/* ISP 节点 */
&rkisp {
    status = "okay";
    rockchip,grf = <&grf>;
};
&rkisp_vir0 {
    status = "okay";
    ports {
        port@0 {
            reg = <0>;
            #address-cells = <1>;
            #size-cells = <0>;
            isp_in: endpoint@0 {
                reg = <0>;
                //dvp sditf的端点名
                remote-endpoint = <&dvp_sditf>;
            };
        };
    };
};

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn