linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio
@ 2025-05-20 11:51 Christoph Stoidner
  2025-05-20 13:34 ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Stoidner @ 2025-05-20 11:51 UTC (permalink / raw)
  To: Primoz Fiser, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: devicetree, imx, linux-arm-kernel, linux-kernel, upstream,
	Christoph Stoidner

According to the datasheet the phy needs to be held in reset until the
reference clock got stable. Even though no issue was observed, fix this
as the software should always comply with the specification.

Use gpio4 23, which is connected to the phy reset pin. On the same pin
RX_ER was used before, but this signal is optional and can be dropped.

Note: This comes into effect with the phyCOREs SOM hardware revision 4.
In revisions before, this gpio is not connected, and the phy reset is
managed with the global hardware reset circuit.

Signed-off-by: Christoph Stoidner <c.stoidner@phytec.de>
---
Changes in v2:
- remove paragraph "Fix this in the bootloader..." from commit message
- fix checkpatch warning


 arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
index 88c2657b50e6..c08f4b8a65a6 100644
--- a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
@@ -58,6 +58,9 @@ &fec {
 				 <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>,
 				 <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
 	assigned-clock-rates = <100000000>, <50000000>, <50000000>;
+	phy-reset-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
+	phy-reset-duration = <1>;
+	phy-reset-post-delay = <0>;
 	status = "okay";
 
 	mdio: mdio {
@@ -91,14 +94,17 @@ pinctrl_fec: fecgrp {
 		fsl,pins = <
 			MX93_PAD_ENET2_MDC__ENET1_MDC			0x50e
 			MX93_PAD_ENET2_MDIO__ENET1_MDIO			0x502
-			MX93_PAD_ENET2_RD0__ENET1_RGMII_RD0		0x57e
-			MX93_PAD_ENET2_RD1__ENET1_RGMII_RD1		0x57e
-			MX93_PAD_ENET2_RXC__ENET1_RX_ER			0x5fe
+			/* the three pins below are connected to PHYs straps,
+			 * that is what the pull-up/down setting is for.
+			 */
+			MX93_PAD_ENET2_RD0__ENET1_RGMII_RD0		0x37e
+			MX93_PAD_ENET2_RD1__ENET1_RGMII_RD1		0x37e
 			MX93_PAD_ENET2_RX_CTL__ENET1_RGMII_RX_CTL	0x57e
 			MX93_PAD_ENET2_TD0__ENET1_RGMII_TD0		0x50e
 			MX93_PAD_ENET2_TD1__ENET1_RGMII_TD1		0x50e
 			MX93_PAD_ENET2_TX_CTL__ENET1_RGMII_TX_CTL	0x50e
 			MX93_PAD_ENET2_TD2__ENET1_TX_CLK		0x4000050e
+			MX93_PAD_ENET2_RXC__GPIO4_IO23			0x51e
 		>;
 	};
 
-- 
2.43.0


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

* Re: [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio
  2025-05-20 11:51 [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio Christoph Stoidner
@ 2025-05-20 13:34 ` Fabio Estevam
  2025-05-21 12:01   ` Christoph Stoidner
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2025-05-20 13:34 UTC (permalink / raw)
  To: Christoph Stoidner
  Cc: Primoz Fiser, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, devicetree, imx,
	linux-arm-kernel, linux-kernel, upstream

On Tue, May 20, 2025 at 8:52 AM Christoph Stoidner <c.stoidner@phytec.de> wrote:

> diff --git a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> index 88c2657b50e6..c08f4b8a65a6 100644
> --- a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> @@ -58,6 +58,9 @@ &fec {
>                                  <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>,
>                                  <&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;
>         assigned-clock-rates = <100000000>, <50000000>, <50000000>;
> +       phy-reset-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
> +       phy-reset-duration = <1>;
> +       phy-reset-post-delay = <0>;

These properties are marked as deprecated in fsl,fec.yaml.

It would be better to place the properties described by
ethernet-phy.yaml under the ethernet-phy@1 node.

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

* Re: [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio
  2025-05-20 13:34 ` Fabio Estevam
@ 2025-05-21 12:01   ` Christoph Stoidner
  2025-05-24 11:25     ` Christoph Stoidner
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Stoidner @ 2025-05-21 12:01 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Primoz Fiser, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, upstream@lists.phytec.de

On Di, 2025-05-20 at 10:34 -0300, Fabio Estevam wrote:
> On Tue, May 20, 2025 at 8:52 AM Christoph Stoidner
> <c.stoidner@phytec.de> wrote:
> 
> > diff --git a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > index 88c2657b50e6..c08f4b8a65a6 100644
> > --- a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > @@ -58,6 +58,9 @@ &fec {
> >                                  <&clk
> > IMX93_CLK_SYS_PLL_PFD1_DIV2>,
> >                                  <&clk
> > IMX93_CLK_SYS_PLL_PFD1_DIV2>;
> >         assigned-clock-rates = <100000000>, <50000000>, <50000000>;
> > +       phy-reset-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
> > +       phy-reset-duration = <1>;
> > +       phy-reset-post-delay = <0>;
> 
> These properties are marked as deprecated in fsl,fec.yaml.
> 
> It would be better to place the properties described by
> ethernet-phy.yaml under the ethernet-phy@1 node.

Ok, I need to double-check that these do work properly in
u-boot on our platform. I will come back here.

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

* Re: [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio
  2025-05-21 12:01   ` Christoph Stoidner
@ 2025-05-24 11:25     ` Christoph Stoidner
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Stoidner @ 2025-05-24 11:25 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Primoz Fiser, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, upstream@lists.phytec.de

On Mi, 2025-05-21 at 14:01 +0200, Christoph Stoidner wrote:
> On Di, 2025-05-20 at 10:34 -0300, Fabio Estevam wrote:
> > On Tue, May 20, 2025 at 8:52 AM Christoph Stoidner
> > <c.stoidner@phytec.de> wrote:
> > 
> > > diff --git a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > > b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > > index 88c2657b50e6..c08f4b8a65a6 100644
> > > --- a/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > > +++ b/arch/arm64/boot/dts/freescale/imx93-phycore-som.dtsi
> > > @@ -58,6 +58,9 @@ &fec {
> > >                                  <&clk
> > > IMX93_CLK_SYS_PLL_PFD1_DIV2>,
> > >                                  <&clk
> > > IMX93_CLK_SYS_PLL_PFD1_DIV2>;
> > >         assigned-clock-rates = <100000000>, <50000000>,
> > > <50000000>;
> > > +       phy-reset-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
> > > +       phy-reset-duration = <1>;
> > > +       phy-reset-post-delay = <0>;
> > 
> > These properties are marked as deprecated in fsl,fec.yaml.
> > 
> > It would be better to place the properties described by
> > ethernet-phy.yaml under the ethernet-phy@1 node.
> 
> Ok, I need to double-check that these do work properly in
> u-boot on our platform. I will come back here.

Checked, it work. I will send a v3 for it.

Regards,
Christoph


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

end of thread, other threads:[~2025-05-24 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 11:51 [PATCH v2] arm64: dts: freescale: imx93-phycore-som: Delay the phy reset by a gpio Christoph Stoidner
2025-05-20 13:34 ` Fabio Estevam
2025-05-21 12:01   ` Christoph Stoidner
2025-05-24 11:25     ` Christoph Stoidner

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