devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes
@ 2024-10-25  9:58 Stefan Eichenberger
  2024-10-25  9:58 ` [PATCH v1 1/2] arm64: dts: imx8mm-verdin: " Stefan Eichenberger
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stefan Eichenberger @ 2024-10-25  9:58 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel

Add the single-master property to all i2c nodes on the iMX8MM and iMX8MP
Verdin modules. This will allow us to use some single-master
optimisations on the i2c driver. Together with the following series, now
in the i2c-host branch of Andis tree, we get rid of a timeout problem on
the i2c bus with a SMBus ADC:
https://lore.kernel.org/all/7ts577rxed4mmfkfin7kfdjfjkb6iak2y4vtgtz6merwxkzz6w@h5aefbvyx44u/

Stefan Eichenberger (2):
  arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
  arm64: dts: imx8mp-verdin: add single-master property to all i2c nodes

 arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 4 ++++
 arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi | 5 +++++
 2 files changed, 9 insertions(+)

-- 
2.43.0


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

* [PATCH v1 1/2] arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
  2024-10-25  9:58 [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes Stefan Eichenberger
@ 2024-10-25  9:58 ` Stefan Eichenberger
  2024-11-02  4:52   ` Shawn Guo
  2024-10-25  9:58 ` [PATCH v1 2/2] arm64: dts: imx8mp-verdin: " Stefan Eichenberger
  2024-11-03  8:56 ` [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: " Shawn Guo
  2 siblings, 1 reply; 7+ messages in thread
From: Stefan Eichenberger @ 2024-10-25  9:58 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel,
	Stefan Eichenberger

From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
 arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
index 5fa3959141911..95d5d2333ca1e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
@@ -367,6 +367,7 @@ &i2c1 {
 	pinctrl-1 = <&pinctrl_i2c1_gpio>;
 	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 	status = "okay";
 
 	pca9450: pmic@25 {
@@ -561,6 +562,7 @@ &i2c2 {
 	pinctrl-1 = <&pinctrl_i2c2_gpio>;
 	scl-gpios = <&gpio5 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 	status = "disabled";
 };
 
@@ -574,6 +576,7 @@ &i2c3 {
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
 	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 };
 
 /* Verdin I2C_1 */
@@ -584,6 +587,7 @@ &i2c4 {
 	pinctrl-1 = <&pinctrl_i2c4_gpio>;
 	scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 
 	gpio_expander_21: gpio-expander@21 {
 		compatible = "nxp,pcal6416";
-- 
2.43.0


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

* [PATCH v1 2/2] arm64: dts: imx8mp-verdin: add single-master property to all i2c nodes
  2024-10-25  9:58 [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes Stefan Eichenberger
  2024-10-25  9:58 ` [PATCH v1 1/2] arm64: dts: imx8mm-verdin: " Stefan Eichenberger
