Lines Matching +full:ptp +full:- +full:timer
1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Copyright (C) 2004-2006 Atmel Corporation
100 #define GEM_RXPTPUNI 0x00D4 /* PTP RX Unicast address */
101 #define GEM_TXPTPUNI 0x00D8 /* PTP TX Unicast address */
102 #define GEM_EFTSH 0x00e8 /* PTP Event Frame Transmitted Seconds Register 47:32 */
103 #define GEM_EFRSH 0x00ec /* PTP Event Frame Received Seconds Register 47:32 */
104 #define GEM_PEFTSH 0x00f0 /* PTP Peer Event Frame Transmitted Seconds Register 47:32 */
105 #define GEM_PEFRSH 0x00f4 /* PTP Peer Event Frame Received Seconds Register 47:32 */
114 #define GEM_TX65CNT 0x011c /* 65-127 byte Frames TX counter */
115 #define GEM_TX128CNT 0x0120 /* 128-255 byte Frames TX counter */
116 #define GEM_TX256CNT 0x0124 /* 256-511 byte Frames TX counter */
117 #define GEM_TX512CNT 0x0128 /* 512-1023 byte Frames TX counter */
118 #define GEM_TX1024CNT 0x012c /* 1024-1518 byte Frames TX counter */
135 #define GEM_RX65CNT 0x016c /* 65-127 byte Frames RX Counter */
136 #define GEM_RX128CNT 0x0170 /* 128-255 byte Frames RX Counter */
137 #define GEM_RX256CNT 0x0174 /* 256-511 byte Frames RX Counter */
138 #define GEM_RX512CNT 0x0178 /* 512-1023 byte Frames RX Counter */
139 #define GEM_RX1024CNT 0x017c /* 1024-1518 byte Frames RX Counter */
153 #define GEM_TISUBN 0x01bc /* 1588 Timer Increment Sub-ns */
154 #define GEM_TSH 0x01c0 /* 1588 Timer Seconds High */
155 #define GEM_TSL 0x01d0 /* 1588 Timer Seconds Low */
156 #define GEM_TN 0x01d4 /* 1588 Timer Nanoseconds */
157 #define GEM_TA 0x01d8 /* 1588 Timer Adjust */
158 #define GEM_TI 0x01dc /* 1588 Timer Increment */
159 #define GEM_EFTSL 0x01e0 /* PTP Event Frame Tx Seconds Low */
160 #define GEM_EFTN 0x01e4 /* PTP Event Frame Tx Nanoseconds */
161 #define GEM_EFRSL 0x01e8 /* PTP Event Frame Rx Seconds Low */
162 #define GEM_EFRN 0x01ec /* PTP Event Frame Rx Nanoseconds */
163 #define GEM_PEFTSL 0x01f0 /* PTP Peer Event Frame Tx Secs Low */
164 #define GEM_PEFTN 0x01f4 /* PTP Peer Event Frame Tx Ns */
165 #define GEM_PEFRSL 0x01f8 /* PTP Peer Event Frame Rx Sec Low */
166 #define GEM_PEFRN 0x01fc /* PTP Peer Event Frame Rx Ns */
211 /* Which screening type 2 EtherType register will be used (0 - 7) */
252 #define MACB_PTPUNI_OFFSET 20 /* PTP Unicast packet enable */
264 #define MACB_BIT_RATE_OFFSET 2 /* Discard non-VLAN frames */
348 #define GEM_ADDR64_OFFSET 30 /* Address bus width - 64b or 32b */
419 #define MACB_WOL_OFFSET 14 /* Enable wake-on-lan interrupt */
421 #define MACB_DRQFR_OFFSET 18 /* PTP Delay Request Frame Received */
423 #define MACB_SFR_OFFSET 19 /* PTP Sync Frame Received */
425 #define MACB_DRQFT_OFFSET 20 /* PTP Delay Request Frame Transmitted */
427 #define MACB_SFT_OFFSET 21 /* PTP Sync Frame Transmitted */
439 #define GEM_WOL_OFFSET 28 /* Enable wake-on-lan interrupt */
442 /* Timer increment fields */
588 #define GEM_TSH_OFFSET 0 /* TSU timer value (s). MSB [47:32] of seconds timer count */
592 #define GEM_TSL_OFFSET 0 /* TSU timer value (s). LSB [31:0] of seconds timer count */
596 #define GEM_TN_OFFSET 0 /* TSU timer value (ns) */
618 #define GEM_CMPA_OFFSET 13 /* Compare A - Index to screener type 2 Compare register */
622 #define GEM_CMPB_OFFSET 19 /* Compare B - Index to screener type 2 Compare register */
626 #define GEM_CMPC_OFFSET 25 /* Compare C - Index to screener type 2 Compare register */
688 * Old hardware supports only 6 bit precision but it is enough for PTP.
695 #define GEM_DMA_SEC_MASK (GEM_DMA_SEC_TOP - 1)
759 (((value) & ((1 << MACB_##name##_SIZE) - 1)) \
763 & ((1 << MACB_##name##_SIZE) - 1))
765 (((old) & ~(((1 << MACB_##name##_SIZE) - 1) \
772 (((value) & ((1 << GEM_##name##_SIZE) - 1)) \
776 & ((1 << GEM_##name##_SIZE) - 1))
778 (((old) & ~(((1 << GEM_##name##_SIZE) - 1) \
783 #define macb_readl(port, reg) (port)->macb_reg_readl((port), MACB_##reg)
784 #define macb_writel(port, reg, value) (port)->macb_reg_writel((port), MACB_##reg, (value))
785 #define gem_readl(port, reg) (port)->macb_reg_readl((port), GEM_##reg)
786 #define gem_writel(port, reg, value) (port)->macb_reg_writel((port), GEM_##reg, (value))
787 #define queue_readl(queue, reg) (queue)->bp->macb_reg_readl((queue)->bp, (queue)->reg)
788 #define queue_writel(queue, reg, value) (queue)->bp->macb_reg_writel((queue)->bp, (queue)->reg, (va…
789 #define gem_readl_n(port, reg, idx) (port)->macb_reg_readl((port), GEM_##reg + idx * 4)
790 #define gem_writel_n(port, reg, idx, value) (port)->macb_reg_writel((port), GEM_##reg + idx * 4, (v…
817 /* struct macb_dma_desc - Hardware DMA descriptor
935 /* struct macb_tx_skb - data about an skb which is being transmitted
950 /* Hardware-collected statistics. Used when updating the network
951 * device stats by a periodic timer.
1026 * returned by `ethtool -S`. Also describes which net_device_stats statistics
1165 /* MACB-PTP interface: adapt to platform needs. */
1315 struct macb_ptp_info *ptp_info; /* macb-ptp interface */
1347 #define TSU_SEC_MAX_VAL (((u64)1 << GEM_TSEC_SIZE) - 1)
1348 #define TSU_NSEC_MAX_VAL ((1 << GEM_TN_SIZE) - 1)
1363 if (bp->tstamp_config.tx_type == TSTAMP_DISABLED) in gem_ptp_do_txstamp()
1371 if (bp->tstamp_config.rx_filter == TSTAMP_DISABLED) in gem_ptp_do_rxstamp()
1392 return !!(bp->caps & MACB_CAPS_MACB_IS_GEM); in macb_is_gem()
1397 return IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) && (bp->caps & MACB_CAPS_GEM_HAS_PTP); in gem_has_ptp()
1401 * struct macb_platform_data - platform data for MACB Ethernet used for PCI registration