lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] net: ethernet: Add driver for Sunplus SP7021
On Fri, Nov 26, 2021 at 03:56:28AM +0000, Wells Lu 呂芳騰 wrote:
> Hi Andrew,
>
> I set phy-id registers to 30 and 31 and found the read-back
> values of mdio read commands from CPU are all 0x0000.
>
> I consulted with an ASIC engineer. She confirmed that if
> phy-id of a mdio command from CPU does not match any
> phy-id registers, the mdio command will not be sent out.
>
> She explained if phy-id of a mdio command does not match
> any phy-id registers (represent addresses of external PHYs),
> why MAC needs to send a command to non-existing PHY?

Reads or writes on a real PHY which Linux is driving can have side
effects. There is a link statue register which latches. Read it once,
you get the last status, read it again, you get the current status. If
the MAC hardware is reading this register as well a Linux, bad things
will happen. A read on the interrupt status register often clears the
interrupts. So Linux will not see the interrupts.

So you need to make sure you hardware is not touching a PHY which
Linux uses. Which is why i suggested using MDIO bus address 31, which
generally does not have a PHY at that address.

Andrew

\
 
 \ /
  Last update: 2021-11-26 15:42    [W:0.088 / U:1.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site