@ 2024-10-25  9:58 ` Stefan Eichenberger
  2024-11-03  8:56 ` [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: " Shawn Guo
  2 siblings, 0 replies; 7+ messages in thread
From: Stefan Eichenberger @ 2024-10-25  9:58 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel,
	Stefan Eichenberger

From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

By default we expect all i2c nodes to be single-master, we do not have
any module or carrier board that uses multi-master mode on any i2c
controller. With this property set, we benefit from optimisations made
exclusively for single-masters.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
 arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
index a19ad5ee7f792..323b45bac281e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
@@ -478,6 +478,7 @@ &i2c1 {
 	pinctrl-1 = <&pinctrl_i2c1_gpio>;
 	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 	status = "okay";
 
 	pca9450: pmic@25 {
@@ -669,6 +670,7 @@ &i2c2 {
 	pinctrl-1 = <&pinctrl_i2c2_gpio>;
 	scl-gpios = <&gpio5 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 
 	atmel_mxt_ts_mezzanine: touch-mezzanine@4a {
 		compatible = "atmel,maxtouch";
@@ -690,6 +692,7 @@ &i2c3 {
 	pinctrl-1 = <&pinctrl_i2c3_gpio>;
 	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 };
 
 /* Verdin I2C_1 */
@@ -700,6 +703,7 @@ &i2c4 {
 	pinctrl-1 = <&pinctrl_i2c4_gpio>;
 	scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 
 	gpio_expander_21: gpio-expander@21 {
 		compatible = "nxp,pcal6416";
@@ -788,6 +792,7 @@ &i2c5 {
 	pinctrl-1 = <&pinctrl_i2c5_gpio>;
 	scl-gpios = <&gpio3 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
 	sda-gpios = <&gpio3 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+	single-master;
 };
 
 /* Verdin PCIE_1 */
-- 
2.43.0


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

* Re: [PATCH v1 1/2] arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
  2024-10-25  9:58 ` [PATCH v1 1/2] arm64: dts: imx8mm-verdin: " Stefan Eichenberger
@ 2024-11-02  4:52   ` Shawn Guo
  2024-11-02 14:31     ` Stefan Eichenberger
  0 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2024-11-02  4:52 UTC (permalink / raw)
  To: Stefan Eichenberger
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel, Stefan Eichenberger

On Fri, Oct 25, 2024 at 11:58:02AM +0200, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> 
> By default we expect all i2c nodes to be single-master, we do not have
> any module or carrier board that uses multi-master mode on any i2c
> controller. With this property set, we benefit from optimisations made
> exclusively for single-masters.
> 
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> index 5fa3959141911..95d5d2333ca1e 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> @@ -367,6 +367,7 @@ &i2c1 {
>  	pinctrl-1 = <&pinctrl_i2c1_gpio>;
>  	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
>  	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +	single-master;

Hmm, I do not see this property is documented in i2c-imx bindings.

Shawn

>  	status = "okay";
>  
>  	pca9450: pmic@25 {
> @@ -561,6 +562,7 @@ &i2c2 {
>  	pinctrl-1 = <&pinctrl_i2c2_gpio>;
>  	scl-gpios = <&gpio5 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
>  	sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +	single-master;
>  	status = "disabled";
>  };
>  
> @@ -574,6 +576,7 @@ &i2c3 {
>  	pinctrl-1 = <&pinctrl_i2c3_gpio>;
>  	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
>  	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +	single-master;
>  };
>  
>  /* Verdin I2C_1 */
> @@ -584,6 +587,7 @@ &i2c4 {
>  	pinctrl-1 = <&pinctrl_i2c4_gpio>;
>  	scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
>  	sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> +	single-master;
>  
>  	gpio_expander_21: gpio-expander@21 {
>  		compatible = "nxp,pcal6416";
> -- 
> 2.43.0
> 


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

* Re: [PATCH v1 1/2] arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
  2024-11-02  4:52   ` Shawn Guo
@ 2024-11-02 14:31     ` Stefan Eichenberger
  2024-11-03  8:56       ` Shawn Guo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Eichenberger @ 2024-11-02 14:31 UTC (permalink / raw)
  To: Shawn Guo
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel, Stefan Eichenberger

Hi Shawn,

On Sat, Nov 02, 2024 at 12:52:08PM +0800, Shawn Guo wrote:
> On Fri, Oct 25, 2024 at 11:58:02AM +0200, Stefan Eichenberger wrote:
> > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > 
> > By default we expect all i2c nodes to be single-master, we do not have
> > any module or carrier board that uses multi-master mode on any i2c
> > controller. With this property set, we benefit from optimisations made
> > exclusively for single-masters.
> > 
> > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > ---
> >  arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > index 5fa3959141911..95d5d2333ca1e 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > @@ -367,6 +367,7 @@ &i2c1 {
> >  	pinctrl-1 = <&pinctrl_i2c1_gpio>;
> >  	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> >  	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> > +	single-master;
> 
> Hmm, I do not see this property is documented in i2c-imx bindings.

According to the discussion we had in this thread
https://lore.kernel.org/linux-i2c/2bbddaxyjkxfmlgmq3yqcbzo7dsb2pq5bvdatk2y4ig4iintkt@35btqkdv7sy3/
it is not necessary to have the property documentation in the i2c-imx
binding because it is already documented in the dt-schema:
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/i2c/i2c-controller.yaml
In the initial discussion, it was addressed for multi-master setups, but
it also applies for single-master. See also this discussion:
https://lore.kernel.org/all/bcdd6cae28edd9dd05a71118f9979e7460688775.camel@pengutronix.de/

Let me know if I have missed anything or misunderstood.

Regards,
Stefan

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

* Re: [PATCH v1 1/2] arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
  2024-11-02 14:31     ` Stefan Eichenberger
@ 2024-11-03  8:56       ` Shawn Guo
  0 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2024-11-03  8:56 UTC (permalink / raw)
  To: Stefan Eichenberger
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel, Stefan Eichenberger

On Sat, Nov 02, 2024 at 03:31:56PM +0100, Stefan Eichenberger wrote:
> Hi Shawn,
> 
> On Sat, Nov 02, 2024 at 12:52:08PM +0800, Shawn Guo wrote:
> > On Fri, Oct 25, 2024 at 11:58:02AM +0200, Stefan Eichenberger wrote:
> > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > 
> > > By default we expect all i2c nodes to be single-master, we do not have
> > > any module or carrier board that uses multi-master mode on any i2c
> > > controller. With this property set, we benefit from optimisations made
> > > exclusively for single-masters.
> > > 
> > > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > ---
> > >  arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > > index 5fa3959141911..95d5d2333ca1e 100644
> > > --- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > > +++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
> > > @@ -367,6 +367,7 @@ &i2c1 {
> > >  	pinctrl-1 = <&pinctrl_i2c1_gpio>;
> > >  	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> > >  	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> > > +	single-master;
> > 
> > Hmm, I do not see this property is documented in i2c-imx bindings.
> 
> According to the discussion we had in this thread
> https://lore.kernel.org/linux-i2c/2bbddaxyjkxfmlgmq3yqcbzo7dsb2pq5bvdatk2y4ig4iintkt@35btqkdv7sy3/
> it is not necessary to have the property documentation in the i2c-imx
> binding because it is already documented in the dt-schema:
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/i2c/i2c-controller.yaml

Ah, thanks for the info!

Shawn


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

* Re: [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes
  2024-10-25  9:58 [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes Stefan Eichenberger
  2024-10-25  9:58 ` [PATCH v1 1/2] arm64: dts: imx8mm-verdin: " Stefan Eichenberger
  2024-10-25  9:58 ` [PATCH v1 2/2] arm64: dts: imx8mp-verdin: " Stefan Eichenberger
@ 2024-11-03  8:56 ` Shawn Guo
  2 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2024-11-03  8:56 UTC (permalink / raw)
  To: Stefan Eichenberger
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	francesco.dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel

On Fri, Oct 25, 2024 at 11:58:01AM +0200, Stefan Eichenberger wrote:
> Add the single-master property to all i2c nodes on the iMX8MM and iMX8MP
> Verdin modules. This will allow us to use some single-master
> optimisations on the i2c driver. Together with the following series, now
> in the i2c-host branch of Andis tree, we get rid of a timeout problem on
> the i2c bus with a SMBus ADC:
> https://lore.kernel.org/all/7ts577rxed4mmfkfin7kfdjfjkb6iak2y4vtgtz6merwxkzz6w@h5aefbvyx44u/
> 
> Stefan Eichenberger (2):
>   arm64: dts: imx8mm-verdin: add single-master property to all i2c nodes
>   arm64: dts: imx8mp-verdin: add single-master property to all i2c nodes

Applied both, thanks!


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

end of thread, other threads:[~2024-11-03  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25  9:58 [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: add single-master property to all i2c nodes Stefan Eichenberger
2024-10-25  9:58 ` [PATCH v1 1/2] arm64: dts: imx8mm-verdin: " Stefan Eichenberger
2024-11-02  4:52   ` Shawn Guo
2024-11-02 14:31     ` Stefan Eichenberger
2024-11-03  8:56       ` Shawn Guo
2024-10-25  9:58 ` [PATCH v1 2/2] arm64: dts: imx8mp-verdin: " Stefan Eichenberger
2024-11-03  8:56 ` [PATCH v1 0/2] arm64: dts: imx8mm/imx8mp-verdin: " Shawn Guo

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