]> git.baikalelectronics.ru Git - 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)
commit587c3f7f429580e7b47b87d0f2616ee0f41ef504
tree365f0767c4102e66580428c0f5c19dcd2fb5d573
parent798e6d47e35aac123a0e1da4f4a363adec7f2d45
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