RK3568 开发板-安卓系统之mipi接口的摄像头驱动调试(十五)

RK3568 开发板-安卓系统之mipi接口的摄像头驱动调试(十五) 万万没想到 2022-10-17 11:59:34 7129

4.12 mipi摄像头驱动调试

4.12.1 查看原理图,获取需要配置的信息

4.12.2 需要配置的信息如下

1、两中mipi摄像头均挂在i2c4下
2、Camera0的复位GPIO是GPIO3_D4, 时钟信号是CLK_CIF_OUT
3、Camera1的复位GPIO是GPIO3_D2, 时钟信号是CIF_WIFI
4、通过查阅GC2053的规格书,及摄像头硬件,确认地址为0x3f和0x37

由于两个都是GC2053, 但配置的时候不能出现两个相同的节点,且由于是同一路I2C,所以也不能出现两个相同的地址。需要修改其中一个摄像头的地址

4.12.3 GC2053的最终配置如下

参考RKDocs/common/camera/HAL3/目录下的相关文档,最终确认配置如下

&i2c4 {
    status = "okay";
    pinctrl-0 = <&i2c4m1_xfer>;

    gc2053: gc2053@37 {
        status = "okay";
        compatible = "galaxycore,gc2053";
        reg = <0x37>;

        power-domains = <&power RK3568_PD_VI>;
        pinctrl-names = "default";
        clock-names = "xvclk";

        pinctrl-0 = <&cif_clk>;
        clocks = <&cru CLK_CIF_OUT>;

        reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;

        rockchip,camera-module-index = <0>;
        rockchip,camera-module-facing = "front";
        rockchip,camera-module-name = "default";
        rockchip,camera-module-lens-name = "JX8006";

        port {
            gc2053_out: endpoint {
                remote-endpoint = <&dphy1_in>;
                data-lanes = <1 2>;
            };
        };
    };

    gc2053_2: gc2053_2@3f {
        status = "okay";
        compatible = "galaxycore,gc2053";
        reg = <0x3f>;

        power-domains = <&power RK3568_PD_VI>;
        pinctrl-names = "default";
        clock-names = "xvclk";

        pinctrl-0 = <&refclk_pins>;
        clocks = <&pmucru CLK_WIFI>;

        reset-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>;

        rockchip,camera-module-index = <1>;
        rockchip,camera-module-facing = "back";
        rockchip,camera-module-name = "default";
        rockchip,camera-module-lens-name = "JX8006";

        port {
            gc2053_2_out: endpoint {
                remote-endpoint = <&dphy2_in>;
                data-lanes = <1 2>;
            };
        };
    };
};

&csi2_dphy_hw {
    status = "okay";
};

&csi2_dphy0 {
    status = "disabled";
};

&csi2_dphy1 {
        status = "okay";

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

                port@0 {
                        reg = <0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_in: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&gc2053_out>;
                                data-lanes = <1 2>;
                        };
                };

                port@1 {
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        dphy1_out: endpoint@1 {
                                reg = <1>;
                                remote-endpoint = <&isp0_in>;
                        };
                };
        };
};

&rkisp_vir0 {
    status = "okay";

    port {
        #address-cells = <1>;
        #size-cells = <0>;

        isp0_in: endpoint@0 {
            reg = <0>;
            remote-endpoint = <&dphy1_out>;
        };
    };
};

&csi2_dphy2 {
    status = "okay";

    /*
     * dphy2 only used for split mode,
     * can be used  concurrently  with dphy1
     * full mode and split mode are mutually exclusive
     */
    ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@0 {
            reg = <0>;
            #address-cells = <1>;
            #size-cells = <0>;

            dphy2_in: endpoint@1 {
                reg = <1>;
                remote-endpoint = <&gc2053_2_out>;
                data-lanes = <1 2>;
            };
        };

        port@1 {
            reg = <1>;
            #address-cells = <1>;
            #size-cells = <0>;

            dphy2_out: endpoint@1 {
                reg = <1>;
                remote-endpoint = <&mipi_csi2_input>;
                // remote-endpoint = <&isp1_in>;
            };
        };
    };
};

