> This works in two possible ways: through an external PHY or through
> the internal PCS. The existing autonegotiation code is handled through
> the MAC driver, even in the external PHY case, and assumes a copper
> PHY.
>
> Instead, add two pieces of logic:
> - If there is an external PHY, use the interface mode of the PHY,
>   as distinct from the interface mode of the MAC, to determine
>   how to adjust the 802.3 clause-22 autonegotiation registers.
> - If there is no external PHY, and the device tree signals to use
>   inband autonegotiation, use the interface mode of the MAC to
>   decide this.
>
> In addition, add support for use of the internal PCS without an
> external PHY with autonegotiation. The internal PCS provides the
> standard set of 802.3 clause-22 PHY registers, which work in
> standard ways, so provide access to those registers as a fake MDIO
> device. This unifies the external-PHY and internal-PCS cases, and
> provides autonegotiation with the internal PCS for both 1000BASE-X
> and SGMII devices.
>
> Tested on:
> - BeagleV-Fire (SGMII-attached copper PHY -- no regressions seen)
> - Custom PolarFire SoC hardware with GMII-attached 1000BASE-X PHY
> - Custom PolarFire SoC hardware with internal PCS in 1000BASE-X mode
>
> Signed-off-by: Nathan Whitehorn <[email protected]>
> ---
> Changes for v2:
> - Include test history in commit message
>
>  drivers/net/macb.c | 60 +++++++++++++++++++++++++++++++++++++++++-----
>  drivers/net/macb.h |  1 +
>  2 files changed, 55 insertions(+), 6 deletions(-)

Applied to u-boot-net branch for-main [1], thanks!

[1] 
https://git.u-boot-project.org/u-boot/custodians/u-boot-net/-/commits/for-main

[1/1] net: macb: add 1000BASE-X autonegotiation support
      commit: f6b2d87fb22fe70e5edf03f212360dd781cf2da5

Best regards,
-- 
Jerome Forissier <[email protected]>

Reply via email to