]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: mscc: 1588 block initialization
authorQuentin Schulz <quentin.schulz@bootlin.com>
Tue, 23 Jun 2020 14:30:11 +0000 (16:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2020 21:33:16 +0000 (14:33 -0700)
commit91b2815660dbcbe4d16358d9b80d744926c6a7cf
treeaf2c9b6578139a92998cb906a25003334e7c8007
parent689f4614e7897212edeaab07e4f32a9b829a0212
net: phy: mscc: 1588 block initialization

This patch adds the first parts of the 1588 support in the MSCC PHY,
with registers definition and the 1588 block initialization.

Those PHYs are distributed in hardware packages containing multiple
times the PHY. The VSC8584 for example is composed of 4 PHYs. With
hardware packages, parts of the logic is usually common and one of the
PHY has to be used for some parts of the initialization. Following this
logic, the 1588 blocks of those PHYs are shared between two PHYs and
accessing the registers has to be done using the "base" PHY of the
group. This is handled thanks to helpers in the PTP code (and locks).
We also need the MDIO bus lock while performing a single read or write
to the 1588 registers as the read/write are composed of multiple MDIO
transactions (and we don't want other threads updating the page).

Co-developed-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mscc/Makefile
drivers/net/phy/mscc/mscc.h
drivers/net/phy/mscc/mscc_main.c
drivers/net/phy/mscc/mscc_ptp.c [new file with mode: 0644]
drivers/net/phy/mscc/mscc_ptp.h [new file with mode: 0644]