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

4.12 mipi摄像头驱动调试

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

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

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,烧写后就可以进行摄像头测试了

打开系统自带的相机,经过授权后,可以看到图像了

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

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

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

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

免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:RK3568 开发板-安卓系统之mipi接口的摄像头驱动调试(十五)-rk3399 开发板 https://www.yhzz.com.cn/a/9690.html

上一篇 2023-04-20 17:52:09
下一篇 2023-04-20 17:58:55

相关推荐

联系云恒

在线留言: 我要留言
客服热线:400-600-0310
工作时间:周一至周六,08:30-17:30,节假日休息。