All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2, 0/5] External trigger stamp fifo support for ptp_qoriq
@ 2019-01-17  1:49 ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo, Yangbo Lu

This patch-set is to add external trigger stamp fifo support by a new
binding "fsl,extts-fifo", and to add fiper pulse loopback support which
is very useful for validating trigger without external hardware.
Also fixed issues in interrupt enabling/handling.

"fsl,extts-fifo" is required to be added into 1588 timer dts node whose
hardware uses it. The work will be done for some QorIQ platforms dts in
the near future.

Yangbo Lu (5):
  ptp_qoriq: fix interrupt enabling and handling
  ptp_qoriq: support external trigger stamp FIFO
  dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  ARM: dts: ls1021a: add 1588 external trigger stamp fifo support
  ptp_qoriq: add fiper pulse loopback support

 .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
 arch/arm/boot/dts/ls1021a.dtsi                     |    1 +
 drivers/ptp/Kconfig                                |   18 +++
 drivers/ptp/ptp_qoriq.c                            |  133 +++++++++++++-------
 include/linux/fsl/ptp_qoriq.h                      |    3 +
 5 files changed, 112 insertions(+), 44 deletions(-)


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [v2, 0/5] External trigger stamp fifo support for ptp_qoriq
@ 2019-01-17  1:49 ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Richard Cochran, Rob Herring, Shawn Guo, David S . Miller, Yangbo Lu

This patch-set is to add external trigger stamp fifo support by a new
binding "fsl,extts-fifo", and to add fiper pulse loopback support which
is very useful for validating trigger without external hardware.
Also fixed issues in interrupt enabling/handling.

"fsl,extts-fifo" is required to be added into 1588 timer dts node whose
hardware uses it. The work will be done for some QorIQ platforms dts in
the near future.

Yangbo Lu (5):
  ptp_qoriq: fix interrupt enabling and handling
  ptp_qoriq: support external trigger stamp FIFO
  dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  ARM: dts: ls1021a: add 1588 external trigger stamp fifo support
  ptp_qoriq: add fiper pulse loopback support

 .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
 arch/arm/boot/dts/ls1021a.dtsi                     |    1 +
 drivers/ptp/Kconfig                                |   18 +++
 drivers/ptp/ptp_qoriq.c                            |  133 +++++++++++++-------
 include/linux/fsl/ptp_qoriq.h                      |    3 +
 5 files changed, 112 insertions(+), 44 deletions(-)


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [v2, 1/5] ptp_qoriq: fix interrupt enabling and handling
  2019-01-17  1:49 ` Yangbo Lu
@ 2019-01-17  1:49   ` Yangbo Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo, Yangbo Lu

The tmr_tevent register would update event bits
no matter tmr_temask bits were set or not. So we
should get interrupts by tmr_tevent & tmr_temask,
and clean up interrupts in tmr_tevent before
enabling them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- Remove useless lock/register operations.
---
 drivers/ptp/ptp_qoriq.c |   62 +++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index fdd49c2..2743214 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -98,11 +98,18 @@ static irqreturn_t isr(int irq, void *priv)
 	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
 	struct ptp_clock_event event;
 	u64 ns;
-	u32 ack = 0, lo, hi, mask, val;
+	u32 ack = 0, lo, hi, mask, val, irqs;
+
+	spin_lock(&qoriq_ptp->lock);
 
 	val = qoriq_read(&regs->ctrl_regs->tmr_tevent);
+	mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
+
+	spin_unlock(&qoriq_ptp->lock);
+
+	irqs = val & mask;
 
