二:修改内容
1. hal3用到的camera3_profile.xml
a.SDK 下文件路径
sdk/hardware/rockchip/camera/etc/camera/camera3_profiles_rk3288.xml
b.目标板路径:
vendor/etc/camera/camera3_profiles.xml
c. 编译时复制路径:
hardware/rockchip/camera/etc/camera_etc.mk
2. 3A库相关文件
3A库为瑞芯微提供so文件,但是不提供源码。需要编译拷贝到项目板
a. 编译配置路径:
hardware/rockchip/camera_engine_rkisp/interface/Android.mk
b. 复制文件路径:
device/rockchip/common/device.mk
# CAMERA
ifeq ($(BOARD_CAMERA_SUPPORT),true)
PRODUCT_PACKAGES += \
librkisp_aec \
librkisp_awb \
librkisp_af
c. 目标板路径:
vendor/lib/rkisp/ae
vendor/lib/rkisp/awb
vendor/lib/rkisp/af
3. 3A库的tunning文件路径
a. tunning文件在SDK的路径
hardware/rockchip/camera_engine_rkisp/iqfiles/ov13850_CMK-CT0116_Largan-50013A1.xml
b. 对应摄像头的命名方式
__.xml
c. 目标板路径:
vendor/etc/camera/rkisp1/
4. 内核修改
&i2c3 {
status = "okay";
clock-frequency = <400000>;
vm149c: vm149c@0c {
compatible = "silicon touch,vm149c";
status = "okay";
reg = <0x0c>;
rockchip,vcm-start-current = <20>; // 马达的启动电流
rockchip,vcm-rated-current = <80>; // 马达的额定电流
rockchip,vcm-step-mode = <13>; // 马达驱动 ic 的电流输出模式
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
};
ov13850: ov13850@10 {
compatible = "ovti,ov13850"; // 需要与驱动中的匹配字符串一致
status = "okay";
reg = <0x10>; // sensor I2C 设备地址
clocks = <&cru SCLK_VIP_OUT>; // sensor clickin 配置
clock-names = "xvclk";
avdd-supply = <&dvp_pwr>;
dovdd-supply = <&dvp_pwr>;
dvdd-supply = <&dvp_pwr>;
// reset-gpios = <&gpio2i RK_PB5 GPIO_ACTIVE_HIGH>;
// reset 管脚分配及有效电平
pwdn-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&isp_mipi>;
// power 管脚分配及有效电平
// pinctrl-names = "rockchip,camera_default";
// pinctrl-0 = <&cif_clkout>; // pinctl 设置
rockchip,camera-module-index = <0>; // 模组编号,该编号不要重复
rockchip,camera-module-facing = "back"; // 模组朝向,有"back"和"front"
rockchip,camera-module-name = "CMK-CT0116"; // 模组名
rockchip,camera-module-lens-name = "Largan-50013A1"; // lens 名
// 模组名和 lens 名被用来和 IQ xml 文件做匹配
lens-focus = <&vm149c>; // vcm 驱动设置,支持 AF 时需要有这个设置
port {
ucam_out0: endpoint {
remote-endpoint = <&mipi_in_ucam0>;
// mipi dphy 端的 port 名
data-lanes = <1 2>;
// mipi lane 数, 1lane 为 <1>, 4lane 为 <1 2 3 4>
};
};
};
};
&mipi_phy_rx0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi_in_ucam0: endpoint@1 {
reg = <1>;
remote-endpoint = <&ucam_out0>;
// sensor 端的 port 名
data-lanes = <1 2>;
// mipi lane 数, 1lane 为 <1>, 4lane 为 <1 2 3 4>
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
dphy_rx0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&isp0_mipi_in>;
// isp 端的 port 名
};
};
};
};
&rkisp1 {
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
isp0_mipi_in: endpoint@0 {
reg = <0>;
remote-endpoint = <&dphy_rx0_out>;
// mipi dphy 端的 port 名
};
};
};
&isp_mmu {
status = "okay"; // isp 驱动使用了 iommu,所以 isp iommu 也需要打开
};
&isp { //rkisp和isp 复用,只能使用一个,rkisp为hal3,isp为hal1
status = "disabled";
};
*rockchip_defconfig配置*
CONFIG_VIDEO_OV13850=y
CONFIG_VIDEO_VM149C=y
三. 调试工具
四. 调试方法
1.判断isp驱动加载状态
grep '' /sys/class/video4linux/video*/name
/sys/class/video4linux/video3/name:rkisp1_selfpath
/sys/class/video4linux/video4/name:rkisp1_mainpath
/sys/class/video4linux/video5/name:rkisp1-statistics
/sys/class/video4linux/video6/name:rkisp1-input-params
2.判断camera驱动是否加载成功
dmesg | grep Async
[ 0.682982] rkisp1: Async subdev notifier completed
3. 3A库调试开关
setprop persist.vendor.rkisp.log 0xffffffff
4. 解析IQ文件出错或未找到IQ文件的logcat
"failed to get iq file name"
"load tunning file failed"
5. 确认3A是否有运行
6. 设置mipi摄像头前置
1.修改dts
rockchip,camera-module-facing = "front";
2.修改camera3_profiles.xml
原作者:danhu