All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] ARM: imx7s: add media nodes
@ 2019-03-26 11:02 Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 1/5] ARM: dts: imx7s: add mipi phy power domain Rui Miguel Silva
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva

This series is a continuation of the
[PATCH v14 00/13] media: staging/imx7: add i.MX7 media driver [0] series.
All code patches and bindings are already merged, missing only this
dts patches.

The main difference from the version in the previous series is as
commented by Laurent:
 - split of dtsi and dts in 2 patches
 - push endpoints to imx7s.dtsi

Cheers,
   Rui

v1->v2:
Shawn Guo:
  - sort alphabetically
  - hyphen for node name
  - indent align clocks
  - send status to end of property list

[0] https://lore.kernel.org/linux-media/20190206151328.21629-1-rui.silva@linaro.org/

Rui Miguel Silva (5):
  ARM: dts: imx7s: add mipi phy power domain
  ARM: dts: imx7s: add multiplexer controls
  ARM: dts: imx7s: Add video mux, csi and mipi_csi
  ARM: dts: imx7s-warp: add csi and mipi_csi node
  ARM: dts: imx7s-warp: add ov2680 sensor node

 arch/arm/boot/dts/imx7s-warp.dts | 55 ++++++++++++++++++++
 arch/arm/boot/dts/imx7s.dtsi     | 87 +++++++++++++++++++++++++++++++-
 2 files changed, 140 insertions(+), 2 deletions(-)

-- 
2.21.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/5] ARM: dts: imx7s: add mipi phy power domain
  2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
@ 2019-03-26 11:02 ` Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 2/5] ARM: dts: imx7s: add multiplexer controls Rui Miguel Silva
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva

Add power domain index 0 related with mipi-phy to imx7s.

While at it rename pcie power-domain node to remove pgc prefix.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 arch/arm/boot/dts/imx7s.dtsi | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index e88f53a4c7f4..9a680d3d6424 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -606,7 +606,13 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 
-					pgc_pcie_phy: pgc-power-domain@1 {
+					pgc_mipi_phy: power-domain@0 {
+						#power-domain-cells = <0>;
+						reg = <0>;
+						power-supply = <&reg_1p0d>;
+					};
+
+					pgc_pcie_phy: power-domain@1 {
 						#power-domain-cells = <0>;
 						reg = <1>;
 						power-supply = <&reg_1p0d>;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/5] ARM: dts: imx7s: add multiplexer controls
  2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 1/5] ARM: dts: imx7s: add mipi phy power domain Rui Miguel Silva
@ 2019-03-26 11:02 ` Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi Rui Miguel Silva
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva, Philipp Zabel

The IOMUXC General Purpose Register has bitfield to control video bus
multiplexer to control the CSI input between the MIPI-CSI2 and parallel
interface. Add that register and mask.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 arch/arm/boot/dts/imx7s.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 9a680d3d6424..792efcd2caa1 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -497,8 +497,15 @@
 
 			gpr: iomuxc-gpr@30340000 {
 				compatible = "fsl,imx7d-iomuxc-gpr",
-					"fsl,imx6q-iomuxc-gpr", "syscon";
+					"fsl,imx6q-iomuxc-gpr", "syscon",
+					"simple-mfd";
 				reg = <0x30340000 0x10000>;
+
+				mux: mux-controller {
+					compatible = "mmio-mux";
+					#mux-control-cells = <0>;
+					mux-reg-masks = <0x14 0x00000010>;
+				};
 			};
 
 			ocotp: ocotp-ctrl@30350000 {
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi
  2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 1/5] ARM: dts: imx7s: add mipi phy power domain Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 2/5] ARM: dts: imx7s: add multiplexer controls Rui Miguel Silva
