linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13
@ 2022-07-21 15:29 Alain Volmat
  2022-07-21 15:29 ` [PATCH 1/2] ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Alain Volmat
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alain Volmat @ 2022-07-21 15:29 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, krzysztof.kozlowski+dt,
	linux-arm-kernel, devicetree, linux-kernel, linux-stm32,
	amelie.delaunay

This series adds all i2c nodes for the stm32mp131 platform and
enables i2c1 and i2c5 on the stm32mp135 discovery board.

Alain Volmat (2):
  ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi
  ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts

 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi | 34 +++++++++
 arch/arm/boot/dts/stm32mp131.dtsi        | 90 ++++++++++++++++++++++++
 arch/arm/boot/dts/stm32mp135f-dk.dts     | 26 +++++++
 3 files changed, 150 insertions(+)

-- 
2.25.1


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

* [PATCH 1/2] ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi
  2022-07-21 15:29 [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alain Volmat
@ 2022-07-21 15:29 ` Alain Volmat
  2022-07-21 15:29 ` [PATCH 2/2] ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts Alain Volmat
  2022-08-26  7:52 ` [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Alain Volmat @ 2022-07-21 15:29 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, krzysztof.kozlowski+dt,
	linux-arm-kernel, devicetree, linux-kernel, linux-stm32,
	amelie.delaunay

Add the 5 instances of i2c busses supported by the stm32mp131.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 arch/arm/boot/dts/stm32mp131.dtsi | 90 +++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index 3a921db23e9f..da9e8a6ca663 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -106,6 +106,42 @@ uart4: serial@40010000 {
 			status = "disabled";
 		};
 
+		i2c1: i2c@40012000 {
+			compatible = "st,stm32mp13-i2c";
+			reg = <0x40012000 0x400>;
+			interrupt-names = "event", "error";
+			interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc I2C1_K>;
+			resets = <&rcc I2C1_R>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			dmas = <&dmamux1 33 0x400 0x1>,
+			       <&dmamux1 34 0x400 0x1>;
+			dma-names = "rx", "tx";
+			st,syscfg-fmp = <&syscfg 0x4 0x1>;
+			i2c-analog-filter;
+			status = "disabled";
+		};
+
+		i2c2: i2c@40013000 {
+			compatible = "st,stm32mp13-i2c";
+			reg = <0x40013000 0x400>;
+			interrupt-names = "event", "error";
+			interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc I2C2_K>;
+			resets = <&rcc I2C2_R>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			dmas = <&dmamux1 35 0x400 0x1>,
+			       <&dmamux1 36 0x400 0x1>;
+			dma-names = "rx", "tx";
+			st,syscfg-fmp = <&syscfg 0x4 0x2>;
+			i2c-analog-filter;
+			status = "disabled";
+		};
+
 		dma1: dma-controller@48000000 {
 			compatible = "st,stm32-dma";
 			reg = <0x48000000 0x400>;
@@ -153,6 +189,60 @@ dmamux1: dma-router@48002000 {
 			dma-channels = <16>;
 		};
 
+		i2c3: i2c@4c004000 {
+			compatible = "st,stm32mp13-i2c";
+			reg = <0x4c004000 0x400>;
+			interrupt-names = "event", "error";
+			interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc I2C3_K>;
+			resets = <&rcc I2C3_R>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			dmas = <&dmamux1 73 0x400 0x1>,
+			       <&dmamux1 74 0x400 0x1>;
+			dma-names = "rx", "tx";
+			st,syscfg-fmp = <&syscfg 0x4 0x4>;
+			i2c-analog-filter;
+			status = "disabled";
+		};
+
+		i2c4: i2c@4c005000 {
+			compatible = "st,stm32mp13-i2c";
+			reg = <0x4c005000 0x400>;
+			interrupt-names = "event", "error";
+			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc I2C4_K>;
+			resets = <&rcc I2C4_R>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			dmas = <&dmamux1 75 0x400 0x1>,
+			       <&dmamux1 76 0x400 0x1>;
+			dma-names = "rx", "tx";
+			st,syscfg-fmp = <&syscfg 0x4 0x8>;
+			i2c-analog-filter;
+			status = "disabled";
+		};
+
+		i2c5: i2c@4c006000 {
+			compatible = "st,stm32mp13-i2c";
+			reg = <0x4c006000 0x400>;
+			interrupt-names = "event", "error";
+			interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rcc I2C5_K>;
+			resets = <&rcc I2C5_R>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			dmas = <&dmamux1 115 0x400 0x1>,
+			       <&dmamux1 116 0x400 0x1>;
+			dma-names = "rx", "tx";
+			st,syscfg-fmp = <&syscfg 0x4 0x10>;
+			i2c-analog-filter;
+			status = "disabled";
+		};
+
 		rcc: rcc@50000000 {
 			compatible = "st,stm32mp13-rcc", "syscon";
 			reg = <0x50000000 0x1000>;
-- 
2.25.1


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

* [PATCH 2/2] ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts
  2022-07-21 15:29 [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alain Volmat
  2022-07-21 15:29 ` [PATCH 1/2] ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Alain Volmat
@ 2022-07-21 15:29 ` Alain Volmat
  2022-08-26  7:52 ` [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Alain Volmat @ 2022-07-21 15:29 UTC (permalink / raw)
  To: alexandre.torgue
  Cc: robh+dt, mcoquelin.stm32, krzysztof.kozlowski+dt,
	linux-arm-kernel, devicetree, linux-kernel, linux-stm32,
	amelie.delaunay

Enable the two i2c busses i2c1 and i2c5 available on the
stm32mp135f-dk Discovery board.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi | 34 ++++++++++++++++++++++++
 arch/arm/boot/dts/stm32mp135f-dk.dts     | 26 ++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
index d2472cd8f1d0..749078ba9d42 100644
--- a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
@@ -6,6 +6,40 @@
 #include <dt-bindings/pinctrl/stm32-pinfunc.h>
 
 &pinctrl {
+	i2c1_pins_a: i2c1-0 {
+		pins {
+			pinmux = <STM32_PINMUX('D', 12, AF5)>, /* I2C1_SCL */
+				 <STM32_PINMUX('E', 8, AF5)>; /* I2C1_SDA */
+			bias-disable;
+			drive-open-drain;
+			slew-rate = <0>;
+		};
+	};
+
+	i2c1_sleep_pins_a: i2c1-sleep-0 {
+		pins {
+			pinmux = <STM32_PINMUX('D', 12, ANALOG)>, /* I2C1_SCL */
+				 <STM32_PINMUX('E', 8, ANALOG)>; /* I2C1_SDA */
+		};
+	};
+
+	i2c5_pins_a: i2c5-0 {
+		pins {
+			pinmux = <STM32_PINMUX('D', 1, AF4)>, /* I2C5_SCL */
+				 <STM32_PINMUX('H', 6, AF4)>; /* I2C5_SDA */
+			bias-disable;
+			drive-open-drain;
+			slew-rate = <0>;
+		};
+	};
+
+	i2c5_sleep_pins_a: i2c5-sleep-0 {
+		pins {
+			pinmux = <STM32_PINMUX('D', 1, ANALOG)>, /* I2C5_SCL */
+				 <STM32_PINMUX('H', 6, ANALOG)>; /* I2C5_SDA */
+		};
+	};
+
 	sdmmc1_b4_pins_a: sdmmc1-b4-0 {
 		pins {
 			pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1_D0 */
diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index e6b8ffd332c7..3e2823332d51 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -68,6 +68,32 @@ vdd_sd: vdd-sd {
 	};
 };
 
+&i2c1 {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&i2c1_pins_a>;
+	pinctrl-1 = <&i2c1_sleep_pins_a>;
+	i2c-scl-rising-time-ns = <96>;
+	i2c-scl-falling-time-ns = <3>;
+	clock-frequency = <1000000>;
+	status = "okay";
+	/* spare dmas for other usage */
+	/delete-property/dmas;
+	/delete-property/dma-names;
+};
+
+&i2c5 {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&i2c5_pins_a>;
+	pinctrl-1 = <&i2c5_sleep_pins_a>;
+	i2c-scl-rising-time-ns = <170>;
+	i2c-scl-falling-time-ns = <5>;
+	clock-frequency = <400000>;
+	status = "okay";
+	/* spare dmas for other usage */
+	/delete-property/dmas;
+	/delete-property/dma-names;
+};
+
 &iwdg2 {
 	timeout-sec = <32>;
 	status = "okay";
-- 
2.25.1


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

* Re: [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13
  2022-07-21 15:29 [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alain Volmat
  2022-07-21 15:29 ` [PATCH 1/2] ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Alain Volmat
  2022-07-21 15:29 ` [PATCH 2/2] ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts Alain Volmat
@ 2022-08-26  7:52 ` Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre TORGUE @ 2022-08-26  7:52 UTC (permalink / raw)
  To: Alain Volmat
  Cc: robh+dt, mcoquelin.stm32, krzysztof.kozlowski+dt,
	linux-arm-kernel, devicetree, linux-kernel, linux-stm32,
	amelie.delaunay

Hi Alain

On 7/21/22 17:29, Alain Volmat wrote:
> This series adds all i2c nodes for the stm32mp131 platform and
> enables i2c1 and i2c5 on the stm32mp135 discovery board.
> 
> Alain Volmat (2):
>    ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi
>    ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts
> 
>   arch/arm/boot/dts/stm32mp13-pinctrl.dtsi | 34 +++++++++
>   arch/arm/boot/dts/stm32mp131.dtsi        | 90 ++++++++++++++++++++++++
>   arch/arm/boot/dts/stm32mp135f-dk.dts     | 26 +++++++
>   3 files changed, 150 insertions(+)
> 

Series applied on stm32-next.

Regards
Alex

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

end of thread, other threads:[~2022-08-26  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 15:29 [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alain Volmat
2022-07-21 15:29 ` [PATCH 1/2] ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi Alain Volmat
2022-07-21 15:29 ` [PATCH 2/2] ARM: dts: stm32: enable i2c1 and i2c5 on stm32mp135f-dk.dts Alain Volmat
2022-08-26  7:52 ` [PATCH 0/2] ARM: dts: stm32: add i2c in STM32MP13 Alexandre TORGUE

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