OpenCloudOS-Kernel/drivers/net/dsa/sja1105
Vladimir Oltean 0ba83aa037 net: dsa: sja1105: the PTP_CLK extts input reacts on both edges
It looks like the sja1105 external timestamping input is not as generic
as we thought. When fed a signal with 50% duty cycle, it will timestamp
both the rising and the falling edge. When fed a short pulse signal,
only the timestamp of the falling edge will be seen in the PTPSYNCTS
register, because that of the rising edge had been overwritten. So the
moral is: don't feed it short pulse inputs.

Luckily this is not a complete deal breaker, as we can still work with
1 Hz square waves. But the problem is that the extts polling period was
not dimensioned enough for this input signal. If we leave the period at
half a second, we risk losing timestamps due to jitter in the measuring
process. So we need to increase it to 4 times per second.

Also, the very least we can do to inform the user is to deny any other
flags combination than with PTP_RISING_EDGE and PTP_FALLING_EDGE both
set.

Fixes: 747e5eb31d ("net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-06 15:03:14 -07:00
..
Kconfig net: Make PTP-specific drivers depend on PTP_1588_CLOCK 2020-05-01 15:27:51 -07:00
Makefile net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105.h net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_clocking.c net: dsa: sja1105: Add support for the SGMII port 2020-03-20 08:55:21 -07:00
sja1105_dynamic_config.c net: dsa: sja1105: make the AVB table dynamically reconfigurable 2020-03-23 22:15:07 -07:00
sja1105_dynamic_config.h net: dsa: sja1105: Use the correct style for SPDX License Identifier 2019-10-15 20:16:26 -07:00
sja1105_ethtool.c net: dsa: sja1105: show more ethtool statistics counters for P/Q/R/S 2020-03-29 22:04:20 -07:00
sja1105_flower.c net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_main.c net: dsa: sja1105: add broadcast and per-traffic class policers 2020-03-30 11:44:01 -07:00
sja1105_ptp.c net: dsa: sja1105: the PTP_CLK extts input reacts on both edges 2020-05-06 15:03:14 -07:00
sja1105_ptp.h net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_sgmii.h net: dsa: sja1105: Add support for the SGMII port 2020-03-20 08:55:21 -07:00
sja1105_spi.c net: dsa: sja1105: show more ethtool statistics counters for P/Q/R/S 2020-03-29 22:04:20 -07:00
sja1105_static_config.c net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_static_config.h net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT 2020-03-23 22:15:07 -07:00
sja1105_tas.c net: dsa: sja1105: make future_base_time a common helper 2020-03-23 22:15:07 -07:00
sja1105_tas.h net: dsa: sja1105: Implement state machine for TAS with PTP clock source 2019-11-14 14:50:35 -08:00