Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Set PTP Ethertype
Browse files Browse the repository at this point in the history
For the 6352 and newer switches, the PTP Ethertype defaults to
ETH_P_1588. Hence it was not explicitly set. The 6165 however defaults
to 0. So explicitly set the EtherType.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Jul 18, 2018
1 parent e2294a8 commit 2dbed24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/dsa/mv88e6xxx/hwtstamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ int mv88e6xxx_hwtstamp_setup(struct mv88e6xxx_chip *chip)
return err;
}

/* Set the ethertype of L2 PTP messages */
err = mv88e6xxx_ptp_write(chip, MV88E6XXX_PTP_GC_ETYPE, ETH_P_1588);
if (err)
return err;

/* MV88E6XXX_PTP_MSG_TYPE is a mask of PTP message types to
* timestamp. This affects all ports that have timestamping enabled,
* but the timestamp config is per-port; thus we configure all events
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/dsa/mv88e6xxx/ptp.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
#define MV88E6XXX_PTP_GC_ETYPE 0x00

/* 6165 Global Control Registers */
/* Offset 0x00: Ether Type */
#define MV88E6XXX_PTP_GC_ETYPE 0x00

/* Offset 0x01: Message ID */
#define MV88E6XXX_PTP_GC_MESSAGE_ID 0x01

Expand Down

0 comments on commit 2dbed24

Please sign in to comment.