Skip to contentSkip to conversation

arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1

PATCH Applied Jagan Teki 2 participants 3 messages Apr 18, 2019

Subsystems (2)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH v2 1/2 arm64: dts: allwinner: a64: Add pinmux setting for CSI MCLK on PE1

Some camera modules have the SoC feeding a master clock to the sensor instead of having a standalone crystal. This clock signal is generated from the clock control unit and output from the CSI MCLK function of pin PE1.

Add a pinmux setting for it for camera sensors to reference.

---
Changes for v2:
- add /omit-if-no-ref/
- add pin name as csi-mclk-pin instead of csi-mclk

 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
index 728f70018c51..8c5b521e6389 100644
@@ -595,6 +595,12 @@
 				function = "csi";
 			};
 
+			/omit-if-no-ref/
+			csi_mclk_pin: csi-mclk-pin {
+				pins = "PE1";
+				function = "csi";
+			};
+
 			i2c0_pins: i2c0-pins {
 				pins = "PH0", "PH1";
 				function = "i2c0";
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#1 lore raw

PATCH v2 2/2 arm64: dts: allwinner: a64-amarula-relic: Add OV5640 camera node

Amarula A64-Relic board by default bound with OV5640 camera, so add support for it with below pin information.

- PE13, PE12 via i2c-gpio bitbanging
- CLK_CSI_MCLK as external clock
- PE1 as external clock pin muxing
- ALDO1 as AVDD supply
- DLDO3 as DOVDD supply
- ELDO3 as DVDD supply
- PE14 gpio for reset pin
- PE15 gpio for powerdown pin

---
Changes for v2:
- use node name as i2c instead of i2c-csi
- drop i2c gpio pin documentation
- drop unneeded address, size properties

 .../allwinner/sun50i-a64-amarula-relic.dts    | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts +50 -0
index bd31a4385bc1..7bb1d93f5e65 100644
@@ -22,6 +22,41 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	i2c {
+		compatible = "i2c-gpio";
+		sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>;
+		scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>;
+		i2c-gpio,delay-us = <5>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ov5640: camera@3c {
+			compatible = "ovti,ov5640";
+			reg = <0x3c>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&csi_mclk_pin>;
+			clocks = <&ccu CLK_CSI_MCLK>;
+			clock-names = "xclk";
+
+			AVDD-supply = <&reg_aldo1>;
+			DOVDD-supply = <&reg_dldo3>;
+			DVDD-supply = <&reg_eldo3>;
+			reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* CSI-RST-R: PE14 */
+			powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* CSI-STBY-R: PE15 */
+
+			port {
+				ov5640_ep: endpoint {
+					remote-endpoint = <&csi_ep>;
+					bus-width = <8>;
+					hsync-active = <1>; /* Active high */
+					vsync-active = <0>; /* Active low */
+					data-active = <1>;  /* Active high */
+					pclk-sample = <1>;  /* Rising */
+				};
+			};
+		};
+	};
+
 	wifi_pwrseq: wifi-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rtc 1>;
@@ -30,6 +65,21 @@
 	};
 };
 
+&csi {
+	status = "okay";
+
+	port {
+		csi_ep: endpoint {
+			remote-endpoint = <&ov5640_ep>;
+			bus-width = <8>;
+			hsync-active = <1>; /* Active high */
+			vsync-active = <0>; /* Active low */
+			data-active = <1>;  /* Active high */
+			pclk-sample = <1>;  /* Rising */
+		};
+	};
+};
+
 &ehci0 {
 	status = "okay";
 };
Signature · 1 line
2.18.0.321.gffc6fa0e3
#2 lore raw

Re: [PATCH v2 2/2] arm64: dts: allwinner: a64-amarula-relic: Add OV5640 camera node

Quoted 12 lines · Jagan Teki

Amarula A64-Relic board by default bound with OV5640 camera, so add support for it with below pin information.

- PE13, PE12 via i2c-gpio bitbanging
- CLK_CSI_MCLK as external clock
- PE1 as external clock pin muxing
- ALDO1 as AVDD supply
- DLDO3 as DOVDD supply
- ELDO3 as DVDD supply
- PE14 gpio for reset pin
- PE15 gpio for powerdown pin

Quoted 1 line

Applied both, thanks

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com