mbox series

[net-next,v5,0/2] Broadcom PTP PHY support

Message ID 20220518223935.2312426-1-jonathan.lemon@gmail.com (mailing list archive)
Headers show
Series Broadcom PTP PHY support | expand

Message

Jonathan Lemon May 18, 2022, 10:39 p.m. UTC
This adds PTP support for the Broadcom PHY BCM54210E (and the
specific variant BCM54213PE that the rpi-5.15 branch uses).

This has only been tested on the RPI CM4, which has one port.

There are other Broadcom chips which may benefit from using the
same framework here, although with different register sets.

v4->v5:
 Reorder so bcm-phy-lib.h shows up first, fixing dependency issues.
 Use set_normalized_timespec for adjusting ns in adjtime
 Return upscaled config setting from hwtstamp

v3->v4:
 Squash bcm-phy-lib.h and broadcom.c changes into one patch
 Reorder so the main patch shows up first.

v2->v3:
 Rearrange patches so they apply in order
 Use ERR_CAST

v1->v2:
 Squash Kconfig into main patch
 Move config checks into bcm-phy-lib.h
 Fix delta_ns calculations in adjtime
 Uppercase mode selector macros
 Only use NSE_INIT when necessary
 Remove the inserted Broadcom RX timestamp from the PTP packet
 Add perout (chip generated) and fsync out (timer generated)
 Remove PHY_ID_BCM54213PE special casing (needed for rpi tree)

Thanks to Lasse Johnsen <lasse@timebeat.app> for pointing out
that the chip's periodic output generation isn't sync'd to any
time base.

Jonathan Lemon (2):
  net: phy: broadcom: Add Broadcom PTP hooks to bcm-phy-lib
  net: phy: broadcom: Add PTP support for some Broadcom PHYs.

 drivers/net/phy/Kconfig       |  10 +
 drivers/net/phy/Makefile      |   1 +
 drivers/net/phy/bcm-phy-lib.h |  14 +
 drivers/net/phy/bcm-phy-ptp.c | 868 ++++++++++++++++++++++++++++++++++
 drivers/net/phy/broadcom.c    |  23 +-
 5 files changed, 912 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/phy/bcm-phy-ptp.c

Comments

Richard Cochran May 28, 2022, 3:27 a.m. UTC | #1
On Wed, May 18, 2022 at 03:39:33PM -0700, Jonathan Lemon wrote:
> This adds PTP support for the Broadcom PHY BCM54210E (and the
> specific variant BCM54213PE that the rpi-5.15 branch uses).

I'm interested in this series.  Can you please include me on CC?

Thanks,
Richard
Jonathan Lemon May 30, 2022, 4:48 p.m. UTC | #2
On Fri, May 27, 2022 at 08:27:12PM -0700, Richard Cochran wrote:
> On Wed, May 18, 2022 at 03:39:33PM -0700, Jonathan Lemon wrote:
> > This adds PTP support for the Broadcom PHY BCM54210E (and the
> > specific variant BCM54213PE that the rpi-5.15 branch uses).
> 
> I'm interested in this series.  Can you please include me on CC?

Sure thing!  (I thought I had already, if not, it was an unintentional
oversight.)