linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805
@ 2024-10-21  3:11 carlos.song
  2024-10-21  9:27 ` Francesco Dolcini
  0 siblings, 1 reply; 5+ messages in thread
From: carlos.song @ 2024-10-21  3:11 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	frank.li, haibo.chen
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel

From: Carlos Song <carlos.song@nxp.com>

Compatible string "fsl,imx7d-i2c" is not exited at i2c-imx driver
compatible string table, at the result, "fsl,imx21-i2c" will be
matched, but it will cause errata ERR007805 not be applied in fact.

Replace "fsl,imx7d-i2c" by "fsl,imx7s-i2c" compatible string in dts
file for appling the errata ERR007805.

Signed-off-by: Carlos Song <carlos.song@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 arch/arm/boot/dts/nxp/imx/imx7s.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/nxp/imx/imx7s.dtsi b/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
index 22dd72499ef2..6a1d8350192f 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
@@ -1087,7 +1087,7 @@ flexcan2: can@30a10000 {
 			i2c1: i2c@30a20000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx7s-i2c", "fsl,imx21-i2c";
 				reg = <0x30a20000 0x10000>;
 				interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX7D_I2C1_ROOT_CLK>;
@@ -1097,7 +1097,7 @@ i2c1: i2c@30a20000 {
 			i2c2: i2c@30a30000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx7s-i2c", "fsl,imx21-i2c";
 				reg = <0x30a30000 0x10000>;
 				interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX7D_I2C2_ROOT_CLK>;
@@ -1107,7 +1107,7 @@ i2c2: i2c@30a30000 {
 			i2c3: i2c@30a40000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx7s-i2c", "fsl,imx21-i2c";
 				reg = <0x30a40000 0x10000>;
 				interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX7D_I2C3_ROOT_CLK>;
@@ -1117,7 +1117,7 @@ i2c3: i2c@30a40000 {
 			i2c4: i2c@30a50000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-				compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+				compatible = "fsl,imx7s-i2c", "fsl,imx21-i2c";
 				reg = <0x30a50000 0x10000>;
 				interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX7D_I2C4_ROOT_CLK>;
-- 
2.34.1



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

* Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805
  2024-10-21  3:11 [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805 carlos.song
@ 2024-10-21  9:27 ` Francesco Dolcini
  2024-10-21 10:07   ` Carlos Song
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco Dolcini @ 2024-10-21  9:27 UTC (permalink / raw)
  To: carlos.song
  Cc: robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel, festevam,
	frank.li, haibo.chen, devicetree, imx, linux-arm-kernel,
	linux-kernel

Hello Carlos,

On Mon, Oct 21, 2024 at 11:11:48AM +0800, carlos.song@nxp.com wrote:
> From: Carlos Song <carlos.song@nxp.com>
> 
> Compatible string "fsl,imx7d-i2c" is not exited at i2c-imx driver
> compatible string table, at the result, "fsl,imx21-i2c" will be
> matched, but it will cause errata ERR007805 not be applied in fact.
> 
> Replace "fsl,imx7d-i2c" by "fsl,imx7s-i2c" compatible string in dts
> file for appling the errata ERR007805.

Did you considered changing the driver instead? If I understand this
correctly it would be a better solution.

Francesco



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

* Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805
  2024-10-21  9:27 ` Francesco Dolcini
