summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/microchip/ksz_common.h
diff options
context:
space:
mode:
authorArun Ramadoss <arun.ramadoss@microchip.com>2023-01-10 11:49:22 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-13 11:40:41 +0300
commitcc13ab18b201ab630f03511060ba289b70052959 (patch)
tree6f17fe9dea678e67fa615d1e364891e228914aaf /drivers/net/dsa/microchip/ksz_common.h
parentbb01ad30570b09eb83438093cd7d29f04410b12e (diff)
downloadlinux-cc13ab18b201ab630f03511060ba289b70052959.tar.xz
net: dsa: microchip: ptp: enable interrupt for timestamping
PTP Interrupt mask and status register differ from the global and port interrupt mechanism by two methods. One is that for global/port interrupt enabling we have to clear the bit but for ptp interrupt we have to set the bit. And other is bit12:0 is reserved in ptp interrupt registers. This forced to not use the generic implementation of global/port interrupt method routine. This patch implement the ptp interrupt mechanism to read the timestamp register for sync, pdelay_req and pdelay_resp. Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.h')
-rw-r--r--drivers/net/dsa/microchip/ksz_common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 641aca78ef05..ec1bceb4efcc 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -20,6 +20,7 @@
#define KSZ_MAX_NUM_PORTS 8
struct ksz_device;
+struct ksz_port;
struct vlan_table {
u32 table[3];
@@ -83,6 +84,13 @@ struct ksz_irq {
struct ksz_device *dev;
};
+struct ksz_ptp_irq {
+ struct ksz_port *port;
+ u16 ts_reg;
+ char name[16];
+ int num;
+};
+
struct ksz_port {
bool remove_tag; /* Remove Tag flag set, for ksz8795 only */
bool learning;
@@ -106,6 +114,8 @@ struct ksz_port {
struct hwtstamp_config tstamp_config;
bool hwts_tx_en;
bool hwts_rx_en;
+ struct ksz_irq ptpirq;
+ struct ksz_ptp_irq ptpmsg_irq[3];
#endif
};
@@ -612,6 +622,7 @@ static inline int is_lan937x(struct ksz_device *dev)
#define REG_PORT_INT_MASK 0x001F
#define PORT_SRC_PHY_INT 1
+#define PORT_SRC_PTP_INT 2
#define KSZ8795_HUGE_PACKET_SIZE 2000
#define KSZ8863_HUGE_PACKET_SIZE 1916