diff mbox series

imx8mn-var-som: dts: fix PHY detection bug by adding deassert delay

Message ID 20230427195538.2718661-1-hugo@hugovil.com (mailing list archive)
State New, archived
Headers show
Series imx8mn-var-som: dts: fix PHY detection bug by adding deassert delay | expand

Commit Message

Hugo Villeneuve April 27, 2023, 7:55 p.m. UTC
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

While testing the ethernet interface on a symphony carrier
board using an imx8mn SOM with an onboard PHY (EC hardware
configuration), the ethernet PHY is not detected.

The device tree in Variscite custom linux git repository uses the
following property:

    phy-reset-post-delay = <20>;

Add a new property 'reset-deassert-us' of 20ms to have the same delay
inside the ethphy phandle.

Adding this property fixes the problem with the PHY detection.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi | 1 +
 1 file changed, 1 insertion(+)

Comments

Fabio Estevam April 27, 2023, 8 p.m. UTC | #1
Hi Hugo,

On Thu, Apr 27, 2023 at 4:56 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
>
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> While testing the ethernet interface on a symphony carrier
> board using an imx8mn SOM with an onboard PHY (EC hardware
> configuration), the ethernet PHY is not detected.
>
> The device tree in Variscite custom linux git repository uses the
> following property:
>
>     phy-reset-post-delay = <20>;
>
> Add a new property 'reset-deassert-us' of 20ms to have the same delay
> inside the ethphy handle.

Which Ethernet PHY does this board use?

What does its datasheet recommend?
Hugo Villeneuve April 27, 2023, 8:06 p.m. UTC | #2
On Thu, 27 Apr 2023 17:00:41 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> Hi Hugo,
> 
> On Thu, Apr 27, 2023 at 4:56 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> >
> > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >
> > While testing the ethernet interface on a symphony carrier
> > board using an imx8mn SOM with an onboard PHY (EC hardware
> > configuration), the ethernet PHY is not detected.
> >
> > The device tree in Variscite custom linux git repository uses the
> > following property:
> >
> >     phy-reset-post-delay = <20>;
> >
> > Add a new property 'reset-deassert-us' of 20ms to have the same delay
> > inside the ethphy handle.
> 
> Which Ethernet PHY does this board use?
> 
> What does its datasheet recommend?

Hi Fabio,
it uses a ADIN1300 PHY.

The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.

Hugo.
Fabio Estevam April 27, 2023, 8:07 p.m. UTC | #3
On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:

> Hi Fabio,
> it uses a ADIN1300 PHY.
>
> The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.

Please add this information to the commit log and please add a Fixes: tag.

Thanks
Hugo Villeneuve April 27, 2023, 8:12 p.m. UTC | #4
On Thu, 27 Apr 2023 17:07:59 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> 
> > Hi Fabio,
> > it uses a ADIN1300 PHY.
> >
> > The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
> 
> Please add this information to the commit log and please add a Fixes: tag.

Good idea, will do.

Hugo.
Ahmad Fatoum April 27, 2023, 8:16 p.m. UTC | #5
On 27.04.23 22:12, Hugo Villeneuve wrote:
> On Thu, 27 Apr 2023 17:07:59 -0300
> Fabio Estevam <festevam@gmail.com> wrote:
> 
>> On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
>>
>>> Hi Fabio,
>>> it uses a ADIN1300 PHY.
>>>
>>> The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
>>
>> Please add this information to the commit log and please add a Fixes: tag.
> 
> Good idea, will do.

