From: Andrew Lunn <andrew@lunn.ch>
To: Fabio Estevam <festevam@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>,
Bruno Thomsen <bth@kamstrup.com>,
Lars Alex Pedersen <laa@kamstrup.com>
Subject: Re: fec: micrel: Ethernet PHY type ID auto-detection issue
Date: Fri, 17 Jul 2020 18:34:41 +0200 [thread overview]
Message-ID: <20200717163441.GA1339445@lunn.ch> (raw)
In-Reply-To: <CAOMZO5DtYDomD8FDCZDwYCSr2AwNT81Ay4==aDxXyBxtyvPiJA@mail.gmail.com>
On Fri, Jul 17, 2020 at 12:52:08PM -0300, Fabio Estevam wrote:
> Hi Bruno,
> > I have been having issues with Ethernet PHY type ID
> > auto-detection when changing from the deprecated fec
> > phy-reset-{gpios,duration,post-delay} properties to the
> > modern mdio reset-{assert-us,deassert-us,gpios}
> > properties in the device tree.
> > Kernel error messages (modem mdio reset):
> > mdio_bus 30be0000.ethernet-1: MDIO device at address 1 is missing.
> > fec 30be0000.ethernet eth0: Unable to connect to phy
It sounds like the PHY is not responding during scanning of the bus.
https://elixir.bootlin.com/linux/v5.8-rc4/source/drivers/of/of_mdio.c#L277
If you dig down the call chain:
https://elixir.bootlin.com/linux/v5.8-rc4/source/drivers/net/phy/phy_device.c#L778
This reads register 2 and 3 of the PHY to get its ID.
https://elixir.bootlin.com/linux/v5.8-rc4/source/drivers/net/phy/phy_device.c#L817
If the ID is mostly 0xff there is no device there.
So check the initial reset state of the PHY, and when is it taken out
of reset, and is the delay long enough for it to get itself together
and start answering requests.
Andrew
next prev parent reply other threads:[~2020-07-17 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAH+2xPCzrBgngz5cY9DDDjnFUBNa=NSH3VMchFcnoVbjSm3rEw@mail.gmail.com>
2020-07-17 15:52 ` fec: micrel: Ethernet PHY type ID auto-detection issue Fabio Estevam
2020-07-17 16:34 ` Andrew Lunn [this message]
2020-07-22 10:59 ` Bruno Thomsen
2020-07-22 13:26 ` Andrew Lunn
2020-07-28 8:51 ` Bruno Thomsen
2020-07-22 13:42 ` Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200717163441.GA1339445@lunn.ch \
--to=andrew@lunn.ch \
--cc=bth@kamstrup.com \
--cc=f.fainelli@gmail.com \
--cc=festevam@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=laa@kamstrup.com \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).