devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] 98dx3236 i2c related fixes
@ 2020-09-07 21:17 Chris Packham
  2020-09-07 21:17 ` [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Chris Packham
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Chris Packham @ 2020-09-07 21:17 UTC (permalink / raw)
  To: jason, andrew, gregory.clement, sebastian.hesselbarth, robh+dt,
	linus.walleij
  Cc: linux-arm-kernel, devicetree, linux-gpio, linux-kernel, Chris Packham

I noticed these while adding support for i2c recovery for a couple of our
boards. They date back to when I initially added support for the 98dx3236. They
probably haven't been causing a problem because the HW defaults are correct and
unless you attempt to use the specific pinctrl functions there won't be a
problem.

Change in v2:
- Fix grammo in patch 2/3
- Add r-by from Andrew

Chris Packham (3):
  pinctrl: mvebu: Fix i2c sda definition for 98DX3236
  ARM: dts: Remove non-existent i2c1 from 98dx3236
  ARM: dts: Add i2c0 pinctrl information for 98dx3236

 arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 12 +++++++-----
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

-- 
2.28.0


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

* [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236
  2020-09-07 21:17 [PATCH v2 0/3] 98dx3236 i2c related fixes Chris Packham
@ 2020-09-07 21:17 ` Chris Packham
  2020-09-12 16:15   ` Linus Walleij
  2020-09-07 21:17 ` [PATCH v2 2/3] ARM: dts: Remove non-existent i2c1 from 98dx3236 Chris Packham
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Chris Packham @ 2020-09-07 21:17 UTC (permalink / raw)
  To: jason, andrew, gregory.clement, sebastian.hesselbarth, robh+dt,
	linus.walleij
  Cc: linux-arm-kernel, devicetree, linux-gpio, linux-kernel,
	Chris Packham, Kalyan Kinthada, Rob Herring

Per the datasheet the i2c functions use MPP_Sel=0x1. They are documented
as using MPP_Sel=0x4 as well but mixing 0x1 and 0x4 is clearly wrong. On
the board tested 0x4 resulted in a non-functioning i2c bus so stick with
0x1 which works.

Fixes: d7ae8f8dee7f ("pinctrl: mvebu: pinctrl driver for 98DX3236 SoC")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

Changes in v2:
- Add reviewed-by from Andrew

 drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index a767a05fa3a0..48e2a6c56a83 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -414,7 +414,7 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
 		 MPP_VAR_FUNCTION(0x1, "i2c0", "sck",        V_98DX3236_PLUS)),
 	MPP_MODE(15,
 		 MPP_VAR_FUNCTION(0x0, "gpio", NULL,         V_98DX3236_PLUS),
-		 MPP_VAR_FUNCTION(0x4, "i2c0", "sda",        V_98DX3236_PLUS)),
+		 MPP_VAR_FUNCTION(0x1, "i2c0", "sda",        V_98DX3236_PLUS)),
 	MPP_MODE(16,
 		 MPP_VAR_FUNCTION(0x0, "gpo", NULL,          V_98DX3236_PLUS),
 		 MPP_VAR_FUNCTION(0x4, "dev", "oe",          V_98DX3236_PLUS)),
-- 
2.28.0


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

* [PATCH v2 2/3] ARM: dts: Remove non-existent i2c1 from 98dx3236
  2020-09-07 21:17 [PATCH v2 0/3] 98dx3236 i2c related fixes Chris Packham
  2020-09-07 21:17 ` [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Chris Packham
@ 2020-09-07 21:17 ` Chris Packham
  2020-09-07 21:17 ` [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236 Chris Packham
  2020-09-23 14:38 ` [PATCH v2 0/3] 98dx3236 i2c related fixes Gregory CLEMENT
  3 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2020-09-07 21:17 UTC (permalink / raw)
  To: jason, andrew, gregory.clement, sebastian.hesselbarth, robh+dt,
	linus.walleij
  Cc: linux-arm-kernel, devicetree, linux-gpio, linux-kernel, Chris Packham

The switches with integrated CPUs have only got a single i2c controller.
They incorrectly gained one when they were split from the Armada-XP.

Fixes: 43e28ba87708 ("ARM: dts: Use armada-370-xp as a base for armada-xp-98dx3236")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v2:
- Fix grammo in commit message
- Add reviewed-by from Andrew

 arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
