OSDN Git Service

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)
commitab2bf933935710ac545f94e49d16b5eab01f846f
treeaf2c9b6578139a92998cb906a25003334e7c8007
parent4c8c5dc57ae8226ceb7e72fb7a5cfa8e743c0a2b
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]