@ 2024-10-21 10:07   ` Carlos Song
  2024-10-22  7:39     ` Francesco Dolcini
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Song @ 2024-10-21 10:07 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, Frank Li, Bough Chen,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Monday, October 21, 2024 5:28 PM
> To: Carlos Song <carlos.song@nxp.com>
> Cc: robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; Frank Li <frank.li@nxp.com>; Bough Chen
> <haibo.chen@nxp.com>; devicetree@vger.kernel.org; imx@lists.linux.dev;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: [EXT] Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for
> applying errata ERR007805
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> Hello Carlos,
> 
> On Mon, Oct 21, 2024 at 11:11:48AM +0800, carlos.song@nxp.com wrote:
> > From: Carlos Song <carlos.song@nxp.com>
> >
> > Compatible string "fsl,imx7d-i2c" is not exited at i2c-imx driver
> > compatible string table, at the result, "fsl,imx21-i2c" will be
> > matched, but it will cause errata ERR007805 not be applied in fact.
> >
> > Replace "fsl,imx7d-i2c" by "fsl,imx7s-i2c" compatible string in dts
> > file for appling the errata ERR007805.
> 
> Did you considered changing the driver instead? If I understand this correctly it
> would be a better solution.
> 
> Francesco

Hi, Francesco

Thank you for your comment.

This errata fix patch has been applied on i2c-imx.c driver:
39c025721d70 i2c: imx: Implement errata ERR007805 or e7805 bus frequency limit

The patch commit log says: this errata is found on all MX7{S,D}, MX6{UL{,L,Z},S{,LL,X},S,D,DL,Q,DP,QP} and MX8M{M,N,P,Q}.
So imx7d and imx7s both needs this errata fix. "fsl,imx7s-i2c" was added into compatible string table in the i2c-imx patch, this is the patch diff snap.
So when "fsl,imx7s-i2c" is matched, the arrata fix will be applied.

