aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/ksz_common.h
diff options
context:
space:
mode:
authorArun Ramadoss <[email protected]>2023-01-10 08:49:22 +0000
committerDavid S. Miller <[email protected]>2023-01-13 08:40:41 +0000
commitcc13ab18b201ab630f03511060ba289b70052959 (patch)
tree6f17fe9dea678e67fa615d1e364891e228914aaf /drivers/net/dsa/microchip/ksz_common.h
parentnet: dsa: microchip: ptp: manipulating absolute time using ptp hw clock (diff)
downloadkernel-cc13ab18b201ab630f03511060ba289b70052959.tar.gz
kernel-cc13ab18b201ab630f03511060ba289b70052959.zip
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
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