&mipi_csi2 {
    status = "okay";

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

        port@0 {
            reg = <0>;
            #address-cells = <1>;
            #size-cells = <0>;

            mipi_csi2_input: endpoint@1 {
                reg = <1>;
                remote-endpoint = <&dphy2_out>;
                data-lanes = <1 2>;
            };
        };

        port@1 {
            reg = <1>;
            #address-cells = <1>;
            #size-cells = <0>;

            mipi_csi2_output: endpoint@0 {
                reg = <0>;
                remote-endpoint = <&cif_mipi_in>;
                data-lanes = <1 2>;
            };
        };
    };
};

&rkcif_mipi_lvds {
    status = "okay";

    port {
        cif_mipi_in: endpoint {
            remote-endpoint = <&mipi_csi2_output>;
            data-lanes = <1 2>;
        };
    };
};

&rkcif_mipi_lvds_sditf {
    status = "okay";

    port {
        mipi_lvds_sditf: endpoint {
            remote-endpoint = <&isp1_in>;
            data-lanes = <1 2>;
        };
    };
};

&rkisp_vir1 {
    status = "okay";
    /* gc2053_2->dphy2->csi2->vicap */
    /* vicap sditf->isp_vir1 */
    port {
        #address-cells = <1>;
        #size-cells = <0>;

        isp1_in: endpoint@0 {
            reg = <0>;
            remote-endpoint = <&mipi_lvds_sditf>;
            // remote-endpoint = <&dphy2_out>;
        };
    };
};

&rkisp {
    status = "okay";
};

&rkisp_mmu {
    status = "okay";
};

&rkcif {
    status = "okay";
};

&rkcif_mmu {
    status = "okay";
};

4.12.4 查看gc2053是否注册成功

rk3568_aybering:/ # dmesg | grep "gc2053"
[    1.900008] gc2053 4-0037: driver version: 00.01.01
[    1.900060] gc2053 4-0037: Failed to get pwdn-gpios, maybe no used
[    1.900079] gc2053 4-0037: Failed to get power-gpios
[    1.900120] gc2053 4-0037: 4-0037 supply dovdd not found, using dummy regulator
[    1.900172] gc2053 4-0037: Linked as a consumer to regulator.0
[    1.900199] gc2053 4-0037: 4-0037 supply avdd not found, using dummy regulator
[    1.900255] gc2053 4-0037: 4-0037 supply dvdd not found, using dummy regulator
[    1.900290] gc2053 4-0037: lane_num(2)  pixel_rate(118800000)
[    1.900307] gc2053 4-0037: could not get default pinstate
[    1.900317] gc2053 4-0037: could not get sleep pinstate
[    1.907643] gc2053 4-0037: Detected GC2053 sensor
[    1.907694] rockchip-csi2-dphy csi2-dphy1: dphy1 matches m00_f_gc2053 4-0037:bus type 4
[    1.908472] gc2053 4-003f: driver version: 00.01.01
[    1.908527] gc2053 4-003f: Failed to get pwdn-gpios, maybe no used
[    1.908546] gc2053 4-003f: Failed to get power-gpios
[    1.908582] gc2053 4-003f: 4-003f supply dovdd not found, using dummy regulator
[    1.908631] gc2053 4-003f: Linked as a consumer to regulator.0
[    1.908657] gc2053 4-003f: 4-003f supply avdd not found, using dummy regulator
[    1.908700] gc2053 4-003f: 4-003f supply dvdd not found, using dummy regulator
[    1.908749] gc2053 4-003f: lane_num(2)  pixel_rate(118800000)
[    1.908767] gc2053 4-003f: could not get default pinstate
[    1.908777] gc2053 4-003f: could not get sleep pinstate
[    1.914329] gc2053 4-003f: Detected GC2053 sensor
[    1.914362] rockchip-csi2-dphy csi2-dphy2: dphy2 matches m01_b_gc2053 4-003f:bus type 4
rk3568_aybering:/ #

通过以上信息,可以看到成功注册了两个GC2053摄像头, 地址分别为0x37和0x3f

4.12.5 修改摄像头配置文件

修改摄像头配置文件hardware/rockchip/camera/etc/camera/camera3_profiles_rk356x.xml, 具体参考RKDocs/common/camera/HAL3/目录下的相关文档

4.12.6 测试摄像头

整体编译后生成update.img,烧写后就可以进行摄像头测试了
打开系统自带的相机,经过授权后,可以看到图像了

点击切换按钮,即可切换到另一个摄像头。

本开发板由易百纳技术社区提供,可前往:易百纳 AI 查看更多开发板信息。

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包 点赞 1 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
万万没想到
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区