@ 2019-03-26 11:02 ` Rui Miguel Silva
  2019-03-27  0:03   ` Laurent Pinchart
  2019-03-26 11:02 ` [PATCH v2 4/5] ARM: dts: imx7s-warp: add csi and mipi_csi node Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 5/5] ARM: dts: imx7s-warp: add ov2680 sensor node Rui Miguel Silva
  4 siblings, 1 reply; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva

Add device tree nodes for csi, video multiplexer and mipi-csi.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 arch/arm/boot/dts/imx7s.dtsi | 70 ++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 792efcd2caa1..a50e5877fc18 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/imx7-reset.h>
 #include "imx7d-pinfunc.h"
 
 / {
@@ -506,6 +507,29 @@
 					#mux-control-cells = <0>;
 					mux-reg-masks = <0x14 0x00000010>;
 				};
+
+				csi-mux {
+					compatible = "video-mux";
+					mux-controls = <&mux 0>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					port@1 {
+						reg = <1>;
+
+						csi_mux_from_mipi_vc0: endpoint {
+							remote-endpoint = <&mipi_vc0_to_csi_mux>;
+						};
+					};
+
+					port@2 {
+						reg = <2>;
+
+						csi_mux_to_csi: endpoint {
+							remote-endpoint = <&csi_from_csi_mux>;
+						};
+					};
+				};
 			};
 
 			ocotp: ocotp-ctrl@30350000 {
@@ -709,6 +733,23 @@
 				status = "disabled";
 			};
 
+			csi: csi@30710000 {
+				compatible = "fsl,imx7-csi";
+				reg = <0x30710000 0x10000>;
+				interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_CLK_DUMMY>,
+					 <&clks IMX7D_CSI_MCLK_ROOT_CLK>,
+					 <&clks IMX7D_CLK_DUMMY>;
+				clock-names = "axi", "mclk", "dcic";
+				status = "disabled";
+
+				port {
+					csi_from_csi_mux: endpoint {
+						remote-endpoint = <&csi_mux_to_csi>;
+					};
+				};
+			};
+
 			lcdif: lcdif@30730000 {
 				compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
 				reg = <0x30730000 0x10000>;
@@ -718,6 +759,35 @@
 				clock-names = "pix", "axi";
 				status = "disabled";
 			};
+
+			mipi_csi: mipi-csi@30750000 {
+				compatible = "fsl,imx7-mipi-csi2";
+				reg = <0x30750000 0x10000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_IPG_ROOT_CLK>,
+					 <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+					 <&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+				clock-names = "pclk", "wrap", "phy";
+				power-domains = <&pgc_mipi_phy>;
+				phy-supply = <&reg_1p0d>;
+				resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+				reset-names = "mrst";
+				status = "disabled";
+
+				port@0 {
+					reg = <0>;
+				};
+
+				port@1 {
+					reg = <1>;
+
+					mipi_vc0_to_csi_mux: endpoint {
+						remote-endpoint = <&csi_mux_from_mipi_vc0>;
+					};
+				};
+			};
 		};
 
 		aips3: aips-bus@30800000 {
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/5] ARM: dts: imx7s-warp: add csi and mipi_csi node
  2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
                   ` (2 preceding siblings ...)
  2019-03-26 11:02 ` [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi Rui Miguel Silva
@ 2019-03-26 11:02 ` Rui Miguel Silva
  2019-03-26 11:02 ` [PATCH v2 5/5] ARM: dts: imx7s-warp: add ov2680 sensor node Rui Miguel Silva
  4 siblings, 0 replies; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva

Add and enable csi and mipi_csi nodes.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 arch/arm/boot/dts/imx7s-warp.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s-warp.dts b/arch/arm/boot/dts/imx7s-warp.dts
index b1e956205e9a..0063fabfcd30 100644
--- a/arch/arm/boot/dts/imx7s-warp.dts
+++ b/arch/arm/boot/dts/imx7s-warp.dts
@@ -77,6 +77,10 @@
 	assigned-clock-rates = <884736000>;
 };
 
+&csi {
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_i2c1>;
@@ -213,6 +217,12 @@
 	};
 };
 
+&mipi_csi {
+	clock-frequency = <166000000>;
+	fsl,csis-hs-settle = <3>;
+	status = "okay";
+};
+
 &sai1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_sai1>;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 5/5] ARM: dts: imx7s-warp: add ov2680 sensor node
  2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
                   ` (3 preceding siblings ...)
  2019-03-26 11:02 ` [PATCH v2 4/5] ARM: dts: imx7s-warp: add csi and mipi_csi node Rui Miguel Silva
@ 2019-03-26 11:02 ` Rui Miguel Silva
  4 siblings, 0 replies; 7+ messages in thread
