linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT
@ 2015-11-20  9:46 Jisheng Zhang
  2015-11-20  9:47 ` [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT Jisheng Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-20  9:46 UTC (permalink / raw)
  To: sebastian.hesselbarth, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel, Jisheng Zhang

The first patch adds i2c nodes in the soc's dtsi, the second patch
enables all i2c nodes for BG4CT STB board.

NOTE: this series depends on the missed-in-v4.4rc1 patches:

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378634.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378635.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378638.html

Jisheng Zhang (2):
  arm64: dts: berlin4ct: add I2C nodes for BG4CT
  arm64: dts: berlin4ct: enable all i2c nodes for the STB board

 arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 ++++++++++++++++++++++++++
 arch/arm64/boot/dts/marvell/berlin4ct.dtsi    | 52 +++++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

-- 
2.6.2


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

* [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT
  2015-11-20  9:46 [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
@ 2015-11-20  9:47 ` Jisheng Zhang
  2015-11-20 21:21   ` Sebastian Hesselbarth
  2015-11-20  9:47 ` [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board Jisheng Zhang
  2015-11-20  9:51 ` [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
  2 siblings, 1 reply; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-20  9:47 UTC (permalink / raw)
  To: sebastian.hesselbarth, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel, Jisheng Zhang

The Marvell Berlin BG4CT SoC has 4 TWSI which are compatible with the
Synopsys DesignWare I2C driver. Add the corresponding nodes.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 52 ++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
index cca4c41..39d0676 100644
--- a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
+++ b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
@@ -232,6 +232,32 @@
 				};
 			};
 
+			i2c0: i2c@1400 {
+				compatible = "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x1400 0x100>;
+				clocks = <&clk CLK_APBCORE>;
+				i2c-sda-hold-time-ns = <35>;
+				i2c-sda-falling-time-ns = <425>;
+				i2c-scl-falling-time-ns = <205>;
+				interrupts = <4>;
+				status = "disabled";
+			};
+
+			i2c1: i2c@1800 {
+				compatible = "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x1800 0x100>;
+				clocks = <&clk CLK_APBCORE>;
+				i2c-sda-hold-time-ns = <35>;
+				i2c-sda-falling-time-ns = <425>;
+				i2c-scl-falling-time-ns = <205>;
+				interrupts = <5>;
+				status = "disabled";
+			};
+
 			aic: interrupt-controller@3800 {
 				compatible = "snps,dw-apb-ictl";
 				reg = <0x3800 0x30>;
@@ -319,6 +345,32 @@
 				};
 			};
 
+			i2c2: i2c@b000 {
+				compatible = "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0xb000 0x100>;
+				clocks = <&osc>;
+				i2c-sda-hold-time-ns = <140>;
+				i2c-sda-falling-time-ns = <500>;
+				i2c-scl-falling-time-ns = <220>;
+				interrupts = <6>;
+				status = "disabled";
+			};
+
+			i2c3: i2c@c000 {
+				compatible = "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0xc000 0x100>;
+				clocks = <&osc>;
+				i2c-sda-hold-time-ns = <140>;
+				i2c-sda-falling-time-ns = <500>;
+				i2c-scl-falling-time-ns = <220>;
+				interrupts = <7>;
+				status = "disabled";
+			};
+
 			uart0: uart@d000 {
 				compatible = "snps,dw-apb-uart";
 				reg = <0xd000 0x100>;
-- 
2.6.2


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

* [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board
  2015-11-20  9:46 [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
  2015-11-20  9:47 ` [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT Jisheng Zhang
@ 2015-11-20  9:47 ` Jisheng Zhang
  2015-11-20 21:19   ` Sebastian Hesselbarth
  2015-11-20  9:51 ` [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
  2 siblings, 1 reply; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-20  9:47 UTC (permalink / raw)
  To: sebastian.hesselbarth, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel, Jisheng Zhang

Enable all i2c nodes for the Marvell berlin BG4CT STB board.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 +++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
index 348c37e..9e8e2e0 100644
--- a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
+++ b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
@@ -61,6 +61,56 @@
 	};
 };
 
+&avio_pinctrl {
+	twsi1_pmux: twsi1-pmux {
+		groups = "TX_EDDC_SCL", "TX_EDDC_SDA";
+		function = "tx_eddc";
+	};
+};
+
+&i2c0 {
+	status = "okay";
+	pinctrl-0 = <&twsi0_pmux>;
+	pinctrl-names = "default";
+};
+
+&i2c1 {
+	status = "okay";
+	pinctrl-0 = <&twsi1_pmux>;
+	pinctrl-names = "default";
+};
+
+&i2c2 {
+	status = "okay";
+	pinctrl-0 = <&twsi2_pmux>;
+	pinctrl-names = "default";
+};
+
+&i2c3 {
+	status = "okay";
+	pinctrl-0 = <&twsi3_pmux>;
+	pinctrl-names = "default";
+};
+
+&soc_pinctrl {
+	twsi0_pmux: twsi0-pmux {
+		groups = "TW0_SCL", "TW0_SDA";
+		function = "tw0";
+	};
+};
+
+&system_pinctrl {
+	twsi2_pmux: twsi2-pmux {
+		groups = "SM_TW2_SCL", "SM_TW2_SDA";
+		function = "tw2";
+	};
+
+	twsi3_pmux: twsi3-pmux {
+		groups = "SM_TW3_SCL", "SM_TW3_SDA";
+		function = "tw3";
+	};
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.6.2


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

* Re: [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT
  2015-11-20  9:46 [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
  2015-11-20  9:47 ` [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT Jisheng Zhang
  2015-11-20  9:47 ` [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board Jisheng Zhang
@ 2015-11-20  9:51 ` Jisheng Zhang
  2 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-20  9:51 UTC (permalink / raw)
  To: sebastian.hesselbarth, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel



On Fri, 20 Nov 2015 17:46:59 +0800
Jisheng Zhang wrote:

> The first patch adds i2c nodes in the soc's dtsi, the second patch
> enables all i2c nodes for BG4CT STB board.
> 
> NOTE: this series depends on the missed-in-v4.4rc1 patches:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378634.html
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378635.html
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378638.html

also depends on BG4CT clk support:
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/386760.html

I just want to sent out for review early so that i2c support will get merged
once clk patches are accepted and merged.

Thanks,
Jisheng

> 
> Jisheng Zhang (2):
>   arm64: dts: berlin4ct: add I2C nodes for BG4CT
>   arm64: dts: berlin4ct: enable all i2c nodes for the STB board
> 
>  arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 ++++++++++++++++++++++++++
>  arch/arm64/boot/dts/marvell/berlin4ct.dtsi    | 52 +++++++++++++++++++++++++++
>  2 files changed, 102 insertions(+)
> 


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

* Re: [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board
  2015-11-20  9:47 ` [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board Jisheng Zhang
@ 2015-11-20 21:19   ` Sebastian Hesselbarth
  2015-11-23  2:49     ` Jisheng Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Hesselbarth @ 2015-11-20 21:19 UTC (permalink / raw)
  To: Jisheng Zhang, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
	galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel

On 20.11.2015 10:47, Jisheng Zhang wrote:
> Enable all i2c nodes for the Marvell berlin BG4CT STB board.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
>  arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 +++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> index 348c37e..9e8e2e0 100644
> --- a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> +++ b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> @@ -61,6 +61,56 @@
>  	};
>  };
>  
> +&avio_pinctrl {
> +	twsi1_pmux: twsi1-pmux {
> +		groups = "TX_EDDC_SCL", "TX_EDDC_SDA";
> +		function = "tx_eddc";
> +	};

Please keep the pinmux sub-nodes in the SoC dtsi as long
as they are not strictly board specific, i.e. gpios.

> +};
> +
> +&i2c0 {
> +	status = "okay";
> +	pinctrl-0 = <&twsi0_pmux>;
> +	pinctrl-names = "default";

If there is only one (or a default) pinctrl-0 option for i2c0,
you can also move it to the SoC dtsi.

> +};
> +
> +&i2c1 {
> +	status = "okay";
> +	pinctrl-0 = <&twsi1_pmux>;
> +	pinctrl-names = "default";

ditto.

> +};
> +
> +&i2c2 {
> +	status = "okay";
> +	pinctrl-0 = <&twsi2_pmux>;
> +	pinctrl-names = "default";

ditto.

> +};
> +
> +&i2c3 {
> +	status = "okay";
> +	pinctrl-0 = <&twsi3_pmux>;
> +	pinctrl-names = "default";

ditto.

> +};
> +
> +&soc_pinctrl {
> +	twsi0_pmux: twsi0-pmux {
> +		groups = "TW0_SCL", "TW0_SDA";
> +		function = "tw0";
> +	};

Same comment about moving pinmux nodes to SoC dtsi.

> +};
> +
> +&system_pinctrl {
> +	twsi2_pmux: twsi2-pmux {
> +		groups = "SM_TW2_SCL", "SM_TW2_SDA";
> +		function = "tw2";
> +	};
> +
> +	twsi3_pmux: twsi3-pmux {
> +		groups = "SM_TW3_SCL", "SM_TW3_SDA";
> +		function = "tw3";
> +	};

ditto.

Sebastian

> +};
> +
>  &uart0 {
>  	status = "okay";
>  };
> 


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

* Re: [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT
  2015-11-20  9:47 ` [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT Jisheng Zhang
@ 2015-11-20 21:21   ` Sebastian Hesselbarth
  2015-11-23  2:43     ` Jisheng Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Hesselbarth @ 2015-11-20 21:21 UTC (permalink / raw)
  To: Jisheng Zhang, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
	galak, catalin.marinas, will.deacon
  Cc: devicetree, linux-arm-kernel, linux-kernel

On 20.11.2015 10:47, Jisheng Zhang wrote:
> The Marvell Berlin BG4CT SoC has 4 TWSI which are compatible with the
> Synopsys DesignWare I2C driver. Add the corresponding nodes.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
>  arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 52 ++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> index cca4c41..39d0676 100644
> --- a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> +++ b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> @@ -232,6 +232,32 @@
>  				};
>  			};
>  
> +			i2c0: i2c@1400 {
> +				compatible = "snps,designware-i2c";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0x1400 0x100>;
> +				clocks = <&clk CLK_APBCORE>;

This patch looks fine to me, except that clock node naming and
clock indices may change. We should really postpone this series
until we worked out clock.

Sebastian

> +				i2c-sda-hold-time-ns = <35>;
> +				i2c-sda-falling-time-ns = <425>;
> +				i2c-scl-falling-time-ns = <205>;
> +				interrupts = <4>;
> +				status = "disabled";
> +			};
> +
> +			i2c1: i2c@1800 {
> +				compatible = "snps,designware-i2c";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0x1800 0x100>;
> +				clocks = <&clk CLK_APBCORE>;
> +				i2c-sda-hold-time-ns = <35>;
> +				i2c-sda-falling-time-ns = <425>;
> +				i2c-scl-falling-time-ns = <205>;
> +				interrupts = <5>;
> +				status = "disabled";
> +			};
> +
>  			aic: interrupt-controller@3800 {
>  				compatible = "snps,dw-apb-ictl";
>  				reg = <0x3800 0x30>;
> @@ -319,6 +345,32 @@
>  				};
>  			};
>  
> +			i2c2: i2c@b000 {
> +				compatible = "snps,designware-i2c";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0xb000 0x100>;
> +				clocks = <&osc>;
> +				i2c-sda-hold-time-ns = <140>;
> +				i2c-sda-falling-time-ns = <500>;
> +				i2c-scl-falling-time-ns = <220>;
> +				interrupts = <6>;
> +				status = "disabled";
> +			};
> +
> +			i2c3: i2c@c000 {
> +				compatible = "snps,designware-i2c";
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0xc000 0x100>;
> +				clocks = <&osc>;
> +				i2c-sda-hold-time-ns = <140>;
> +				i2c-sda-falling-time-ns = <500>;
> +				i2c-scl-falling-time-ns = <220>;
> +				interrupts = <7>;
> +				status = "disabled";
> +			};
> +
>  			uart0: uart@d000 {
>  				compatible = "snps,dw-apb-uart";
>  				reg = <0xd000 0x100>;
> 


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

* Re: [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT
  2015-11-20 21:21   ` Sebastian Hesselbarth
@ 2015-11-23  2:43     ` Jisheng Zhang
  0 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-23  2:43 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	catalin.marinas, will.deacon, devicetree, linux-arm-kernel,
	linux-kernel

On Fri, 20 Nov 2015 22:21:55 +0100
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> wrote:

> On 20.11.2015 10:47, Jisheng Zhang wrote:
> > The Marvell Berlin BG4CT SoC has 4 TWSI which are compatible with the
> > Synopsys DesignWare I2C driver. Add the corresponding nodes.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> >  arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 52 ++++++++++++++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> > index cca4c41..39d0676 100644
> > --- a/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> > +++ b/arch/arm64/boot/dts/marvell/berlin4ct.dtsi
> > @@ -232,6 +232,32 @@
> >  				};
> >  			};
> >  
> > +			i2c0: i2c@1400 {
> > +				compatible = "snps,designware-i2c";
> > +				#address-cells = <1>;
> > +				#size-cells = <0>;
> > +				reg = <0x1400 0x100>;
> > +				clocks = <&clk CLK_APBCORE>;  
> 
> This patch looks fine to me, except that clock node naming and
> clock indices may change. We should really postpone this series
> until we worked out clock.

Indeed. This is just to sent out for review early, so that we can merge
the i2c support once clk is ready.

Thanks for review,
Jisheng

> 
> Sebastian
> 
> > +				i2c-sda-hold-time-ns = <35>;
> > +				i2c-sda-falling-time-ns = <425>;
> > +				i2c-scl-falling-time-ns = <205>;
> > +				interrupts = <4>;
> > +				status = "disabled";
> > +			};
> > +
> > +			i2c1: i2c@1800 {
> > +				compatible = "snps,designware-i2c";
> > +				#address-cells = <1>;
> > +				#size-cells = <0>;
> > +				reg = <0x1800 0x100>;
> > +				clocks = <&clk CLK_APBCORE>;
> > +				i2c-sda-hold-time-ns = <35>;
> > +				i2c-sda-falling-time-ns = <425>;
> > +				i2c-scl-falling-time-ns = <205>;
> > +				interrupts = <5>;
> > +				status = "disabled";
> > +			};
> > +
> >  			aic: interrupt-controller@3800 {
> >  				compatible = "snps,dw-apb-ictl";
> >  				reg = <0x3800 0x30>;
> > @@ -319,6 +345,32 @@
> >  				};
> >  			};
> >  
> > +			i2c2: i2c@b000 {
> > +				compatible = "snps,designware-i2c";
> > +				#address-cells = <1>;
> > +				#size-cells = <0>;
> > +				reg = <0xb000 0x100>;
> > +				clocks = <&osc>;
> > +				i2c-sda-hold-time-ns = <140>;
> > +				i2c-sda-falling-time-ns = <500>;
> > +				i2c-scl-falling-time-ns = <220>;
> > +				interrupts = <6>;
> > +				status = "disabled";
> > +			};
> > +
> > +			i2c3: i2c@c000 {
> > +				compatible = "snps,designware-i2c";
> > +				#address-cells = <1>;
> > +				#size-cells = <0>;
> > +				reg = <0xc000 0x100>;
> > +				clocks = <&osc>;
> > +				i2c-sda-hold-time-ns = <140>;
> > +				i2c-sda-falling-time-ns = <500>;
> > +				i2c-scl-falling-time-ns = <220>;
> > +				interrupts = <7>;
> > +				status = "disabled";
> > +			};
> > +
> >  			uart0: uart@d000 {
> >  				compatible = "snps,dw-apb-uart";
> >  				reg = <0xd000 0x100>;
> >   
> 


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

* Re: [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board
  2015-11-20 21:19   ` Sebastian Hesselbarth
@ 2015-11-23  2:49     ` Jisheng Zhang
  2015-11-23  8:12       ` Sebastian Hesselbarth
  0 siblings, 1 reply; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-23  2:49 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	catalin.marinas, will.deacon, devicetree, linux-arm-kernel,
	linux-kernel

Dear Sebastian,

On Fri, 20 Nov 2015 22:19:32 +0100
Sebastian Hesselbarth wrote:

> On 20.11.2015 10:47, Jisheng Zhang wrote:
> > Enable all i2c nodes for the Marvell berlin BG4CT STB board.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> >  arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 +++++++++++++++++++++++++++
> >  1 file changed, 50 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> > index 348c37e..9e8e2e0 100644
> > --- a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> > +++ b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> > @@ -61,6 +61,56 @@
> >  	};
> >  };
> >  
> > +&avio_pinctrl {
> > +	twsi1_pmux: twsi1-pmux {
> > +		groups = "TX_EDDC_SCL", "TX_EDDC_SDA";
> > +		function = "tx_eddc";
> > +	};  
> 
> Please keep the pinmux sub-nodes in the SoC dtsi as long
> as they are not strictly board specific, i.e. gpios.

Hmm, seems all boards configure this pin for EDDC usage, so it's fine
to move to soc

> 
> > +};
> > +
> > +&i2c0 {
> > +	status = "okay";
> > +	pinctrl-0 = <&twsi0_pmux>;
> > +	pinctrl-names = "default";  
> 
> If there is only one (or a default) pinctrl-0 option for i2c0,
> you can also move it to the SoC dtsi.

Some board may not use i2c0, i2c2, i2c3 host and use the pin as gpio for other
purpose. Considering the above twsi1_pmux usage, what's the better solution?
move twsi1_pmux to soc's dtsi and leave i2c0, i2c2, i2c3 pinctrl in board dts?

> 
> > +};
> > +
> > +&i2c1 {
> > +	status = "okay";
> > +	pinctrl-0 = <&twsi1_pmux>;
> > +	pinctrl-names = "default";  
> 
> ditto.
> 
> > +};
> > +
> > +&i2c2 {
> > +	status = "okay";
> > +	pinctrl-0 = <&twsi2_pmux>;
> > +	pinctrl-names = "default";  
> 
> ditto.
> 
> > +};
> > +
> > +&i2c3 {
> > +	status = "okay";
> > +	pinctrl-0 = <&twsi3_pmux>;
> > +	pinctrl-names = "default";  
> 
> ditto.
> 
> > +};
> > +
> > +&soc_pinctrl {
> > +	twsi0_pmux: twsi0-pmux {
> > +		groups = "TW0_SCL", "TW0_SDA";
> > +		function = "tw0";
> > +	};  
> 
> Same comment about moving pinmux nodes to SoC dtsi.
> 
> > +};
> > +
> > +&system_pinctrl {
> > +	twsi2_pmux: twsi2-pmux {
> > +		groups = "SM_TW2_SCL", "SM_TW2_SDA";
> > +		function = "tw2";
> > +	};
> > +
> > +	twsi3_pmux: twsi3-pmux {
> > +		groups = "SM_TW3_SCL", "SM_TW3_SDA";
> > +		function = "tw3";
> > +	};  
> 
> ditto.
> 
> Sebastian
> 
> > +};
> > +
> >  &uart0 {
> >  	status = "okay";
> >  };
> >   
> 


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

* Re: [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board
  2015-11-23  2:49     ` Jisheng Zhang
@ 2015-11-23  8:12       ` Sebastian Hesselbarth
  2015-11-23  8:17         ` Jisheng Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Hesselbarth @ 2015-11-23  8:12 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	catalin.marinas, will.deacon, devicetree, linux-arm-kernel,
	linux-kernel

On 23.11.2015 03:49, Jisheng Zhang wrote:
> On Fri, 20 Nov 2015 22:19:32 +0100
> Sebastian Hesselbarth wrote:
>> On 20.11.2015 10:47, Jisheng Zhang wrote:
>>> Enable all i2c nodes for the Marvell berlin BG4CT STB board.
>>>
>>> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
>>> ---
>>>   arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 +++++++++++++++++++++++++++
>>>   1 file changed, 50 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
>>> index 348c37e..9e8e2e0 100644
>>> --- a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
>>> +++ b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
>>> @@ -61,6 +61,56 @@
>>>   	};
>>>   };
>>>
>>> +&avio_pinctrl {
>>> +	twsi1_pmux: twsi1-pmux {
>>> +		groups = "TX_EDDC_SCL", "TX_EDDC_SDA";
>>> +		function = "tx_eddc";
>>> +	};
>>
>> Please keep the pinmux sub-nodes in the SoC dtsi as long
>> as they are not strictly board specific, i.e. gpios.
>
> Hmm, seems all boards configure this pin for EDDC usage, so it's fine
> to move to soc
>
>>
>>> +};
>>> +
>>> +&i2c0 {
>>> +	status = "okay";
>>> +	pinctrl-0 = <&twsi0_pmux>;
>>> +	pinctrl-names = "default";
>>
>> If there is only one (or a default) pinctrl-0 option for i2c0,
>> you can also move it to the SoC dtsi.
>
> Some board may not use i2c0, i2c2, i2c3 host and use the pin as gpio for other
> purpose. Considering the above twsi1_pmux usage, what's the better solution?
> move twsi1_pmux to soc's dtsi and leave i2c0, i2c2, i2c3 pinctrl in board dts?

If some boards don't use i2cN, they do not enable the node in their
board dts. That is sufficient to not configure the pinmux as it will
only be set if a driver is loaded for that node.

If there is only one or two different pinmux settings for a specific
function _always_ move the pinmux setting into SoC dtsi. If there is
a well known default out of two or more possible settings, we may also
have that pinmux as a default in the i2c node and only overwrite it
when we have a board that uses a different setting.

So, for i2c: Move all pinctrl/pinctrl-names properties to the SoC
dtsi.

Sebastian


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

* Re: [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board
  2015-11-23  8:12       ` Sebastian Hesselbarth
@ 2015-11-23  8:17         ` Jisheng Zhang
  0 siblings, 0 replies; 10+ messages in thread
From: Jisheng Zhang @ 2015-11-23  8:17 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	catalin.marinas, will.deacon, devicetree, linux-arm-kernel,
	linux-kernel

On Mon, 23 Nov 2015 09:12:18 +0100
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> wrote:

> On 23.11.2015 03:49, Jisheng Zhang wrote:
> > On Fri, 20 Nov 2015 22:19:32 +0100
> > Sebastian Hesselbarth wrote:  
> >> On 20.11.2015 10:47, Jisheng Zhang wrote:  
> >>> Enable all i2c nodes for the Marvell berlin BG4CT STB board.
> >>>
> >>> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> >>> ---
> >>>   arch/arm64/boot/dts/marvell/berlin4ct-stb.dts | 50 +++++++++++++++++++++++++++
> >>>   1 file changed, 50 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> >>> index 348c37e..9e8e2e0 100644
> >>> --- a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> >>> +++ b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
> >>> @@ -61,6 +61,56 @@
> >>>   	};
> >>>   };
> >>>
> >>> +&avio_pinctrl {
> >>> +	twsi1_pmux: twsi1-pmux {
> >>> +		groups = "TX_EDDC_SCL", "TX_EDDC_SDA";
> >>> +		function = "tx_eddc";
> >>> +	};  
> >>
> >> Please keep the pinmux sub-nodes in the SoC dtsi as long
> >> as they are not strictly board specific, i.e. gpios.  
> >
> > Hmm, seems all boards configure this pin for EDDC usage, so it's fine
> > to move to soc
> >  
> >>  
> >>> +};
> >>> +
> >>> +&i2c0 {
> >>> +	status = "okay";
> >>> +	pinctrl-0 = <&twsi0_pmux>;
> >>> +	pinctrl-names = "default";  
> >>
> >> If there is only one (or a default) pinctrl-0 option for i2c0,
> >> you can also move it to the SoC dtsi.  
> >
> > Some board may not use i2c0, i2c2, i2c3 host and use the pin as gpio for other
> > purpose. Considering the above twsi1_pmux usage, what's the better solution?
> > move twsi1_pmux to soc's dtsi and leave i2c0, i2c2, i2c3 pinctrl in board dts?  
> 
> If some boards don't use i2cN, they do not enable the node in their
> board dts. That is sufficient to not configure the pinmux as it will
> only be set if a driver is loaded for that node.
> 
> If there is only one or two different pinmux settings for a specific
> function _always_ move the pinmux setting into SoC dtsi. If there is
> a well known default out of two or more possible settings, we may also
> have that pinmux as a default in the i2c node and only overwrite it
> when we have a board that uses a different setting.

Got it. Thanks for the detailed explanations.

> 
> So, for i2c: Move all pinctrl/pinctrl-names properties to the SoC
> dtsi.

Will do in v2 when clk stuff is accepted.

Thanks,
Jisheng

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

end of thread, other threads:[~2015-11-23  8:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20  9:46 [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang
2015-11-20  9:47 ` [PATCH 1/2] arm64: dts: berlin4ct: add I2C nodes for BG4CT Jisheng Zhang
2015-11-20 21:21   ` Sebastian Hesselbarth
2015-11-23  2:43     ` Jisheng Zhang
2015-11-20  9:47 ` [PATCH 2/2] arm64: dts: berlin4ct: enable all i2c nodes for the STB board Jisheng Zhang
2015-11-20 21:19   ` Sebastian Hesselbarth
2015-11-23  2:49     ` Jisheng Zhang
2015-11-23  8:12       ` Sebastian Hesselbarth
2015-11-23  8:17         ` Jisheng Zhang
2015-11-20  9:51 ` [PATCH 0/2] Add I2C support for Marvell Berlin BG4CT Jisheng Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).