devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: add pinctrl-single property for Stratix10/Agilex
@ 2023-01-23 19:27 Dinh Nguyen
  2023-01-23 19:27 ` [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl Dinh Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Dinh Nguyen @ 2023-01-23 19:27 UTC (permalink / raw)
  To: robh+dt, mark.rutland, krzysztof.kozlowski
  Cc: dinguyen, devicetree, linux-arm-kernel

The Stratix10/Agilex has a pin control IP that can make use of the
pinctrl-single driver.

Add the pinctrl-single dts property for the Stratix10/Agilex
platforms.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 .../arm64/boot/dts/altera/socfpga_stratix10.dtsi | 16 ++++++++++++++++
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi    | 15 +++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
index 55c5e1fdddc7..b488e8d185f3 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
@@ -353,6 +353,22 @@ pdma: dma-controller@ffda0000 {
 			reset-names = "dma", "dma-ocp";
 		};
 
+		pinctrl0: pinctrl@ffd13000 {
+			compatible = "pinctrl-single";
+			reg = <0xffd13000 0xA0>;
+			#pinctrl-cells = <1>;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0x0000000f>;
+		};
+
+		pinctrl1: pinctrl@ffd13100 {
+			compatible = "pinctrl-single";
+			reg = <0xffd13100 0x20>;
+			#pinctrl-cells = <1>;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0x0000000f>;
+		};
+
 		rst: rstmgr@ffd11000 {
 			#reset-cells = <1>;
 			compatible = "altr,stratix10-rst-mgr";
diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
index 849b46dd8098..f22302a19796 100644
--- a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
+++ b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
@@ -357,6 +357,21 @@ pdma: dma-controller@ffda0000 {
 			clock-names = "apb_pclk";
 		};
 
+		pinctrl0: pinctrl@ffd13000 {
+			compatible = "pinctrl-single";
+			#pinctrl-cells = <1>;
+			reg = <0xffd13000 0xa0>;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0x0000000f>;
+		};
+
+		pinctrl1: pinconf@ffd13100 {
+			compatible = "pinctrl-single";
+			#pinctrl-cells = <1>;
+			reg = <0xffd13100 0x20>;
+			pinctrl-single,register-width = <32>;
+		};
+
 		rst: rstmgr@ffd11000 {
 			#reset-cells = <1>;
 			compatible = "altr,stratix10-rst-mgr";
-- 
2.25.1


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

* [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl
  2023-01-23 19:27 [PATCH 1/2] arm64: dts: add pinctrl-single property for Stratix10/Agilex Dinh Nguyen
@ 2023-01-23 19:27 ` Dinh Nguyen
  2023-01-23 19:30   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Dinh Nguyen @ 2023-01-23 19:27 UTC (permalink / raw)
  To: robh+dt, mark.rutland, krzysztof.kozlowski
  Cc: dinguyen, devicetree, linux-arm-kernel

Add the I2C pins definition to the Stratix10 devkit. This allows for the
I2C driver to use pinctrl on the pins to allow for GPIO recovery.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 .../dts/altera/socfpga_stratix10_socdk.dts    | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
index 17752ca743e5..beda04b9380b 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
@@ -65,6 +65,22 @@ sdmmca-ecc@ff8c8c00 {
 	};
 };
 
+&pinctrl0 {
+	i2c1_pmx_func: i2c1_pmx_func {
+		pinctrl-single,pins = <
+			0x78   0x4   /* I2C1_SDA (IO6-B) PIN30SEL) */
+			0x7c   0x4   /* I2C1_SCL (IO7-B) PIN31SEL */
+		>;
+	};
+
+	i2c1_pmx_func_gpio: i2c1_pmx_func_gpio {
+		pinctrl-single,pins = <
+			0x78   0x8   /* I2C1_SDA (IO6-B) PIN30SEL) */
+			0x7c   0x8   /* I2C1_SCL (IO7-B) PIN31SEL */
+		>;
+	};
+};
+
 &gpio1 {
 	status = "okay";
 };
@@ -131,6 +147,13 @@ &i2c1 {
 	i2c-sda-falling-time-ns = <890>;  /* hcnt */
 	i2c-sdl-falling-time-ns = <890>;  /* lcnt */
 
+	pinctrl-names = "default", "gpio";
+	pinctrl-0 = <&i2c1_pmx_func>;
+	pinctrl-1 = <&i2c1_pmx_func_gpio>;
+
+	scl-gpios = <&portb 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	sda-gpios = <&portb 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+
 	adc@14 {
 		compatible = "lltc,ltc2497";
 		reg = <0x14>;
-- 
2.25.1


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

* Re: [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl
  2023-01-23 19:27 ` [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl Dinh Nguyen
@ 2023-01-23 19:30   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-23 19:30 UTC (permalink / raw)
  To: Dinh Nguyen, robh+dt, mark.rutland; +Cc: devicetree, linux-arm-kernel

On 23/01/2023 20:27, Dinh Nguyen wrote:
> Add the I2C pins definition to the Stratix10 devkit. This allows for the
> I2C driver to use pinctrl on the pins to allow for GPIO recovery.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
>  .../dts/altera/socfpga_stratix10_socdk.dts    | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> index 17752ca743e5..beda04b9380b 100644
> --- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> @@ -65,6 +65,22 @@ sdmmca-ecc@ff8c8c00 {
>  	};
>  };
>  
> +&pinctrl0 {
> +	i2c1_pmx_func: i2c1_pmx_func {

No underscores in node names.

> +		pinctrl-single,pins = <
> +			0x78   0x4   /* I2C1_SDA (IO6-B) PIN30SEL) */
> +			0x7c   0x4   /* I2C1_SCL (IO7-B) PIN31SEL */
> +		>;
> +	};
> +
> +	i2c1_pmx_func_gpio: i2c1_pmx_func_gpio {

Same here.

> +		pinctrl-single,pins = <
> +			0x78   0x8   /* I2C1_SDA (IO6-B) PIN30SEL) */
> +			0x7c   0x8   /* I2C1_SCL (IO7-B) PIN31SEL */
> +		>;
> +	};
> +};
> +
>  &gpio1 {
Best regards,
Krzysztof


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

end of thread, other threads:[~2023-01-23 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 19:27 [PATCH 1/2] arm64: dts: add pinctrl-single property for Stratix10/Agilex Dinh Nguyen
2023-01-23 19:27 ` [PATCH 2/2] arm64: dts: stratix10: add i2c pins for pinctrl Dinh Nguyen
2023-01-23 19:30   ` Krzysztof Kozlowski

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