devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yangbo Lu <yangbo.lu@nxp.com>
To: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: "David S . Miller" <davem@davemloft.net>,
	Richard Cochran <richardcochran@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Yangbo Lu <yangbo.lu@nxp.com>
Subject: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
Date: Thu, 17 Jan 2019 09:49:36 +0800	[thread overview]
Message-ID: <20190117014936.48117-6-yangbo.lu@nxp.com> (raw)
In-Reply-To: <20190117014936.48117-1-yangbo.lu@nxp.com>

This patch is to add Kconfig options to support fiper
pulse loopback mode. This is very useful for validating
hardware and driver without external hardware.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- None.
---
 drivers/ptp/Kconfig     |   18 ++++++++++++++++++
 drivers/ptp/ptp_qoriq.c |    7 ++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index d137c48..561d797 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -55,6 +55,24 @@ config PTP_1588_CLOCK_QORIQ
 	  To compile this driver as a module, choose M here: the module
 	  will be called ptp_qoriq.
 
+config PTP_1588_CLOCK_QORIQ_FIPER1_LOOPBACK
+	bool "Fiper1 pulse loopback"
+	depends on PTP_1588_CLOCK_QORIQ
+	default n
+	help
+	  Enable fiper1 pulse loopback mode. If choose y, fiper1 pulse is
+	  looped back into trigger1 input. In default, trigger1 input is
+	  based upon normal external trigger input.
+
+config PTP_1588_CLOCK_QORIQ_FIPER2_LOOPBACK
+	bool "Fiper2 pulse loopback"
+	depends on PTP_1588_CLOCK_QORIQ
+	default n
+	help
+	  Enable fiper2 pulse loopback mode. If choose y, fiper2 pulse is
+	  looped back into trigger2 input. In default, trigger2 input is
+	  based upon normal external trigger input.
+
 config PTP_1588_CLOCK_IXP46X
 	tristate "Intel IXP46x as PTP clock"
 	depends on IXP4XX_ETH
diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index a2e7702..5294475 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -551,7 +551,12 @@ static int qoriq_ptp_probe(struct platform_device *dev)
 	tmr_ctrl =
 	  (qoriq_ptp->tclk_period & TCLK_PERIOD_MASK) << TCLK_PERIOD_SHIFT |
 	  (qoriq_ptp->cksel & CKSEL_MASK) << CKSEL_SHIFT;
-
+#ifdef CONFIG_PTP_1588_CLOCK_QORIQ_FIPER1_LOOPBACK
+	tmr_ctrl |= PP1L;
+#endif
+#ifdef CONFIG_PTP_1588_CLOCK_QORIQ_FIPER2_LOOPBACK
+	tmr_ctrl |= PP2L;
+#endif
 	spin_lock_irqsave(&qoriq_ptp->lock, flags);
 
 	regs = &qoriq_ptp->regs;
-- 
1.7.1

  parent reply	other threads:[~2019-01-17  1:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17  1:49 [v2, 0/5] External trigger stamp fifo support for ptp_qoriq Yangbo Lu
2019-01-17  1:49 ` [v2, 1/5] ptp_qoriq: fix interrupt enabling and handling Yangbo Lu
2019-01-17  1:49 ` [v2, 2/5] ptp_qoriq: support external trigger stamp FIFO Yangbo Lu
2019-01-17  1:49 ` [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property Yangbo Lu
2019-01-18  1:34   ` Richard Cochran
2019-01-18  1:39     ` Richard Cochran
2019-01-18  8:10       ` Y.b. Lu
2019-01-17  1:49 ` [v2, 4/5] ARM: dts: ls1021a: add 1588 external trigger stamp fifo support Yangbo Lu
2019-01-17  1:49 ` Yangbo Lu [this message]
2019-01-18  1:44   ` [v2, 5/5] ptp_qoriq: add fiper pulse loopback support Richard Cochran
2019-01-18  8:11     ` Y.b. Lu

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=20190117014936.48117-6-yangbo.lu@nxp.com \
    --to=yangbo.lu@nxp.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    /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).