From: Rui Miguel Silva @ 2019-03-26 11:02 UTC (permalink / raw)
  To: Shawn Guo, Rob Herring, Fabio Estevam
  Cc: Laurent Pinchart, devicetree, Rui Miguel Silva

Warp7 comes with a Omnivision OV2680 sensor, add the node here to make
complete the camera data path for this system. Add the needed regulator
to the analog voltage supply, the port and endpoints in mipi_csi node
and the pinctrl for the reset gpio.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 arch/arm/boot/dts/imx7s-warp.dts | 45 ++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s-warp.dts b/arch/arm/boot/dts/imx7s-warp.dts
index 0063fabfcd30..3bcae72d33e2 100644
--- a/arch/arm/boot/dts/imx7s-warp.dts
+++ b/arch/arm/boot/dts/imx7s-warp.dts
@@ -55,6 +55,14 @@
 		regulator-always-on;
 	};
 
+	reg_peri_3p15v: regulator-peri-3p15v {
+		compatible = "regulator-fixed";
+		regulator-name = "peri_3p15v_reg";
+		regulator-min-microvolt = <3150000>;
+		regulator-max-microvolt = <3150000>;
+		regulator-always-on;
+	};
+
 	sound {
 		compatible = "simple-audio-card";
 		simple-audio-card,name = "imx7-sgtl5000";
@@ -184,6 +192,27 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_i2c2>;
 	status = "okay";
+
+	ov2680: camera@36 {
+		compatible = "ovti,ov2680";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ov2680>;
+		reg = <0x36>;
+		clocks = <&osc>;
+		clock-names = "xvclk";
+		reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
+		DOVDD-supply = <&sw2_reg>;
+		DVDD-supply = <&sw2_reg>;
+		AVDD-supply = <&reg_peri_3p15v>;
+
+		port {
+			ov2680_to_mipi: endpoint {
+				remote-endpoint = <&mipi_from_sensor>;
+				clock-lanes = <0>;
+				data-lanes = <1>;
+			};
+		};
+	};
 };
 
 &i2c3 {
@@ -221,6 +250,16 @@
 	clock-frequency = <166000000>;
 	fsl,csis-hs-settle = <3>;
 	status = "okay";
+
+	port@0 {
+		reg = <0>;
+
+		mipi_from_sensor: endpoint {
+			remote-endpoint = <&ov2680_to_mipi>;
+			data-lanes = <1>;
+		};
+
+	};
 };
 
 &sai1 {
@@ -343,6 +382,12 @@
 		>;
 	};
 
