linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix TWSI on MMC2
@ 2018-09-17 11:39 Lubomir Rintel
  2018-09-17 11:39 ` [PATCH 1/2] DT: marvell,mmp2: fix TWSI2 Lubomir Rintel
  2018-09-17 11:39 ` [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers Lubomir Rintel
  0 siblings, 2 replies; 5+ messages in thread
From: Lubomir Rintel @ 2018-09-17 11:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-arm-kernel, devicetree

This makes TWSI work on an OPLC 1.75 that is a DT MMP2 platform.

Thanks,
Lubo



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

* [PATCH 1/2] DT: marvell,mmp2: fix TWSI2
  2018-09-17 11:39 [PATCH 0/2] Fix TWSI on MMC2 Lubomir Rintel
@ 2018-09-17 11:39 ` Lubomir Rintel
  2018-11-03 19:05   ` Pavel Machek
  2018-09-17 11:39 ` [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers Lubomir Rintel
  1 sibling, 1 reply; 5+ messages in thread
From: Lubomir Rintel @ 2018-09-17 11:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, devicetree, Lubomir Rintel, Eric Miao,
	Haojian Zhuang, Rob Herring, Mark Rutland

Marvell keeps their MMP2 datasheet secret, but there are good clues
that TWSI2 is not on 0xd4025000 on that platform, not does it use
IRQ 58. In fact, the IRQ 58 on MMP2 seems to be a signal processor:

   arch/arm/mach-mmp/irqs.h:#define IRQ_MMP2_MSP  58

I'm taking a somewhat educated guess that is probably a copy & paste
error from PXA168 or PXA910 and that the real controller in fact hides
at address 0xd4031000 and uses an interrupt line multiplexed via IRQ 17.

I'm also copying some properties from TWSI1 that were missing or
incorrect.

Tested on a OLPC XO 1.75 machine, where the RTC is on TWSI2.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 arch/arm/boot/dts/mmp2.dtsi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
index 766bbb8495b6..47e5b63339d1 100644
--- a/arch/arm/boot/dts/mmp2.dtsi
+++ b/arch/arm/boot/dts/mmp2.dtsi
@@ -220,12 +220,15 @@
 				status = "disabled";
 			};
 
-			twsi2: i2c@d4025000 {
+			twsi2: i2c@d4031000 {
 				compatible = "mrvl,mmp-twsi";
-				reg = <0xd4025000 0x1000>;
-				interrupts = <58>;
+				reg = <0xd4031000 0x1000>;
+				interrupt-parent = <&intcmux17>;
+				interrupts = <0>;
 				clocks = <&soc_clocks MMP2_CLK_TWSI1>;
 				resets = <&soc_clocks MMP2_CLK_TWSI1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
 				status = "disabled";
 			};
 
-- 
2.17.1


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

* [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers
  2018-09-17 11:39 [PATCH 0/2] Fix TWSI on MMC2 Lubomir Rintel
  2018-09-17 11:39 ` [PATCH 1/2] DT: marvell,mmp2: fix TWSI2 Lubomir Rintel
@ 2018-09-17 11:39 ` Lubomir Rintel
  2018-11-03 19:05   ` Pavel Machek
  1 sibling, 1 reply; 5+ messages in thread
From: Lubomir Rintel @ 2018-09-17 11:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, devicetree, Lubomir Rintel, Eric Miao,
	Haojian Zhuang, Rob Herring, Mark Rutland

I've gotten the base addresses, clocks and interrupts from an rusty and old
out-of-tree driver. I haven't actually checked against the datasheet, since
that one is reserved for the Marvell inner circle.

Tested with an accelerometer on TWSI6 on an OLPC XO 1.75 machine.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 arch/arm/boot/dts/mmp2.dtsi | 49 +++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
index 47e5b63339d1..2bd4e94501ce 100644
--- a/arch/arm/boot/dts/mmp2.dtsi
+++ b/arch/arm/boot/dts/mmp2.dtsi
@@ -232,6 +232,55 @@
 				status = "disabled";
 			};
 
