Re: [PATCH] w5100: restore GPIO-based link detection
Arthur Crépin Leblond <[email protected]>
| Newsgroups | org.kernel.vger.netdev,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <anM93A0l2inhFxFu@pc-du-fromage> |
On Wed, Aug 05, 2026 at 12:46:14PM +0200, Arnd Bergmann wrote: >On Wed, Aug 5, 2026, at 11:44, Arthur Crépin Leblond wrote: >> On Wed, Aug 05, 2026 at 11:11:53AM +0200, Arnd Bergmann wrote: >> You're right for the W5100 that would not make any sense during data >> transfers it would trigger the interrupt. That's unreliable. >> >> I am using the W5500, and in the datasheet it says >> >> Link LED >> This shows the Link status. >> Low: Link is established >> High: Link is not established >> >> I can confirm it is what is happening, I don't see any changes >> of state during TX/RX. > >Ok, good. On the other hand, the W5500 also has a PHYCFG register >that should tell you the link status without looking at the >GPIO line, though it's not clear if the CON/DISCON interrupt >fires on link state change in MACRAW mode. > >It probably makes sense to wire up link w5100_get_link() to >the phy register for w5500 either way, as that works without >connecting a GPIO. Then you can just describe the LINKLED >signal as an optional interrupt in the DT binding to trigger >checking the link state in that register. > > Arnd Seems to work, the PHYCFG[0] bit gets updated on link change. Arthur