]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: ethernet: altera_tse: add support for SGMII PCS
authorNeill Whillans <neill.whillans@codethink.co.uk>
Wed, 30 Nov 2016 13:41:05 +0000 (13:41 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 15:36:47 +0000 (10:36 -0500)
commit3b804564333f312143f36460f5fa90085428b5af
tree365f0767c4102e66580428c0f5c19dcd2fb5d573
parentdc855b3b74187475db2243356d85d2ebb447b54c
net: ethernet: altera_tse: add support for SGMII PCS

Add support for the (optional) SGMII PCS functionality of the Altera
TSE MAC. If the phy-mode is set to 'sgmii' then we attempt to discover
and initialise the PCS so that the MAC can communicate to the PHY.

The PCS IP block provides a scratch register for testing presence of
the PCS, which is mapped into one of the two MDIO spaces present in
the MAC's register space.  Once we have determined that the scratch
register is functioning, we attempt to initialise the PCS to
auto-negotiate an SGMII link with the PHY. There is no need to monitor
or manage the SGMII link beyond this, since the normal PHY MDIO will
then be used to monitor the media layer.

The Altera TSE MAC has only one way in which it can be configured with an
SGMII PCS, and as such, this patch only looks to the phy-mode to select
whether or not to attempt to initialise the PCS registers.  During
initialisation, we report the PCS's equivalent of a PHY ID register.
This can be parameterised during the IP instantiation and is often left
as '0x00000000' which is not an error.

Signed-off-by: Neill Whillans <neill.whillans@codethink.co.uk>
Reviewed-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/altera/altera_tse.h
drivers/net/ethernet/altera/altera_tse_main.c