netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: richardcochran@gmail.com,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	netdev <netdev@vger.kernel.org>, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH v2 net-next 7/8] net: dsa: mv88e6xxx: Set PTP Ethertype
Date: Wed, 18 Jul 2018 22:38:26 +0200	[thread overview]
Message-ID: <1531946307-22752-8-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1531946307-22752-1-git-send-email-andrew@lunn.ch>

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>
---
 drivers/net/dsa/mv88e6xxx/hwtstamp.c | 5 +++++
 drivers/net/dsa/mv88e6xxx/ptp.h      | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/hwtstamp.c b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
index 01e60a8c97fb..ac71910c63c0 100644
--- a/drivers/net/dsa/mv88e6xxx/hwtstamp.c
+++ b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
@@ -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
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.h b/drivers/net/dsa/mv88e6xxx/ptp.h
index 747f90bb9393..28a030840517 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.h
+++ b/drivers/net/dsa/mv88e6xxx/ptp.h
@@ -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
 
-- 
2.18.0

  parent reply	other threads:[~2018-07-18 21:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 20:38 [PATCH v2 net-next 0/8] PTP support for mv88e6165 family Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 1/8] net: dsa: mv88e6xxx: Abstract PTP operations Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 2/8] net: dsa: mv88e6xxx: Add MV88E6165 AVB register access Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 3/8] net: dsa: mv88e6xxx: Add mv88e6165 PTP support Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 4/8] net: dsa: mv88e6xxx: Abstract HW timestamp setup Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 5/8] net: dsa: mv88e6xxx: Abstract supported PTP filters Andrew Lunn
2018-07-18 20:38 ` [PATCH v2 net-next 6/8] net: dsa: mv88e6xxx: Add hwtimestamp support for the 6165 Andrew Lunn
2018-07-18 20:38 ` Andrew Lunn [this message]
2018-07-18 20:38 ` [PATCH v2 net-next 8/8] net: dsa: mv88e6xxx: Longer timeout for PTP TX timestamp Andrew Lunn
2018-07-18 22:07 ` [PATCH v2 net-next 0/8] PTP support for mv88e6165 family David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531946307-22752-8-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).