index 654648b05c7c..aeccedd12574 100644
--- a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
+++ b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
@@ -266,11 +266,6 @@ &i2c0 {
 	reg = <0x11000 0x100>;
 };
 
-&i2c1 {
-	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
-	reg = <0x11100 0x100>;
-};
-
 &mpic {
 	reg = <0x20a00 0x2d0>, <0x21070 0x58>;
 };
-- 
2.28.0


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

* [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236
  2020-09-07 21:17 [PATCH v2 0/3] 98dx3236 i2c related fixes Chris Packham
  2020-09-07 21:17 ` [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Chris Packham
  2020-09-07 21:17 ` [PATCH v2 2/3] ARM: dts: Remove non-existent i2c1 from 98dx3236 Chris Packham
@ 2020-09-07 21:17 ` Chris Packham
  2020-09-12 16:16   ` Linus Walleij
  2020-09-23 14:38 ` [PATCH v2 0/3] 98dx3236 i2c related fixes Gregory CLEMENT
  3 siblings, 1 reply; 9+ messages in thread
From: Chris Packham @ 2020-09-07 21:17 UTC (permalink / raw)
  To: jason, andrew, gregory.clement, sebastian.hesselbarth, robh+dt,
	linus.walleij
  Cc: linux-arm-kernel, devicetree, linux-gpio, linux-kernel, Chris Packham

Add pinctrl information for the 98dx3236 (and variants). There is only
one choice for i2c0 MPP14 and MPP15.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v2:
- Add reviewed-by from Andrew

 arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
index aeccedd12574..38a052a0312d 100644
--- a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
+++ b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
@@ -264,6 +264,8 @@ refclk: oscillator {
 &i2c0 {
 	compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
 	reg = <0x11000 0x100>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
 };
 
 &mpic {
@@ -319,6 +321,11 @@ spi0_pins: spi0-pins {
 			       "mpp2", "mpp3";
 		marvell,function = "spi0";
 	};
+
+	i2c0_pins: i2c-pins-0 {
+		marvell,pins = "mpp14", "mpp15";
+		marvell,function = "i2c0";
+	};
 };
 
 &spi0 {
-- 
2.28.0


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

* Re: [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236
  2020-09-07 21:17 ` [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Chris Packham
@ 2020-09-12 16:15   ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2020-09-12 16:15 UTC (permalink / raw)
  To: Chris Packham
  Cc: Jason Cooper, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Rob Herring, Linux ARM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, linux-kernel, Kalyan Kinthada,
	Rob Herring

On Mon, Sep 7, 2020 at 11:17 PM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:

> Per the datasheet the i2c functions use MPP_Sel=0x1. They are documented
> as using MPP_Sel=0x4 as well but mixing 0x1 and 0x4 is clearly wrong. On
> the board tested 0x4 resulted in a non-functioning i2c bus so stick with
> 0x1 which works.
>
> Fixes: d7ae8f8dee7f ("pinctrl: mvebu: pinctrl driver for 98DX3236 SoC")
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

This patch 1/3 applied for pin control fixes.

Patches 2 & 3 should go via the SoC tree.

Yours,
Linus Walleij

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

* Re: [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236
  2020-09-07 21:17 ` [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236 Chris Packham
@ 2020-09-12 16:16   ` Linus Walleij
  2020-09-23  3:08     ` Chris Packham
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2020-09-12 16:16 UTC (permalink / raw)
  To: Chris Packham
  Cc: Jason Cooper, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Rob Herring, Linux ARM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, linux-kernel

On Mon, Sep 7, 2020 at 11:17 PM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:

> Add pinctrl information for the 98dx3236 (and variants). There is only
> one choice for i2c0 MPP14 and MPP15.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Please merge this through the ARM SoC maintenance path.

Yours,
Linus Walleij

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

* Re: [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236
  2020-09-12 16:16   ` Linus Walleij
@ 2020-09-23  3:08     ` Chris Packham
  2020-09-23 12:31       ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Packham @ 2020-09-23  3:08 UTC (permalink / raw)
  To: Linus Walleij, Jason Cooper, Andrew Lunn, Gregory Clement
  Cc: Sebastian Hesselbarth, Rob Herring, Linux ARM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, linux-kernel

Hi Jason, Andrew, Gregory,

On 13/09/20 4:16 am, Linus Walleij wrote:
> On Mon, Sep 7, 2020 at 11:17 PM Chris Packham
> <chris.packham@alliedtelesis.co.nz> wrote:
>
>> Add pinctrl information for the 98dx3236 (and variants). There is only
>> one choice for i2c0 MPP14 and MPP15.
>>
>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Please merge this through the ARM SoC maintenance path.

Are you able to pick this up via the mvebu tree or should I send it via 
the RMKs patch tracking system?

Incidentally I notice there is no longer a linux-mvebu.git on 
git.infradead.org is there a pending update to MAINTAINERS.

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

* Re: [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236
  2020-09-23  3:08     ` Chris Packham
@ 2020-09-23 12:31       ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2020-09-23 12:31 UTC (permalink / raw)
  To: Chris Packham
  Cc: Linus Walleij, Jason Cooper, Gregory Clement,
	Sebastian Hesselbarth, Rob Herring, Linux ARM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list:GPIO SUBSYSTEM, linux-kernel

On Wed, Sep 23, 2020 at 03:08:22AM +0000, Chris Packham wrote:
> Hi Jason, Andrew, Gregory,
> 
> On 13/09/20 4:16 am, Linus Walleij wrote:
> > On Mon, Sep 7, 2020 at 11:17 PM Chris Packham
> > <chris.packham@alliedtelesis.co.nz> wrote:
> >
> >> Add pinctrl information for the 98dx3236 (and variants). There is only
> >> one choice for i2c0 MPP14 and MPP15.
> >>
> >> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> >> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >
> > Please merge this through the ARM SoC maintenance path.
> 
> Are you able to pick this up via the mvebu tree or should I send it via 
> the RMKs patch tracking system?

Hi Chris

Gregory should be able to pick this up via mvebu.

> Incidentally I notice there is no longer a linux-mvebu.git on 
> git.infradead.org is there a pending update to MAINTAINERS.

It moved to git.kernel.org.

https://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu.git/

It does not look like there is a patch to MAINTAINERS queued.

	 Andrew


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

* Re: [PATCH v2 0/3] 98dx3236 i2c related fixes
  2020-09-07 21:17 [PATCH v2 0/3] 98dx3236 i2c related fixes Chris Packham
                   ` (2 preceding siblings ...)
  2020-09-07 21:17 ` [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236 Chris Packham
@ 2020-09-23 14:38 ` Gregory CLEMENT
  3 siblings, 0 replies; 9+ messages in thread
From: Gregory CLEMENT @ 2020-09-23 14:38 UTC (permalink / raw)
  To: Chris Packham, jason, andrew, sebastian.hesselbarth, robh+dt,
	linus.walleij
  Cc: linux-arm-kernel, devicetree, linux-gpio, linux-kernel, Chris Packham

Hi Chris,

> I noticed these while adding support for i2c recovery for a couple of our
> boards. They date back to when I initially added support for the 98dx3236. They
> probably haven't been causing a problem because the HW defaults are correct and
> unless you attempt to use the specific pinctrl functions there won't be a
> problem.
>
> Change in v2:
> - Fix grammo in patch 2/3
> - Add r-by from Andrew
>
> Chris Packham (3):
>   pinctrl: mvebu: Fix i2c sda definition for 98DX3236
>   ARM: dts: Remove non-existent i2c1 from 98dx3236
>   ARM: dts: Add i2c0 pinctrl information for 98dx3236

Applied the 2 dts pacthes on mvebu/dt

Thanks,

Gregory


>
>  arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 12 +++++++-----
>  drivers/pinctrl/mvebu/pinctrl-armada-xp.c |  2 +-
>  2 files changed, 8 insertions(+), 6 deletions(-)
>
> -- 
> 2.28.0
>

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

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

end of thread, other threads:[~2020-09-23 14:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 21:17 [PATCH v2 0/3] 98dx3236 i2c related fixes Chris Packham
2020-09-07 21:17 ` [PATCH v2 1/3] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Chris Packham
2020-09-12 16:15   ` Linus Walleij
2020-09-07 21:17 ` [PATCH v2 2/3] ARM: dts: Remove non-existent i2c1 from 98dx3236 Chris Packham
2020-09-07 21:17 ` [PATCH v2 3/3] ARM: dts: Add i2c0 pinctrl information for 98dx3236 Chris Packham
2020-09-12 16:16   ` Linus Walleij
2020-09-23  3:08     ` Chris Packham
2020-09-23 12:31       ` Andrew Lunn
2020-09-23 14:38 ` [PATCH v2 0/3] 98dx3236 i2c related fixes Gregory CLEMENT

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).