From dd6c0f507d379eb042adf8fc02e991915f55297e Mon Sep 17 00:00:00 2001 From: hejiawencc Date: Sat, 1 Jul 2023 13:51:02 +0800 Subject: [PATCH] =?UTF-8?q?dts=20=E6=B7=BB=E5=8A=A0lbc2-v2=E6=91=84?= =?UTF-8?q?=E5=83=8F=E5=A4=B4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3568-lubancat-2-v1.dts | 28 ++++ .../dts/rockchip/rk3568-lubancat-2-v2.dts | 140 ++++++++++++++++-- .../boot/dts/rockchip/rk3568-lubancat-2.dts | 28 ++++ .../boot/dts/rockchip/rk3568-lubancat-2.dtsi | 47 ------ .../boot/dts/rockchip/rk3568-lubancat-2io.dts | 7 - .../rockchip/rk3568-lubancat-csi2-double.dtsi | 51 +++++-- .../dts/rockchip/uEnv/uEnvLubanCat2-V2.txt | 8 +- 8 files changed, 226 insertions(+), 84 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index 37c4ba5112d7..d25181cfbf30 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -144,6 +144,7 @@ dtb-$(CONFIG_CPU_RK3568) += \ rk3566-lubancat-1io.dtb \ rk3568-lubancat-2.dtb \ rk3568-lubancat-2-v1.dtb \ + rk3568-lubancat-2-v2.dtb \ rk3568-lubancat-2n.dtb \ rk3568-lubancat-2io.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v1.dts b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v1.dts index 820e927309ad..6b7d761c0f0e 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v1.dts @@ -6,6 +6,9 @@ #include "rk3568-lubancat-2.dtsi" +//MIPI摄像头配置 +#include "rk3568-lubancat-csi2.dtsi" + / { model = "EmbedFire LubanCat-2"; compatible = "embedfire,lubancat-2-v1", "rockchip,rk3568"; @@ -132,3 +135,28 @@ &rockchip_suspend { status = "okay"; }; + +//cam-gpio-setting +&ov5647 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; +}; + +&ov5648 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>; +}; + +&ov8858 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; +}; + +&ov13850 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; +}; + +&sc132gs { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v2.dts b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v2.dts index 7c5d4ecc29e5..53d301e30967 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v2.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2-v2.dts @@ -8,6 +8,13 @@ // 双摄像头 #include "rk3568-lubancat-csi2-double.dtsi" +// 删除rk3568-lubancat-csi2-double.dtsi中i2c5中的cam1节点 +/delete-node/ &cam1_dw9714; +/delete-node/ &cam1_ov5648; +/delete-node/ &cam1_ov8858; +/delete-node/ &cam1_ov5647; +/delete-node/ &cam1_sc132gs; + / { model = "EmbedFire LubanCat-2"; compatible = "embedfire,lubancat-2-v2", "rockchip,rk3568"; @@ -37,7 +44,7 @@ regulator-name = "vdd_cam1_5v"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; + gpio = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&cam1_pwr_en>; enable-active-high; @@ -272,24 +279,125 @@ reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; }; -//cam1-gpio-setting -&cam1_ov5647 { - pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; -}; +&i2c3 { + pinctrl-names = "default"; + status = "okay"; + // ov5648 Camare + cam1_dw9714: cam1_dw9714@0c { + status = "disabled"; + compatible = "dongwoon,dw9714"; + reg = <0x0c>; + rockchip,camera-module-index = <1>; + rockchip,vcm-max-current = <100>; + rockchip,vcm-start-current = <0>; + rockchip,vcm-rated-current = <100>; + rockchip,vcm-step-mode = <0xd>; + rockchip,vcm-dlc-enable = <0>; + rockchip,vcm-mclk = <0>; + rockchip,vcm-t-src = <0>; + rockchip,camera-module-facing = "front"; + }; -&cam1_ov5648 { - pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>; -}; + cam1_ov5648: cam1_camera@36 { + compatible = "ovti,ov5648"; + status = "disabled"; + reg = <0x36>; + clocks = <&ext_cam1_clk>; + clock-names = "xvclk"; + pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>; + dovdd-supply= <&cam1_dovdd>; /* 1.8v */ + avdd-supply = <&cam1_avdd>; /* 2.8v */ + dvdd-supply = <&cam1_dvdd>; /* 1.2v */ + rotation = <180>; -&cam1_ov8858 { - pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; -}; + rockchip,camera-module-index = <1>; + rockchip,camera-module-facing = "front"; + rockchip,camera-module-name = "THDS11073"; + rockchip,camera-module-lens-name = "Largan-40122a1"; + lens-focus = <&cam1_dw9714>; -&cam1_sc132gs { - pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; + port { + /* MIPI CSI-2 bus endpoint */ + cam1_ov5648_out: endpoint { + remote-endpoint = <&dphy2_in_ov5648>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; + + cam1_ov8858: cam1_ov8858@36 { + compatible = "ovti,ov8858"; + status = "disabled"; + reg = <0x36>; + clocks = <&ext_cam1_clk>; + clock-names = "xvclk"; + pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; + dovdd-supply= <&cam1_dovdd>; /* 1.8v */ + avdd-supply = <&cam1_avdd>; /* 2.8v */ + dvdd-supply = <&cam1_dvdd>; /* 1.2v */ + rotation = <180>; + + rockchip,camera-module-index = <1>; + rockchip,camera-module-facing = "front"; + rockchip,camera-module-name = "HS5885-BNSM1018-V01"; + rockchip,camera-module-lens-name = "default"; + lens-focus = <&cam1_dw9714>; + + port { + /* MIPI CSI-2 bus endpoint */ + cam1_ov8858_out: endpoint { + remote-endpoint = <&dphy2_in_ov8858>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; + + cam1_ov5647: cam1_ov5647@36 { + compatible = "ovti,ov5647"; + status = "disabled"; + reg = <0x36>; + clocks = <&ext_cam1_25m_clk>; + clock-names = "ext_cam1_25m_clk"; + lens-focus = <&dw9714>; + pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; + + port { + cam1_ov5647_out: endpoint { + remote-endpoint = <&dphy2_in_ov5647>; + data-lanes = <1 2>; + }; + }; + }; + + cam1_sc132gs: cam1_sc132gs@30 { + compatible = "smartsens,sc132gs"; + status = "disabled"; + reg = <0x30>; + clocks = <&ext_cam1_clk>; + clock-names = "xvclk"; + pwdn-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; + dovdd-supply= <&cam1_dovdd>; /* 1.8v */ + avdd-supply = <&cam1_avdd>; /* 2.8v */ + dvdd-supply = <&cam1_dvdd>; /* 1.2v */ + + rockchip,camera-module-index = <1>; + rockchip,camera-module-facing = "back"; + rockchip,camera-module-name = "default"; + rockchip,camera-module-lens-name = "default"; + + port { + cam1_sc132gs_out: endpoint { + remote-endpoint = <&dphy2_in_sc132gs>; + clock-lanes = <0>; + data-lanes = <1>; + }; + }; + }; }; &pinctrl { diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dts b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dts index d83c7c78d783..c2d17bbc50fd 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dts @@ -6,6 +6,9 @@ #include "rk3568-lubancat-2.dtsi" +//MIPI摄像头配置 +#include "rk3568-lubancat-csi2.dtsi" + / { model = "EmbedFire LubanCat-2"; compatible = "embedfire,lubancat-2", "rockchip,rk3568"; @@ -127,4 +130,29 @@ <0xb6 KEY_0>, <0xb5 KEY_BACKSPACE>; }; +}; + +//cam-gpio-setting +&ov5647 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; +}; + +&ov5648 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>; +}; + +&ov8858 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; +}; + +&ov13850 { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; +}; + +&sc132gs { + pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; }; \ No newline at end of file diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dtsi index 27d32243871b..3060ebe2b310 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dtsi @@ -15,9 +15,6 @@ #include #include "rk3568.dtsi" -//MIPI摄像头配置 -#include "rk3568-lubancat-csi2.dtsi" - // MIPI屏幕设置,通用镜像使用设备树插件 //专用镜像如果要开启MIPI屏幕支持,按屏幕型号开启1-3 //以下3个配置互斥,不可同时开启 @@ -275,13 +272,6 @@ io-channels = <&saradc 1>; }; - ext_cam_clk: external-camera-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <24000000>; - clock-output-names = "CLK_CAMERA1_24MHZ"; - }; - backlight: backlight { status = "okay"; compatible = "pwm-backlight"; @@ -706,43 +696,6 @@ status = "okay"; }; -//cam-gpio-setting -&ov5647 { - pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; -}; - -&ov5648 { - pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>; -}; - -&ov8858 { - pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; -}; - -&ov13850 { - pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; -}; - -&sc132gs { - pwdn-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; -}; - - -&i2c1 { - status = "okay"; - clock-frequency = <100000>; - - rockpi_ft5406: rockpi_ft5406@38 { - compatible = "rockpi_ft5406"; - reg = <0x38>; - status = "okay"; - }; -}; - &iep { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2io.dts b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2io.dts index be70762923ce..92f0cab2ad6c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2io.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-2io.dts @@ -38,13 +38,6 @@ clock-output-names = "CLK_CAMERA0_24MHZ"; }; - ext_cam_25m_clk: external-camera0-25m-clock { - compatible = "fixed-clock"; - clock-frequency = <25000000>; - clock-output-names = "ext_cam_25m_clk"; - #clock-cells = <0>; - }; - vdd_cam_5v: vdd-cam0-5v-regulator { compatible = "regulator-fixed"; regulator-name = "vdd_cam_5v"; diff --git a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-csi2-double.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-csi2-double.dtsi index 9819825f74c2..a1bd95bda850 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-lubancat-csi2-double.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-lubancat-csi2-double.dtsi @@ -4,11 +4,42 @@ * */ +/ { + ext_cam_clk: external-camera0-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "ext_cam_clk"; + }; + + ext_cam_25m_clk: external-camera-25m-clock { + compatible = "fixed-clock"; + clock-frequency = <25000000>; + clock-output-names = "ext_cam_25m_clk"; + #clock-cells = <0>; + }; + + ext_cam1_clk: external-camera1-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "ext_cam1_clk"; + }; + + ext_cam1_25m_clk: external-camera1-25m-clock { + compatible = "fixed-clock"; + clock-frequency = <25000000>; + clock-output-names = "ext_cam1_25m_clk"; + #clock-cells = <0>; + }; + +}; + &i2c1 { status = "okay"; // ov5648 Camare dw9714: dw9714@0c { - status = "disable"; + status = "disabled"; compatible = "dongwoon,dw9714"; reg = <0x0c>; rockchip,camera-module-index = <0>; @@ -31,7 +62,7 @@ avdd-supply = <&cam_avdd>; /* 2.8v */ dvdd-supply = <&cam_dvdd>; /* 1.2v */ rotation = <180>; - status = "disable"; + status = "disabled"; rockchip,camera-module-index = <0>; rockchip,camera-module-facing = "back"; @@ -51,7 +82,7 @@ ov8858: ov8858@36 { compatible = "ovti,ov8858"; - status = "disable"; + status = "disabled"; reg = <0x36>; clocks = <&ext_cam_clk>; clock-names = "xvclk"; @@ -78,7 +109,7 @@ ov5647: ov5647@36 { compatible = "ovti,ov5647"; - status = "disable"; + status = "disabled"; reg = <0x36>; clocks = <&ext_cam_25m_clk>; clock-names = "ext_cam_25m_clk"; @@ -94,7 +125,7 @@ sc132gs: sc132gs@30 { compatible = "smartsens,sc132gs"; - status = "disable"; + status = "disabled"; reg = <0x30>; clocks = <&ext_cam_clk>; clock-names = "xvclk"; @@ -119,11 +150,11 @@ }; &i2c5 { + status = "okay"; pinctrl-names = "default"; - status = "disable"; // ov5648 Camare cam1_dw9714: cam1_dw9714@0c { - status = "disable"; + status = "disabled"; compatible = "dongwoon,dw9714"; reg = <0x0c>; rockchip,camera-module-index = <1>; @@ -139,7 +170,7 @@ cam1_ov5648: cam1_camera@36 { compatible = "ovti,ov5648"; - status = "disable"; + status = "disabled"; reg = <0x36>; clocks = <&ext_cam1_clk>; clock-names = "xvclk"; @@ -166,7 +197,7 @@ cam1_ov8858: cam1_ov8858@36 { compatible = "ovti,ov8858"; - status = "disable"; + status = "disabled"; reg = <0x36>; clocks = <&ext_cam1_clk>; clock-names = "xvclk"; @@ -209,7 +240,7 @@ cam1_sc132gs: cam1_sc132gs@30 { compatible = "smartsens,sc132gs"; - status = "disable"; + status = "disabled"; reg = <0x30>; clocks = <&ext_cam1_clk>; clock-names = "xvclk"; diff --git a/arch/arm64/boot/dts/rockchip/uEnv/uEnvLubanCat2-V2.txt b/arch/arm64/boot/dts/rockchip/uEnv/uEnvLubanCat2-V2.txt index c24c46be501c..334b5186410b 100644 --- a/arch/arm64/boot/dts/rockchip/uEnv/uEnvLubanCat2-V2.txt +++ b/arch/arm64/boot/dts/rockchip/uEnv/uEnvLubanCat2-V2.txt @@ -53,8 +53,8 @@ enable_uboot_overlays=1 #dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-ov5648-overlay.dtbo #dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-ov8858-overlay.dtbo #cam1(mipi-csi1) -#dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-sc132gs-overlay.dtbo -#dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-ov5647-overlay.dtbo -#dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-ov5648-overlay.dtbo -#dtoverlay=/dtb/overlay/rk356x-lubancat-csi0-ov8858-overlay.dtbo +#dtoverlay=/dtb/overlay/rk356x-lubancat-csi1-sc132gs-overlay.dtbo +#dtoverlay=/dtb/overlay/rk356x-lubancat-csi1-ov5647-overlay.dtbo +#dtoverlay=/dtb/overlay/rk356x-lubancat-csi1-ov5648-overlay.dtbo +#dtoverlay=/dtb/overlay/rk356x-lubancat-csi1-ov8858-overlay.dtbo #overlay_end