ptp: add debugfs support for ptp_qoriq

This patch is to add debugfs support for ptp_qoriq. Current debugfs
supports to control fiper1/fiper2 loopback mode. If the loopback mode
is enabled, the fiper1/fiper2 pulse is looped back into trigger1/
trigger2 input. This is very useful for validating hardware and driver
without external hardware. Below is an example to enable fiper1 loopback.

echo 1 > /sys/kernel/debug/2d10e00.ptp_clock/fiper1-loopback

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Yangbo Lu 2019-01-21 18:41:42 +08:00 committed by David S. Miller
parent 47205e2985
commit 19df7510d5
5 changed files with 120 additions and 2 deletions

View file

@ -143,6 +143,8 @@ struct qoriq_ptp {
struct ptp_clock *clock;
struct ptp_clock_info caps;
struct resource *rsrc;
struct dentry *debugfs_root;
struct device *dev;
bool extts_fifo_support;
int irq;
int phc_index;
@ -169,4 +171,14 @@ static inline void qoriq_write(unsigned __iomem *addr, u32 val)
iowrite32be(val, addr);
}
#ifdef CONFIG_DEBUG_FS
void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp);
void ptp_qoriq_remove_debugfs(struct qoriq_ptp *qoriq_ptp);
#else
static inline void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp)
{ }
static inline void ptp_qoriq_remove_debugfs(struct qoriq_ptp *qoriq_ptp)
{ }
#endif
#endif