+			twsi3: i2c@d4032000 {
+				compatible = "mrvl,mmp-twsi";
+				reg = <0xd4032000 0x1000>;
+				interrupt-parent = <&intcmux17>;
+				interrupts = <1>;
+				clocks = <&soc_clocks MMP2_CLK_TWSI2>;
+				resets = <&soc_clocks MMP2_CLK_TWSI2>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			twsi4: i2c@d4033000 {
+				compatible = "mrvl,mmp-twsi";
+				reg = <0xd4033000 0x1000>;
+				interrupt-parent = <&intcmux17>;
+				interrupts = <2>;
+				clocks = <&soc_clocks MMP2_CLK_TWSI3>;
+				resets = <&soc_clocks MMP2_CLK_TWSI3>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+
+			twsi5: i2c@d4033800 {
+				compatible = "mrvl,mmp-twsi";
+				reg = <0xd4033800 0x1000>;
+				interrupt-parent = <&intcmux17>;
+				interrupts = <3>;
+				clocks = <&soc_clocks MMP2_CLK_TWSI4>;
+				resets = <&soc_clocks MMP2_CLK_TWSI4>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
+			twsi6: i2c@d4034000 {
+				compatible = "mrvl,mmp-twsi";
+				reg = <0xd4034000 0x1000>;
+				interrupt-parent = <&intcmux17>;
+				interrupts = <4>;
+				clocks = <&soc_clocks MMP2_CLK_TWSI5>;
+				resets = <&soc_clocks MMP2_CLK_TWSI5>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
 			rtc: rtc@d4010000 {
 				compatible = "mrvl,mmp-rtc";
 				reg = <0xd4010000 0x1000>;
-- 
2.17.1


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

* Re: [PATCH 1/2] DT: marvell,mmp2: fix TWSI2
  2018-09-17 11:39 ` [PATCH 1/2] DT: marvell,mmp2: fix TWSI2 Lubomir Rintel
@ 2018-11-03 19:05   ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2018-11-03 19:05 UTC (permalink / raw)
  To: Lubomir Rintel
  Cc: linux-kernel, linux-arm-kernel, devicetree, Eric Miao,
	Haojian Zhuang, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

On Mon 2018-09-17 13:39:46, Lubomir Rintel wrote:
> Marvell keeps their MMP2 datasheet secret, but there are good clues
> that TWSI2 is not on 0xd4025000 on that platform, not does it use
> IRQ 58. In fact, the IRQ 58 on MMP2 seems to be a signal processor:
> 
>    arch/arm/mach-mmp/irqs.h:#define IRQ_MMP2_MSP  58
> 
> I'm taking a somewhat educated guess that is probably a copy & paste
> error from PXA168 or PXA910 and that the real controller in fact hides
> at address 0xd4031000 and uses an interrupt line multiplexed via IRQ 17.
> 
> I'm also copying some properties from TWSI1 that were missing or
> incorrect.
> 
> Tested on a OLPC XO 1.75 machine, where the RTC is on TWSI2.
> 
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Acked-by: Pavel Machek <pavel@ucw.cz>

>  				status = "disabled";
>  			};
>  
> -			twsi2: i2c@d4025000 {
> +			twsi2: i2c@d4031000 {
>  				compatible = "mrvl,mmp-twsi";
> -				reg = <0xd4025000 0x1000>;
> -				interrupts = <58>;
> +				reg = <0xd4031000 0x1000>;
> +				interrupt-parent = <&intcmux17>;
> +				interrupts = <0>;
>  				clocks = <&soc_clocks MMP2_CLK_TWSI1>;
>  				resets = <&soc_clocks MMP2_CLK_TWSI1>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
>  				status = "disabled";
>  			};
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers
  2018-09-17 11:39 ` [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers Lubomir Rintel
@ 2018-11-03 19:05   ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2018-11-03 19:05 UTC (permalink / raw)
  To: Lubomir Rintel
  Cc: linux-kernel, linux-arm-kernel, devicetree, Eric Miao,
	Haojian Zhuang, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 2689 bytes --]

On Mon 2018-09-17 13:39:47, Lubomir Rintel wrote:
> I've gotten the base addresses, clocks and interrupts from an rusty and old
> out-of-tree driver. I haven't actually checked against the datasheet, since
> that one is reserved for the Marvell inner circle.
> 
> Tested with an accelerometer on TWSI6 on an OLPC XO 1.75 machine.
> 
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Acked-by: Pavel Machek <pavel@ucw.cz>

> ---
>  arch/arm/boot/dts/mmp2.dtsi | 49 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
> index 47e5b63339d1..2bd4e94501ce 100644
> --- a/arch/arm/boot/dts/mmp2.dtsi
> +++ b/arch/arm/boot/dts/mmp2.dtsi
> @@ -232,6 +232,55 @@
>  				status = "disabled";
>  			};
>  
> +			twsi3: i2c@d4032000 {
> +				compatible = "mrvl,mmp-twsi";
> +				reg = <0xd4032000 0x1000>;
> +				interrupt-parent = <&intcmux17>;
> +				interrupts = <1>;
> +				clocks = <&soc_clocks MMP2_CLK_TWSI2>;
> +				resets = <&soc_clocks MMP2_CLK_TWSI2>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				status = "disabled";
> +			};
> +
> +			twsi4: i2c@d4033000 {
> +				compatible = "mrvl,mmp-twsi";
> +				reg = <0xd4033000 0x1000>;
> +				interrupt-parent = <&intcmux17>;
> +				interrupts = <2>;
> +				clocks = <&soc_clocks MMP2_CLK_TWSI3>;
> +				resets = <&soc_clocks MMP2_CLK_TWSI3>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				status = "disabled";
> +			};
> +
> +
> +			twsi5: i2c@d4033800 {
> +				compatible = "mrvl,mmp-twsi";
> +				reg = <0xd4033800 0x1000>;
> +				interrupt-parent = <&intcmux17>;
> +				interrupts = <3>;
> +				clocks = <&soc_clocks MMP2_CLK_TWSI4>;
> +				resets = <&soc_clocks MMP2_CLK_TWSI4>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				status = "disabled";
> +			};
> +
> +			twsi6: i2c@d4034000 {
> +				compatible = "mrvl,mmp-twsi";
> +				reg = <0xd4034000 0x1000>;
> +				interrupt-parent = <&intcmux17>;
> +				interrupts = <4>;
> +				clocks = <&soc_clocks MMP2_CLK_TWSI5>;
> +				resets = <&soc_clocks MMP2_CLK_TWSI5>;
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				status = "disabled";
> +			};
> +
>  			rtc: rtc@d4010000 {
>  				compatible = "mrvl,mmp-rtc";
>  				reg = <0xd4010000 0x1000>;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2018-11-03 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 11:39 [PATCH 0/2] Fix TWSI on MMC2 Lubomir Rintel
2018-09-17 11:39 ` [PATCH 1/2] DT: marvell,mmp2: fix TWSI2 Lubomir Rintel
2018-11-03 19:05   ` Pavel Machek
2018-09-17 11:39 ` [PATCH 2/2] DT: marvell,mmp2: add more TWSI controllers Lubomir Rintel
2018-11-03 19:05   ` Pavel Machek

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