+	pinctrl_ov2680: ov2660grp {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3	0x14
+		>;
+	};
+
 	pinctrl_sai1: sai1grp {
 		fsl,pins = <
 			MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0	0x1f
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi
  2019-03-26 11:02 ` [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi Rui Miguel Silva
@ 2019-03-27  0:03   ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2019-03-27  0:03 UTC (permalink / raw)
  To: Rui Miguel Silva; +Cc: Shawn Guo, Rob Herring, Fabio Estevam, devicetree

Hi Rui,

Thank you for the patch.

On Tue, Mar 26, 2019 at 11:02:25AM +0000, Rui Miguel Silva wrote:
> Add device tree nodes for csi, video multiplexer and mipi-csi.
> 
> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
> ---
>  arch/arm/boot/dts/imx7s.dtsi | 70 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
> index 792efcd2caa1..a50e5877fc18 100644
> --- a/arch/arm/boot/dts/imx7s.dtsi
> +++ b/arch/arm/boot/dts/imx7s.dtsi
> @@ -8,6 +8,7 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/reset/imx7-reset.h>
>  #include "imx7d-pinfunc.h"
>  
>  / {
> @@ -506,6 +507,29 @@
>  					#mux-control-cells = <0>;
>  					mux-reg-masks = <0x14 0x00000010>;
>  				};
> +
> +				csi-mux {

A label would be useful for boards that use a parallel sensor.

> +					compatible = "video-mux";
> +					mux-controls = <&mux 0>;
> +					#address-cells = <1>;
> +					#size-cells = <0>;

Should this have status = "disabled" by default ? And should port@0 be
defined here with no endpoint, the same way you do for the mipi_csi node ?

> +
> +					port@1 {
> +						reg = <1>;
> +
> +						csi_mux_from_mipi_vc0: endpoint {
> +							remote-endpoint = <&mipi_vc0_to_csi_mux>;
> +						};
> +					};
> +
> +					port@2 {
> +						reg = <2>;
> +
> +						csi_mux_to_csi: endpoint {
> +							remote-endpoint = <&csi_from_csi_mux>;
> +						};
> +					};
> +				};
>  			};
>  
>  			ocotp: ocotp-ctrl@30350000 {
> @@ -709,6 +733,23 @@
>  				status = "disabled";
>  			};
>  
> +			csi: csi@30710000 {
> +				compatible = "fsl,imx7-csi";
> +				reg = <0x30710000 0x10000>;
> +				interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clks IMX7D_CLK_DUMMY>,
> +					 <&clks IMX7D_CSI_MCLK_ROOT_CLK>,
> +					 <&clks IMX7D_CLK_DUMMY>;
> +				clock-names = "axi", "mclk", "dcic";
> +				status = "disabled";
> +
> +				port {
> +					csi_from_csi_mux: endpoint {
> +						remote-endpoint = <&csi_mux_to_csi>;
> +					};
> +				};
> +			};
> +
>  			lcdif: lcdif@30730000 {
>  				compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
>  				reg = <0x30730000 0x10000>;
> @@ -718,6 +759,35 @@
>  				clock-names = "pix", "axi";
>  				status = "disabled";
>  			};
> +
> +			mipi_csi: mipi-csi@30750000 {
> +				compatible = "fsl,imx7-mipi-csi2";
> +				reg = <0x30750000 0x10000>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clks IMX7D_IPG_ROOT_CLK>,
> +					 <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
> +					 <&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
> +				clock-names = "pclk", "wrap", "phy";
> +				power-domains = <&pgc_mipi_phy>;
> +				phy-supply = <&reg_1p0d>;
> +				resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
> +				reset-names = "mrst";
> +				status = "disabled";
> +
> +				port@0 {
> +					reg = <0>;
> +				};
> +
> +				port@1 {
> +					reg = <1>;
> +
> +					mipi_vc0_to_csi_mux: endpoint {
> +						remote-endpoint = <&csi_mux_from_mipi_vc0>;
> +					};
> +				};
> +			};
>  		};
>  
>  		aips3: aips-bus@30800000 {

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-27  0:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 11:02 [PATCH v2 0/5] ARM: imx7s: add media nodes Rui Miguel Silva
2019-03-26 11:02 ` [PATCH v2 1/5] ARM: dts: imx7s: add mipi phy power domain Rui Miguel Silva
2019-03-26 11:02 ` [PATCH v2 2/5] ARM: dts: imx7s: add multiplexer controls Rui Miguel Silva
2019-03-26 11:02 ` [PATCH v2 3/5] ARM: dts: imx7s: Add video mux, csi and mipi_csi Rui Miguel Silva
2019-03-27  0:03   ` Laurent Pinchart
2019-03-26 11:02 ` [PATCH v2 4/5] ARM: dts: imx7s-warp: add csi and mipi_csi node Rui Miguel Silva
2019-03-26 11:02 ` [PATCH v2 5/5] ARM: dts: imx7s-warp: add ov2680 sensor node Rui Miguel Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.