Please also add the PHY name into the DT, e.g.:

  ethphy: ethernet-phy@4 { /* ADIN1300 */

I find this very useful when bringing up a new board and looking
for similar DTs.

Thanks,
Ahmad

> 
> Hugo.
> 
>
Hugo Villeneuve April 27, 2023, 8:22 p.m. UTC | #6
On Thu, 27 Apr 2023 17:07:59 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> 
> > Hi Fabio,
> > it uses a ADIN1300 PHY.
> >
> > The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
> 
> Please add this information to the commit log and please add a Fixes: tag.
> 
> Thanks

Hi,
I am trying to properly add a "Fixes: " tag, but the description for this tag indicates that it is to report that "the patch fixes an issue in a previous commit".

In this case, I cannot identify a commit that introduced that bug, apart from the initial commit of the DTS file which didn't have the reset property present?

Thank you,
Hugo.
Fabio Estevam April 27, 2023, 8:51 p.m. UTC | #7
On Thu, Apr 27, 2023 at 5:22 PM Hugo Villeneuve <hugo@hugovil.com> wrote:

> Hi,
> I am trying to properly add a "Fixes: " tag, but the description for this tag indicates that it is to report that "the patch fixes an issue in a previous commit".
>
> In this case, I cannot identify a commit that introduced that bug, apart from the initial commit of the DTS file which didn't have the reset property present?

You can add:

Fixes: ade0176dd8a0 ("arm64: dts: imx8mn-var-som: Add Variscite
VAR-SOM-MX8MN System on Module")
Andrew Lunn April 27, 2023, 8:56 p.m. UTC | #8
On Thu, Apr 27, 2023 at 04:22:51PM -0400, Hugo Villeneuve wrote:
> On Thu, 27 Apr 2023 17:07:59 -0300
> Fabio Estevam <festevam@gmail.com> wrote:
> 
> > On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> > 
> > > Hi Fabio,
> > > it uses a ADIN1300 PHY.
> > >
> > > The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
> > 
> > Please add this information to the commit log and please add a Fixes: tag.
> > 
> > Thanks
> 
> Hi,
> I am trying to properly add a "Fixes: " tag, but the description for this tag indicates that it is to report that "the patch fixes an issue in a previous commit".
> 
> In this case, I cannot identify a commit that introduced that bug, apart from the initial commit of the DTS file which didn't have the reset property present?

Is the PHY on the SOM or the carrier?

If the PHY is on the carrier, then the delay is a carrier property,
and should be in the carrier .dts file. So use the commit for when the
carrier DTS file was added.

If the PHY is on the SOM, then use the commit for when the SOM DTSI
was added.

	Andrew
Hugo Villeneuve April 27, 2023, 9:12 p.m. UTC | #9
On Thu, 27 Apr 2023 22:56:40 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

> On Thu, Apr 27, 2023 at 04:22:51PM -0400, Hugo Villeneuve wrote:
> > On Thu, 27 Apr 2023 17:07:59 -0300
> > Fabio Estevam <festevam@gmail.com> wrote:
> > 
> > > On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> > > 
> > > > Hi Fabio,
> > > > it uses a ADIN1300 PHY.
> > > >
> > > > The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
> > > 
> > > Please add this information to the commit log and please add a Fixes: tag.
> > > 
> > > Thanks
> > 
> > Hi,
> > I am trying to properly add a "Fixes: " tag, but the description for this tag indicates that it is to report that "the patch fixes an issue in a previous commit".
> > 
> > In this case, I cannot identify a commit that introduced that bug, apart from the initial commit of the DTS file which didn't have the reset property present?
> 
> Is the PHY on the SOM or the carrier?

It is on the SOM.

> 
> If the PHY is on the carrier, then the delay is a carrier property,
> and should be in the carrier .dts file. So use the commit for when the
> carrier DTS file was added.
> 
> If the PHY is on the SOM, then use the commit for when the SOM DTSI
> was added.

Ok, will use that.

Hugo.
Hugo Villeneuve April 27, 2023, 10:18 p.m. UTC | #10
On Thu, 27 Apr 2023 22:16:45 +0200
Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:

> On 27.04.23 22:12, Hugo Villeneuve wrote:
> > On Thu, 27 Apr 2023 17:07:59 -0300
> > Fabio Estevam <festevam@gmail.com> wrote:
> > 
> >> On Thu, Apr 27, 2023 at 5:06 PM Hugo Villeneuve <hugo@hugovil.com> wrote:
> >>
> >>> Hi Fabio,
> >>> it uses a ADIN1300 PHY.
> >>>
> >>> The datasheet indicate that the "Management interface active (t4)" state is reached at most 5ms after the reset signal is deasserted.
> >>
> >> Please add this information to the commit log and please add a Fixes: tag.
> > 
> > Good idea, will do.
> 
> Please also add the PHY name into the DT, e.g.:
> 
>   ethphy: ethernet-phy@4 { /* ADIN1300 */
> 
> I find this very useful when bringing up a new board and looking
> for similar DTs.
> 
> Thanks,
> Ahmad

Hi Ahmad,
altough I agree it is a good idea, I prefer to not add this information for now, because there is probably some (old) versions of this SOM which use other PHY devices (maybe AR8033), but I am not 100% sure as this is not clear from the SOM manufacturer infos/website.

Hugo.
Ahmad Fatoum April 28, 2023, 7:20 a.m. UTC | #11
Hello Hugo,

On 28.04.23 00:18, Hugo Villeneuve wrote:
> On Thu, 27 Apr 2023 22:16:45 +0200
> Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>> Please also add the PHY name into the DT, e.g.:
>>
>>   ethphy: ethernet-phy@4 { /* ADIN1300 */
>>
>> I find this very useful when bringing up a new board and looking
>> for similar DTs.
> 
> Hi Ahmad,
> altough I agree it is a good idea, I prefer to not add this information for now, because there is probably some (old) versions of this SOM which use other PHY devices (maybe AR8033), but I am not 100% sure as this is not clear from the SOM manufacturer infos/website.

/* ADIN1300 on new revisions */ would work too.

Cheers,
Ahmad

> 
> Hugo.
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi
index 67072e6c77d5..9052b0d4b5b4 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi
@@ -103,6 +103,7 @@  ethphy: ethernet-phy@4 {
 			reg = <4>;
 			reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
+			reset-deassert-us = <20000>;
 		};
 	};
 };