-	if (val & ETS1) {
+	if (irqs & ETS1) {
 		ack |= ETS1;
 		hi = qoriq_read(&regs->etts_regs->tmr_etts1_h);
 		lo = qoriq_read(&regs->etts_regs->tmr_etts1_l);
@@ -113,7 +120,7 @@ static irqreturn_t isr(int irq, void *priv)
 		ptp_clock_event(qoriq_ptp->clock, &event);
 	}
 
-	if (val & ETS2) {
+	if (irqs & ETS2) {
 		ack |= ETS2;
 		hi = qoriq_read(&regs->etts_regs->tmr_etts2_h);
 		lo = qoriq_read(&regs->etts_regs->tmr_etts2_l);
@@ -124,7 +131,7 @@ static irqreturn_t isr(int irq, void *priv)
 		ptp_clock_event(qoriq_ptp->clock, &event);
 	}
 
-	if (val & ALM2) {
+	if (irqs & ALM2) {
 		ack |= ALM2;
 		if (qoriq_ptp->alarm_value) {
 			event.type = PTP_CLOCK_ALARM;
@@ -136,13 +143,10 @@ static irqreturn_t isr(int irq, void *priv)
 			ns = qoriq_ptp->alarm_value + qoriq_ptp->alarm_interval;
 			hi = ns >> 32;
 			lo = ns & 0xffffffff;
-			spin_lock(&qoriq_ptp->lock);
 			qoriq_write(&regs->alarm_regs->tmr_alarm2_l, lo);
 			qoriq_write(&regs->alarm_regs->tmr_alarm2_h, hi);
-			spin_unlock(&qoriq_ptp->lock);
 			qoriq_ptp->alarm_value = ns;
 		} else {
-			qoriq_write(&regs->ctrl_regs->tmr_tevent, ALM2);
 			spin_lock(&qoriq_ptp->lock);
 			mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
 			mask &= ~ALM2EN;
@@ -153,7 +157,7 @@ static irqreturn_t isr(int irq, void *priv)
 		}
 	}
 
-	if (val & PP1) {
+	if (irqs & PP1) {
 		ack |= PP1;
 		event.type = PTP_CLOCK_PPS;
 		ptp_clock_event(qoriq_ptp->clock, &event);
@@ -260,7 +264,7 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 	struct qoriq_ptp *qoriq_ptp = container_of(ptp, struct qoriq_ptp, caps);
 	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
 	unsigned long flags;
-	u32 bit, mask;
+	u32 bit, mask = 0;
 
 	switch (rq->type) {
 	case PTP_CLK_REQ_EXTTS:
@@ -274,32 +278,28 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 		default:
 			return -EINVAL;
 		}
-		spin_lock_irqsave(&qoriq_ptp->lock, flags);
-		mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
-		if (on)
-			mask |= bit;
-		else
-			mask &= ~bit;
-		qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
-		spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
-		return 0;
-
+		break;
 	case PTP_CLK_REQ_PPS:
-		spin_lock_irqsave(&qoriq_ptp->lock, flags);
-		mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
-		if (on)
-			mask |= PP1EN;
-		else
-			mask &= ~PP1EN;
-		qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
-		spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
-		return 0;
-
-	default:
+		bit = PP1EN;
 		break;
+	default:
+		return -EOPNOTSUPP;
 	}
 
-	return -EOPNOTSUPP;
+	spin_lock_irqsave(&qoriq_ptp->lock, flags);
+
+	mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
+	if (on) {
+		mask |= bit;
+		qoriq_write(&regs->ctrl_regs->tmr_tevent, bit);
+	} else {
+		mask &= ~bit;
+	}
+
+	qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
+
+	spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
+	return 0;
 }
 
 static const struct ptp_clock_info ptp_qoriq_caps = {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 1/5] ptp_qoriq: fix interrupt enabling and handling
@ 2019-01-17  1:49   ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Richard Cochran, Rob Herring, Shawn Guo, David S . Miller, Yangbo Lu

The tmr_tevent register would update event bits
no matter tmr_temask bits were set or not. So we
should get interrupts by tmr_tevent & tmr_temask,
and clean up interrupts in tmr_tevent before
enabling them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- Remove useless lock/register operations.
---
 drivers/ptp/ptp_qoriq.c |   62 +++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index fdd49c2..2743214 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -98,11 +98,18 @@ static irqreturn_t isr(int irq, void *priv)
 	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
 	struct ptp_clock_event event;
 	u64 ns;
-	u32 ack = 0, lo, hi, mask, val;
+	u32 ack = 0, lo, hi, mask, val, irqs;
+
+	spin_lock(&qoriq_ptp->lock);
 
 	val = qoriq_read(&regs->ctrl_regs->tmr_tevent);
+	mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
+
+	spin_unlock(&qoriq_ptp->lock);
+
+	irqs = val & mask;
 
-	if (val & ETS1) {
+	if (irqs & ETS1) {
 		ack |= ETS1;
 		hi = qoriq_read(&regs->etts_regs->tmr_etts1_h);
 		lo = qoriq_read(&regs->etts_regs->tmr_etts1_l);
@@ -113,7 +120,7 @@ static irqreturn_t isr(int irq, void *priv)
 		ptp_clock_event(qoriq_ptp->clock, &event);
 	}
 
-	if (val & ETS2) {
+	if (irqs & ETS2) {
 		ack |= ETS2;
 		hi = qoriq_read(&regs->etts_regs->tmr_etts2_h);
 		lo = qoriq_read(&regs->etts_regs->tmr_etts2_l);
@@ -124,7 +131,7 @@ static irqreturn_t isr(int irq, void *priv)
 		ptp_clock_event(qoriq_ptp->clock, &event);
 	}
 
-	if (val & ALM2) {
+	if (irqs & ALM2) {
 		ack |= ALM2;
 		if (qoriq_ptp->alarm_value) {
 			event.type = PTP_CLOCK_ALARM;
@@ -136,13 +143,10 @@ static irqreturn_t isr(int irq, void *priv)
 			ns = qoriq_ptp->alarm_value + qoriq_ptp->alarm_interval;
 			hi = ns >> 32;
 			lo = ns & 0xffffffff;
-			spin_lock(&qoriq_ptp->lock);
 			qoriq_write(&regs->alarm_regs->tmr_alarm2_l, lo);
 			qoriq_write(&regs->alarm_regs->tmr_alarm2_h, hi);
-			spin_unlock(&qoriq_ptp->lock);
 			qoriq_ptp->alarm_value = ns;
 		} else {
-			qoriq_write(&regs->ctrl_regs->tmr_tevent, ALM2);
 			spin_lock(&qoriq_ptp->lock);
 			mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
 			mask &= ~ALM2EN;
@@ -153,7 +157,7 @@ static irqreturn_t isr(int irq, void *priv)
 		}
 	}
 
-	if (val & PP1) {
+	if (irqs & PP1) {
 		ack |= PP1;
 		event.type = PTP_CLOCK_PPS;
 		ptp_clock_event(qoriq_ptp->clock, &event);
@@ -260,7 +264,7 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 	struct qoriq_ptp *qoriq_ptp = container_of(ptp, struct qoriq_ptp, caps);
 	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
 	unsigned long flags;
-	u32 bit, mask;
+	u32 bit, mask = 0;
 
 	switch (rq->type) {
 	case PTP_CLK_REQ_EXTTS:
@@ -274,32 +278,28 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 		default:
 			return -EINVAL;
 		}
-		spin_lock_irqsave(&qoriq_ptp->lock, flags);
-		mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
-		if (on)
-			mask |= bit;
-		else
-			mask &= ~bit;
-		qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
-		spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
-		return 0;
-
+		break;
 	case PTP_CLK_REQ_PPS:
-		spin_lock_irqsave(&qoriq_ptp->lock, flags);
-		mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
-		if (on)
-			mask |= PP1EN;
-		else
-			mask &= ~PP1EN;
-		qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
-		spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
-		return 0;
-
-	default:
+		bit = PP1EN;
 		break;
+	default:
+		return -EOPNOTSUPP;
 	}
 
-	return -EOPNOTSUPP;
+	spin_lock_irqsave(&qoriq_ptp->lock, flags);
+
+	mask = qoriq_read(&regs->ctrl_regs->tmr_temask);
+	if (on) {
+		mask |= bit;
+		qoriq_write(&regs->ctrl_regs->tmr_tevent, bit);
+	} else {
+		mask &= ~bit;
+	}
+
+	qoriq_write(&regs->ctrl_regs->tmr_temask, mask);
+
+	spin_unlock_irqrestore(&qoriq_ptp->lock, flags);
+	return 0;
 }
 
 static const struct ptp_clock_info ptp_qoriq_caps = {
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 2/5] ptp_qoriq: support external trigger stamp FIFO
  2019-01-17  1:49 ` Yangbo Lu
@ 2019-01-17  1:49   ` Yangbo Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo,
	Yangbo Lu, Vladimir Oltean

The external trigger stamp FIFO was introduced as a new feature
for QorIQ 1588 timer IP block. This patch is to support it by
adding a new dts property "fsl,extts-fifo". Any QorIQ 1588 timer
supporting this feature is required to add this property in its
dts node.

In addition, the FIFO should be cleaned up before enabling external
trigger interrupts. Otherwise, there will be interrupts immediately
just after enabling external trigger interrupts.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Changes for v2:
	- Converted to use extts_clean_up instead.
---
 drivers/ptp/ptp_qoriq.c       |   68 ++++++++++++++++++++++++++++++++--------
 include/linux/fsl/ptp_qoriq.h |    3 ++
 2 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index 2743214..a2e7702 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -88,6 +88,49 @@ static void set_fipers(struct qoriq_ptp *qoriq_ptp)
 	qoriq_write(&regs->fiper_regs->tmr_fiper2, qoriq_ptp->tmr_fiper2);
 }
 
+static int extts_clean_up(struct qoriq_ptp *qoriq_ptp, int index,
+			  bool update_event)
+{
+	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
+	struct ptp_clock_event event;
+	void __iomem *reg_etts_l;
+	void __iomem *reg_etts_h;
+	u32 valid, stat, lo, hi;
+
+	switch (index) {
+	case 0:
+		valid = ETS1_VLD;
+		reg_etts_l = &regs->etts_regs->tmr_etts1_l;
+		reg_etts_h = &regs->etts_regs->tmr_etts1_h;
+		break;
+	case 1:
+		valid = ETS2_VLD;
+		reg_etts_l = &regs->etts_regs->tmr_etts2_l;
+		reg_etts_h = &regs->etts_regs->tmr_etts2_h;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	event.type = PTP_CLOCK_EXTTS;
+	event.index = index;
+
+	do {
+		lo = qoriq_read(reg_etts_l);
+		hi = qoriq_read(reg_etts_h);
+
+		if (update_event) {
+			event.timestamp = ((u64) hi) << 32;
+			event.timestamp |= lo;
+			ptp_clock_event(qoriq_ptp->clock, &event);
+		}
+
+		stat = qoriq_read(&regs->ctrl_regs->tmr_stat);
+	} while (qoriq_ptp->extts_fifo_support && (stat & valid));
+
+	return 0;
+}
+
 /*
  * Interrupt service routine
  */
@@ -111,24 +154,12 @@ static irqreturn_t isr(int irq, void *priv)
 
 	if (irqs & ETS1) {
 		ack |= ETS1;
-		hi = qoriq_read(&regs->etts_regs->tmr_etts1_h);
-		lo = qoriq_read(&regs->etts_regs->tmr_etts1_l);
-		event.type = PTP_CLOCK_EXTTS;
-		event.index = 0;
-		event.timestamp = ((u64) hi) << 32;
-		event.timestamp |= lo;
-		ptp_clock_event(qoriq_ptp->clock, &event);
+		extts_clean_up(qoriq_ptp, 0, true);
 	}
 
 	if (irqs & ETS2) {
 		ack |= ETS2;
-		hi = qoriq_read(&regs->etts_regs->tmr_etts2_h);
-		lo = qoriq_read(&regs->etts_regs->tmr_etts2_l);
-		event.type = PTP_CLOCK_EXTTS;
-		event.index = 1;
-		event.timestamp = ((u64) hi) << 32;
-		event.timestamp |= lo;
-		ptp_clock_event(qoriq_ptp->clock, &event);
+		extts_clean_up(qoriq_ptp, 1, true);
 	}
 
 	if (irqs & ALM2) {
@@ -278,6 +309,10 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 		default:
 			return -EINVAL;
 		}
+
+		if (on)
+			extts_clean_up(qoriq_ptp, rq->extts.index, false);
+
 		break;
 	case PTP_CLK_REQ_PPS:
 		bit = PP1EN;
@@ -441,6 +476,11 @@ static int qoriq_ptp_probe(struct platform_device *dev)
 	if (of_property_read_u32(node, "fsl,cksel", &qoriq_ptp->cksel))
 		qoriq_ptp->cksel = DEFAULT_CKSEL;
 
+	if (of_property_read_bool(node, "fsl,extts-fifo"))
+		qoriq_ptp->extts_fifo_support = true;
+	else
+		qoriq_ptp->extts_fifo_support = false;
+
 	if (of_property_read_u32(node,
 				 "fsl,tclk-period", &qoriq_ptp->tclk_period) ||
 	    of_property_read_u32(node,
diff --git a/include/linux/fsl/ptp_qoriq.h b/include/linux/fsl/ptp_qoriq.h
index c1f003a..43b4b44 100644
--- a/include/linux/fsl/ptp_qoriq.h
+++ b/include/linux/fsl/ptp_qoriq.h
@@ -120,6 +120,8 @@ struct qoriq_ptp_registers {
 /* Bit definitions for the TMR_STAT register */
 #define STAT_VEC_SHIFT        (0) /* Timer general purpose status vector */
 #define STAT_VEC_MASK         (0x3f)
+#define ETS1_VLD              (1<<24)
+#define ETS2_VLD              (1<<25)
 
 /* Bit definitions for the TMR_PRSC register */
 #define PRSC_OCK_SHIFT        (0) /* Output clock division/prescale factor. */
@@ -141,6 +143,7 @@ struct qoriq_ptp {
 	struct ptp_clock *clock;
 	struct ptp_clock_info caps;
 	struct resource *rsrc;
+	bool extts_fifo_support;
 	int irq;
 	int phc_index;
 	u64 alarm_interval; /* for periodic alarm */
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 2/5] ptp_qoriq: support external trigger stamp FIFO
@ 2019-01-17  1:49   ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Vladimir Oltean, Richard Cochran, Rob Herring, Yangbo Lu,
	Shawn Guo, David S . Miller

The external trigger stamp FIFO was introduced as a new feature
for QorIQ 1588 timer IP block. This patch is to support it by
adding a new dts property "fsl,extts-fifo". Any QorIQ 1588 timer
supporting this feature is required to add this property in its
dts node.

In addition, the FIFO should be cleaned up before enabling external
trigger interrupts. Otherwise, there will be interrupts immediately
just after enabling external trigger interrupts.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Changes for v2:
	- Converted to use extts_clean_up instead.
---
 drivers/ptp/ptp_qoriq.c       |   68 ++++++++++++++++++++++++++++++++--------
 include/linux/fsl/ptp_qoriq.h |    3 ++
 2 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index 2743214..a2e7702 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -88,6 +88,49 @@ static void set_fipers(struct qoriq_ptp *qoriq_ptp)
 	qoriq_write(&regs->fiper_regs->tmr_fiper2, qoriq_ptp->tmr_fiper2);
 }
 
+static int extts_clean_up(struct qoriq_ptp *qoriq_ptp, int index,
+			  bool update_event)
+{
+	struct qoriq_ptp_registers *regs = &qoriq_ptp->regs;
+	struct ptp_clock_event event;
+	void __iomem *reg_etts_l;
+	void __iomem *reg_etts_h;
+	u32 valid, stat, lo, hi;
+
+	switch (index) {
+	case 0:
+		valid = ETS1_VLD;
+		reg_etts_l = &regs->etts_regs->tmr_etts1_l;
+		reg_etts_h = &regs->etts_regs->tmr_etts1_h;
+		break;
+	case 1:
+		valid = ETS2_VLD;
+		reg_etts_l = &regs->etts_regs->tmr_etts2_l;
+		reg_etts_h = &regs->etts_regs->tmr_etts2_h;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	event.type = PTP_CLOCK_EXTTS;
+	event.index = index;
+
+	do {
+		lo = qoriq_read(reg_etts_l);
+		hi = qoriq_read(reg_etts_h);
+
+		if (update_event) {
+			event.timestamp = ((u64) hi) << 32;
+			event.timestamp |= lo;
+			ptp_clock_event(qoriq_ptp->clock, &event);
+		}
+
+		stat = qoriq_read(&regs->ctrl_regs->tmr_stat);
+	} while (qoriq_ptp->extts_fifo_support && (stat & valid));
+
+	return 0;
+}
+
 /*
  * Interrupt service routine
  */
@@ -111,24 +154,12 @@ static irqreturn_t isr(int irq, void *priv)
 
 	if (irqs & ETS1) {
 		ack |= ETS1;
-		hi = qoriq_read(&regs->etts_regs->tmr_etts1_h);
-		lo = qoriq_read(&regs->etts_regs->tmr_etts1_l);
-		event.type = PTP_CLOCK_EXTTS;
-		event.index = 0;
-		event.timestamp = ((u64) hi) << 32;
-		event.timestamp |= lo;
-		ptp_clock_event(qoriq_ptp->clock, &event);
+		extts_clean_up(qoriq_ptp, 0, true);
 	}
 
 	if (irqs & ETS2) {
 		ack |= ETS2;
-		hi = qoriq_read(&regs->etts_regs->tmr_etts2_h);
-		lo = qoriq_read(&regs->etts_regs->tmr_etts2_l);
-		event.type = PTP_CLOCK_EXTTS;
-		event.index = 1;
-		event.timestamp = ((u64) hi) << 32;
-		event.timestamp |= lo;
-		ptp_clock_event(qoriq_ptp->clock, &event);
+		extts_clean_up(qoriq_ptp, 1, true);
 	}
 
 	if (irqs & ALM2) {
@@ -278,6 +309,10 @@ static int ptp_qoriq_enable(struct ptp_clock_info *ptp,
 		default:
 			return -EINVAL;
 		}
+
+		if (on)
+			extts_clean_up(qoriq_ptp, rq->extts.index, false);
+
 		break;
 	case PTP_CLK_REQ_PPS:
 		bit = PP1EN;
@@ -441,6 +476,11 @@ static int qoriq_ptp_probe(struct platform_device *dev)
 	if (of_property_read_u32(node, "fsl,cksel", &qoriq_ptp->cksel))
 		qoriq_ptp->cksel = DEFAULT_CKSEL;
 
+	if (of_property_read_bool(node, "fsl,extts-fifo"))
+		qoriq_ptp->extts_fifo_support = true;
+	else
+		qoriq_ptp->extts_fifo_support = false;
+
 	if (of_property_read_u32(node,
 				 "fsl,tclk-period", &qoriq_ptp->tclk_period) ||
 	    of_property_read_u32(node,
diff --git a/include/linux/fsl/ptp_qoriq.h b/include/linux/fsl/ptp_qoriq.h
index c1f003a..43b4b44 100644
--- a/include/linux/fsl/ptp_qoriq.h
+++ b/include/linux/fsl/ptp_qoriq.h
@@ -120,6 +120,8 @@ struct qoriq_ptp_registers {
 /* Bit definitions for the TMR_STAT register */
 #define STAT_VEC_SHIFT        (0) /* Timer general purpose status vector */
 #define STAT_VEC_MASK         (0x3f)
+#define ETS1_VLD              (1<<24)
+#define ETS2_VLD              (1<<25)
 
 /* Bit definitions for the TMR_PRSC register */
 #define PRSC_OCK_SHIFT        (0) /* Output clock division/prescale factor. */
@@ -141,6 +143,7 @@ struct qoriq_ptp {
 	struct ptp_clock *clock;
 	struct ptp_clock_info caps;
 	struct resource *rsrc;
+	bool extts_fifo_support;
 	int irq;
 	int phc_index;
 	u64 alarm_interval; /* for periodic alarm */
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  2019-01-17  1:49 ` Yangbo Lu
@ 2019-01-17  1:49   ` Yangbo Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo, Yangbo Lu

Documented "fsl,extts-fifo" property.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- Modified binding description.
---
 .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
index c5d0e79..101fe5f 100644
--- a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
+++ b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
@@ -17,6 +17,7 @@ Clock Properties:
   - fsl,tmr-fiper1   Fixed interval period pulse generator.
   - fsl,tmr-fiper2   Fixed interval period pulse generator.
   - fsl,max-adj      Maximum frequency adjustment in parts per billion.
+  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
 
   These properties set the operational parameters for the PTP
   clock. You must choose these carefully for the clock to work right.
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
@ 2019-01-17  1:49   ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Richard Cochran, Rob Herring, Shawn Guo, David S . Miller, Yangbo Lu

Documented "fsl,extts-fifo" property.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- Modified binding description.
---
 .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
index c5d0e79..101fe5f 100644
--- a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
+++ b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
@@ -17,6 +17,7 @@ Clock Properties:
   - fsl,tmr-fiper1   Fixed interval period pulse generator.
   - fsl,tmr-fiper2   Fixed interval period pulse generator.
   - fsl,max-adj      Maximum frequency adjustment in parts per billion.
+  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
 
   These properties set the operational parameters for the PTP
   clock. You must choose these carefully for the clock to work right.
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 4/5] ARM: dts: ls1021a: add 1588 external trigger stamp fifo support
  2019-01-17  1:49 ` Yangbo Lu
@ 2019-01-17  1:49   ` Yangbo Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo, Yangbo Lu

This patch is to add external trigger stamp fifo support
for 1588 timer.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- None.
---
 arch/arm/boot/dts/ls1021a.dtsi |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index bdd6e66..0fbeca2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -608,6 +608,7 @@
 			fsl,tmr-fiper1  = <999999995>;
 			fsl,tmr-fiper2  = <99990>;
 			fsl,max-adj     = <499999999>;
+			fsl,extts-fifo;
 		};
 
 		enet0: ethernet@2d10000 {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 4/5] ARM: dts: ls1021a: add 1588 external trigger stamp fifo support
@ 2019-01-17  1:49   ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Richard Cochran, Rob Herring, Shawn Guo, David S . Miller, Yangbo Lu

This patch is to add external trigger stamp fifo support
for 1588 timer.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- None.
---
 arch/arm/boot/dts/ls1021a.dtsi |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index bdd6e66..0fbeca2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -608,6 +608,7 @@
 			fsl,tmr-fiper1  = <999999995>;
 			fsl,tmr-fiper2  = <99990>;
 			fsl,max-adj     = <499999999>;
+			fsl,extts-fifo;
 		};
 
 		enet0: ethernet@2d10000 {
-- 
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
  2019-01-17  1:49 ` Yangbo Lu
@ 2019-01-17  1:49   ` Yangbo Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: David S . Miller, Richard Cochran, Rob Herring, Shawn Guo, Yangbo Lu

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


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
@ 2019-01-17  1:49   ` Yangbo Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Yangbo Lu @ 2019-01-17  1:49 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel
  Cc: Richard Cochran, Rob Herring, Shawn Guo, David S . Miller, Yangbo Lu

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  2019-01-17  1:49   ` Yangbo Lu
@ 2019-01-18  1:34     ` Richard Cochran
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:34 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

On Thu, Jan 17, 2019 at 09:49:34AM +0800, Yangbo Lu wrote:
> Documented "fsl,extts-fifo" property.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> 	- Modified binding description.
> ---
>  .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> index c5d0e79..101fe5f 100644
> --- a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> +++ b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> @@ -17,6 +17,7 @@ Clock Properties:
>    - fsl,tmr-fiper1   Fixed interval period pulse generator.
>    - fsl,tmr-fiper2   Fixed interval period pulse generator.
>    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.

Does this take a Boolean value?  Please explain the semantics.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
@ 2019-01-18  1:34     ` Richard Cochran
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:34 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: devicetree, netdev, Rob Herring, Shawn Guo, David S . Miller,
	linux-arm-kernel

On Thu, Jan 17, 2019 at 09:49:34AM +0800, Yangbo Lu wrote:
> Documented "fsl,extts-fifo" property.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> 	- Modified binding description.
> ---
>  .../devicetree/bindings/ptp/ptp-qoriq.txt          |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> index c5d0e79..101fe5f 100644
> --- a/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> +++ b/Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
> @@ -17,6 +17,7 @@ Clock Properties:
>    - fsl,tmr-fiper1   Fixed interval period pulse generator.
>    - fsl,tmr-fiper2   Fixed interval period pulse generator.
>    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.

Does this take a Boolean value?  Please explain the semantics.

Thanks,
Richard

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  2019-01-18  1:34     ` Richard Cochran
@ 2019-01-18  1:39       ` Richard Cochran
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:39 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

On Thu, Jan 17, 2019 at 05:34:34PM -0800, Richard Cochran wrote:
> > @@ -17,6 +17,7 @@ Clock Properties:
> >    - fsl,tmr-fiper1   Fixed interval period pulse generator.
> >    - fsl,tmr-fiper2   Fixed interval period pulse generator.
> >    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> > +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
> 
> Does this take a Boolean value?  Please explain the semantics.

How about this instead?

	The presence of this property indicates hardware support for
	the external trigger stamp FIFO.


Thanks,
Richard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
@ 2019-01-18  1:39       ` Richard Cochran
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:39 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: devicetree, netdev, Rob Herring, Shawn Guo, David S . Miller,
	linux-arm-kernel

On Thu, Jan 17, 2019 at 05:34:34PM -0800, Richard Cochran wrote:
> > @@ -17,6 +17,7 @@ Clock Properties:
> >    - fsl,tmr-fiper1   Fixed interval period pulse generator.
> >    - fsl,tmr-fiper2   Fixed interval period pulse generator.
> >    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> > +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
> 
> Does this take a Boolean value?  Please explain the semantics.

How about this instead?

	The presence of this property indicates hardware support for
	the external trigger stamp FIFO.


Thanks,
Richard

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
  2019-01-17  1:49   ` Yangbo Lu
@ 2019-01-18  1:44     ` Richard Cochran
  -1 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:44 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

On Thu, Jan 17, 2019 at 09:49:36AM +0800, Yangbo Lu wrote:
> 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.

To me this feature makes more sense as a debugf-fs option.

Thanks,
Richard


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
@ 2019-01-18  1:44     ` Richard Cochran
  0 siblings, 0 replies; 24+ messages in thread
From: Richard Cochran @ 2019-01-18  1:44 UTC (permalink / raw)
  To: Yangbo Lu
  Cc: devicetree, netdev, Rob Herring, Shawn Guo, David S . Miller,
	linux-arm-kernel

On Thu, Jan 17, 2019 at 09:49:36AM +0800, Yangbo Lu wrote:
> 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.

To me this feature makes more sense as a debugf-fs option.

Thanks,
Richard


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
  2019-01-18  1:39       ` Richard Cochran
  (?)
@ 2019-01-18  8:10         ` Y.b. Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:10 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:39 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
> 
> On Thu, Jan 17, 2019 at 05:34:34PM -0800, Richard Cochran wrote:
> > > @@ -17,6 +17,7 @@ Clock Properties:
> > >    - fsl,tmr-fiper1   Fixed interval period pulse generator.
> > >    - fsl,tmr-fiper2   Fixed interval period pulse generator.
> > >    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> > > +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
> >
> > Does this take a Boolean value?  Please explain the semantics.
> 
> How about this instead?
> 
> 	The presence of this property indicates hardware support for
> 	the external trigger stamp FIFO.

[Y.b. Lu] Yes. This is a Boolean value.
Thanks for good suggestion and I will use this instead.

> 
> 
> Thanks,
> Richard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
@ 2019-01-18  8:10         ` Y.b. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:10 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:39 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
> 
> On Thu, Jan 17, 2019 at 05:34:34PM -0800, Richard Cochran wrote:
> > > @@ -17,6 +17,7 @@ Clock Properties:
> > >    - fsl,tmr-fiper1   Fixed interval period pulse generator.
> > >    - fsl,tmr-fiper2   Fixed interval period pulse generator.
> > >    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> > > +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
> >
> > Does this take a Boolean value?  Please explain the semantics.
> 
> How about this instead?
> 
> 	The presence of this property indicates hardware support for
> 	the external trigger stamp FIFO.

[Y.b. Lu] Yes. This is a Boolean value.
Thanks for good suggestion and I will use this instead.

> 
> 
> Thanks,
> Richard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
@ 2019-01-18  8:10         ` Y.b. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:10 UTC (permalink / raw)
  To: Richard Cochran
  Cc: devicetree, netdev, Rob Herring, Shawn Guo, David S . Miller,
	linux-arm-kernel

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:39 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property
> 
> On Thu, Jan 17, 2019 at 05:34:34PM -0800, Richard Cochran wrote:
> > > @@ -17,6 +17,7 @@ Clock Properties:
> > >    - fsl,tmr-fiper1   Fixed interval period pulse generator.
> > >    - fsl,tmr-fiper2   Fixed interval period pulse generator.
> > >    - fsl,max-adj      Maximum frequency adjustment in parts per billion.
> > > +  - fsl,extts-fifo   Required if hardware uses external trigger stamp FIFO.
> >
> > Does this take a Boolean value?  Please explain the semantics.
> 
> How about this instead?
> 
> 	The presence of this property indicates hardware support for
> 	the external trigger stamp FIFO.

[Y.b. Lu] Yes. This is a Boolean value.
Thanks for good suggestion and I will use this instead.

> 
> 
> Thanks,
> Richard

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
  2019-01-18  1:44     ` Richard Cochran
  (?)
@ 2019-01-18  8:11       ` Y.b. Lu
  -1 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:11 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:44 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
> 
> On Thu, Jan 17, 2019 at 09:49:36AM +0800, Yangbo Lu wrote:
> > 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.
> 
> To me this feature makes more sense as a debugf-fs option.

[Y.b. Lu] Let me try debug-fs and update the patch-set.
Thanks for your suggestion.

> 
> Thanks,
> Richard


^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
@ 2019-01-18  8:11       ` Y.b. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:11 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, devicetree, linux-arm-kernel, David S . Miller,
	Rob Herring, Shawn Guo

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:44 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
> 
> On Thu, Jan 17, 2019 at 09:49:36AM +0800, Yangbo Lu wrote:
> > 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.
> 
> To me this feature makes more sense as a debugf-fs option.

[Y.b. Lu] Let me try debug-fs and update the patch-set.
Thanks for your suggestion.

> 
> Thanks,
> Richard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
@ 2019-01-18  8:11       ` Y.b. Lu
  0 siblings, 0 replies; 24+ messages in thread
From: Y.b. Lu @ 2019-01-18  8:11 UTC (permalink / raw)
  To: Richard Cochran
  Cc: devicetree, netdev, Rob Herring, Shawn Guo, David S . Miller,
	linux-arm-kernel

Hi,

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, January 18, 2019 9:44 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; David S . Miller <davem@davemloft.net>;
> Rob Herring <robh+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>
> Subject: Re: [v2, 5/5] ptp_qoriq: add fiper pulse loopback support
> 
> On Thu, Jan 17, 2019 at 09:49:36AM +0800, Yangbo Lu wrote:
> > 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.
> 
> To me this feature makes more sense as a debugf-fs option.

[Y.b. Lu] Let me try debug-fs and update the patch-set.
Thanks for your suggestion.

> 
> Thanks,
> Richard


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-01-18  8:12 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17  1:49 [v2, 0/5] External trigger stamp fifo support for ptp_qoriq Yangbo Lu
2019-01-17  1:49 ` Yangbo Lu
2019-01-17  1:49 ` [v2, 1/5] ptp_qoriq: fix interrupt enabling and handling Yangbo Lu
2019-01-17  1:49   ` Yangbo Lu
2019-01-17  1:49 ` [v2, 2/5] ptp_qoriq: support external trigger stamp FIFO Yangbo Lu
2019-01-17  1:49   ` Yangbo Lu
2019-01-17  1:49 ` [v2, 3/5] dt-binding: ptp_qoriq: document "fsl,extts-fifo" property Yangbo Lu
2019-01-17  1:49   ` Yangbo Lu
2019-01-18  1:34   ` Richard Cochran
2019-01-18  1:34     ` Richard Cochran
2019-01-18  1:39     ` Richard Cochran
2019-01-18  1:39       ` Richard Cochran
2019-01-18  8:10       ` Y.b. Lu
2019-01-18  8:10         ` Y.b. Lu
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
2019-01-17  1:49 ` [v2, 5/5] ptp_qoriq: add fiper pulse loopback support Yangbo Lu
2019-01-17  1:49   ` Yangbo Lu
2019-01-18  1:44   ` Richard Cochran
2019-01-18  1:44     ` Richard Cochran
2019-01-18  8:11     ` Y.b. Lu
2019-01-18  8:11       ` Y.b. Lu
2019-01-18  8:11       ` Y.b. Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.