@@ -266,6 +282,16 @@ MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
 static const struct of_device_id i2c_imx_dt_ids[] = {
        { .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
        { .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
+       { .compatible = "fsl,imx6q-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx6sl-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx6sll-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx6sx-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx6ul-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx7s-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx8mm-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx8mn-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx8mp-i2c", .data = &imx6_i2c_hwdata, },
+       { .compatible = "fsl,imx8mq-i2c", .data = &imx6_i2c_hwdata, },
        { .compatible = "fsl,vf610-i2c", .data = &vf610_i2c_hwdata, },
        { /* sentinel */ }

However, there is no "fsl,imx7d-i2c" in i2c-imx driver compatible string table, but imx7d and imx7s both needs this errata fix.
Also I find imx7d.dtsi is including the imx7s.dtsi, so I think compatible "fsl,imx7s-i2c" is more reasonable in imx7s.dtsi.

So I add the patch to change i2c node compatible in imx7s.dtsi.

BR
Carlos


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

* Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805
  2024-10-21 10:07   ` Carlos Song
@ 2024-10-22  7:39     ` Francesco Dolcini
  2024-10-22  8:45       ` Carlos Song
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco Dolcini @ 2024-10-22  7:39 UTC (permalink / raw)
  To: Carlos Song
  Cc: Francesco Dolcini, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, Frank Li, Bough Chen,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

On Mon, Oct 21, 2024 at 10:07:23AM +0000, Carlos Song wrote:
> > From: Francesco Dolcini <francesco@dolcini.it>
> > 
> > On Mon, Oct 21, 2024 at 11:11:48AM +0800, carlos.song@nxp.com wrote:
> > > From: Carlos Song <carlos.song@nxp.com>
> > >
> > > Compatible string "fsl,imx7d-i2c" is not exited at i2c-imx driver
> > > compatible string table, at the result, "fsl,imx21-i2c" will be
> > > matched, but it will cause errata ERR007805 not be applied in fact.
> > >
> > > Replace "fsl,imx7d-i2c" by "fsl,imx7s-i2c" compatible string in dts
> > > file for appling the errata ERR007805.
> > 
> > Did you considered changing the driver instead? If I understand this correctly it
> > would be a better solution.
> 
> This errata fix patch has been applied on i2c-imx.c driver: 39c025721d70 i2c:
> imx: Implement errata ERR007805 or e7805 bus frequency limit
> 
> The patch commit log says: this errata is found on all MX7{S,D},
> MX6{UL{,L,Z},S{,LL,X},S,D,DL,Q,DP,QP} and MX8M{M,N,P,Q}.  So imx7d and imx7s
> both needs this errata fix. "fsl,imx7s-i2c" was added into compatible string
> table in the i2c-imx patch, this is the patch diff snap.  So when
> "fsl,imx7s-i2c" is matched, the arrata fix will be applied.

It is clear what you did. What I wrote is that IMO it's not the correct
solution.

Kernel and the FDT can be updated indipendently, with the FDT being part of
the firmware, and you should not expect people to update the FDT to fix
an errata that is implemented in the driver.

My suggestion is that the errata should be applied in the driver to both
compatibles, and such a fix should be backported to stable kernel.

Francesco



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

* Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805
  2024-10-22  7:39     ` Francesco Dolcini
@ 2024-10-22  8:45       ` Carlos Song
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Song @ 2024-10-22  8:45 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, Frank Li, Bough Chen,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Tuesday, October 22, 2024 3:40 PM
> To: Carlos Song <carlos.song@nxp.com>
> Cc: Francesco Dolcini <francesco@dolcini.it>; robh@kernel.org;
> krzk+dt@kernel.org; conor+dt@kernel.org; shawnguo@kernel.org;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> Frank Li <frank.li@nxp.com>; Bough Chen <haibo.chen@nxp.com>;
> devicetree@vger.kernel.org; imx@lists.linux.dev;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: [EXT] Re: [PATCH] ARM: dts: imx7s: change i2c compatible string for
> applying errata ERR007805
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> On Mon, Oct 21, 2024 at 10:07:23AM +0000, Carlos Song wrote:
> > > From: Francesco Dolcini <francesco@dolcini.it>
> > >
> > > On Mon, Oct 21, 2024 at 11:11:48AM +0800, carlos.song@nxp.com wrote:
> > > > From: Carlos Song <carlos.song@nxp.com>
> > > >
> > > > Compatible string "fsl,imx7d-i2c" is not exited at i2c-imx driver
> > > > compatible string table, at the result, "fsl,imx21-i2c" will be
> > > > matched, but it will cause errata ERR007805 not be applied in fact.
> > > >
> > > > Replace "fsl,imx7d-i2c" by "fsl,imx7s-i2c" compatible string in
> > > > dts file for appling the errata ERR007805.
> > >
> > > Did you considered changing the driver instead? If I understand this
> > > correctly it would be a better solution.
> >
> > This errata fix patch has been applied on i2c-imx.c driver: 39c025721d70 i2c:
> > imx: Implement errata ERR007805 or e7805 bus frequency limit
> >
> > The patch commit log says: this errata is found on all MX7{S,D},
> > MX6{UL{,L,Z},S{,LL,X},S,D,DL,Q,DP,QP} and MX8M{M,N,P,Q}.  So imx7d and
> > imx7s both needs this errata fix. "fsl,imx7s-i2c" was added into
> > compatible string table in the i2c-imx patch, this is the patch diff
> > snap.  So when "fsl,imx7s-i2c" is matched, the arrata fix will be applied.
> 
> It is clear what you did. What I wrote is that IMO it's not the correct solution.
> 
> Kernel and the FDT can be updated indipendently, with the FDT being part of the
> firmware, and you should not expect people to update the FDT to fix an errata
> that is implemented in the driver.
> 
> My suggestion is that the errata should be applied in the driver to both
> compatibles, and such a fix should be backported to stable kernel.
> 
> Francesco

Hi, Francesco

Thanks! I get it. I will send V2 patch in i2c-imx.c driver to add one compatible string for imx7d
to fix this errata.

Carlos



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

end of thread, other threads:[~2024-10-22  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21  3:11 [PATCH] ARM: dts: imx7s: change i2c compatible string for applying errata ERR007805 carlos.song
2024-10-21  9:27 ` Francesco Dolcini
2024-10-21 10:07   ` Carlos Song
2024-10-22  7:39     ` Francesco Dolcini
2024-10-22  8:45       ` Carlos Song

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