Page 1 of 1

luckfox pro-max移植摄像头ov8858的相关问题

Posted: 2024-08-09 7:58
by W凯先森~
rv1106-luckfox-pico-pro-max-ipc.dtsi我移植ov8858摄像头的设备树

Code: Select all

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2022 Rockchip Electronics Co., Ltd.
 */
#include "rv1106-amp.dtsi"

/ {
	chosen {
		bootargs = "earlycon=uart8250,mmio32,0xff4c0000 console=ttyFIQ0 root=/dev/mmcblk1p7 rootwait snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=0";
	};

	acodec_sound: acodec-sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "rv-acodec";
		simple-audio-card,format = "i2s";
		simple-audio-card,mclk-fs = <256>;
		simple-audio-card,cpu {
			sound-dai = <&i2s0_8ch>;
		};
		simple-audio-card,codec {
			sound-dai = <&acodec>;
		};
	};

	vcc_1v8: vcc-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "vcc_1v8";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
	};

	vcc_3v3: vcc-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "vcc_3v3";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	vdd_arm: vdd-arm {
		compatible = "regulator-fixed";
		regulator-name = "vdd_arm";
		regulator-min-microvolt = <900000>;
		regulator-max-microvolt = <900000>;
		regulator-always-on;

		regulator-boot-on;
	};
	leds: leds {
		compatible = "gpio-leds";
		work_led: work{
			gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "activity";
			default-state = "on";
		};	
	};
};

&acodec {
	#sound-dai-cells = <0>;
	pa-ctl-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&csi2_dphy_hw {
	status = "okay";
};

&csi2_dphy0 {
	status = "okay";
	ports {
		#address-cells = <1>;
		#size-cells = <0>;

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

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

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

			csi_dphy_output: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&mipi_csi2_input>;
			};
		};
	};
};

&i2c4 {
	status = "okay";
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&i2c4m2_xfer>;

	ov8858: ov8858@36 {
		compatible = "ovti,ov8858";
		reg = <0x36>;
        clocks = <&cru MCLK_REF_MIPI0>;
		clock-names = "xvclk";
		pinctrl-names = "default";
		pinctrl-0 = <&mipi_refclk_out0>;
		reset-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
		//pwdn-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>;
		//power-down-gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>;
        rockchip,camera-module-index = <1>;
        rockchip,camera-module-facing = "back";
		rockchip,camera-module-lens-name = "default";
        rockchip,camera-module-name = "YT-RV1106-2-V1";
		port {
			ov8858_out: endpoint {
				remote-endpoint = <&csi_dphy_input0>;
				data-lanes = <1 2 >;
			};
		};
	};
};

&i2s0_8ch {
	#sound-dai-cells = <0>;
	status = "okay";
};

&mipi0_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 = <&csi_dphy_output>;
			};
		};

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

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

&rkcif {
	status = "okay";
};

&rkcif_mipi_lvds {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&mipi_pins>;
	port {
		/* MIPI CSI-2 endpoint */
		cif_mipi_in: endpoint {
			remote-endpoint = <&mipi_csi2_output>;
		};
	};
};

&rkcif_mipi_lvds_sditf {
	status = "okay";

	port {
		/* MIPI CSI-2 endpoint */
		mipi_lvds_sditf: endpoint {
			remote-endpoint = <&isp_in>;
		};
	};
};

&rkisp {
	status = "okay";
};

&rkisp_vir0 {
	status = "okay";

	port@0 {
		isp_in: endpoint {
			remote-endpoint = <&mipi_lvds_sditf>;
		};
	};
};

&saradc {
	status = "okay";
	vref-supply = <&vcc_1v8>;
};


&tsadc {
	status = "okay";
};
目前出现的问题
QQ截图20240809155249.png
附上拓扑结构,
QQ截图20240809155249.png
大大能否给些许思路和方向

摄像头是野火的ov8858,然后接线是按照板子的sc3336线引出来按照对应进行接线,没有接down线 ,rest线是接了的

Re: luckfox pro-max移植摄像头ov8858的相关问题

Posted: 2024-08-09 8:51
by Crocodile
您好 ,不同的sensor有不同的配置无法确定pwdn-gpios在ov8858上的必要性,在sc3336上缺少该配置会导致识别不到sensor,从那您的打印信息来看sensor的型号有打印,但是dphy没有识别到和sensor的连接,可以参考其他平台对ov8858的配置参考(rk3288-th804-avb.dts)进行配置,添加 pwdn-gpios 的连接,