Home
last modified time | relevance | path

Searched full:ptp (Results 1 – 25 of 439) sorted by relevance

12345678910>>...18

/linux/drivers/net/ethernet/qlogic/qede/
H A Dqede_ptp.c21 /* ptp spinlock is used for protecting the cycle/time counter fields
22 * and, also for serializing the qed PTP API invocations.
31 * qede_ptp_adjfine() - Adjust the frequency of the PTP cycle counter.
33 * @info: The PTP clock info structure.
42 struct qede_ptp *ptp = container_of(info, struct qede_ptp, clock_info); in qede_ptp_adjfine() local
44 struct qede_dev *edev = ptp->edev; in qede_ptp_adjfine()
49 spin_lock_bh(&ptp->lock); in qede_ptp_adjfine()
50 rc = ptp->ops->adjfreq(edev->cdev, ppb); in qede_ptp_adjfine()
51 spin_unlock_bh(&ptp->lock); in qede_ptp_adjfine()
53 DP_ERR(edev, "PTP adjfine called while interface is down\n"); in qede_ptp_adjfine()
[all …]
/linux/drivers/net/ethernet/hisilicon/hns3/hns3pf/
H A Dhclge_ptp.c11 struct hclge_ptp *ptp = hdev->ptp; in hclge_ptp_get_cycle() local
13 ptp->cycle.quo = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_QUO_REG) & in hclge_ptp_get_cycle()
15 ptp->cycle.numer = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_NUM_REG); in hclge_ptp_get_cycle()
16 ptp->cycle.den = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_DEN_REG); in hclge_ptp_get_cycle()
18 if (ptp->cycle.den == 0) { in hclge_ptp_get_cycle()
19 dev_err(&hdev->pdev->dev, "invalid ptp cycle denominator!\n"); in hclge_ptp_get_cycle()
26 static int hclge_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in hclge_ptp_adjfine() argument
28 struct hclge_dev *hdev = hclge_ptp_get_hdev(ptp); in hclge_ptp_adjfine()
29 struct hclge_ptp_cycle *cycle = &hdev->ptp->cycle; in hclge_ptp_adjfine()
39 * denominator is fixed to ptp->cycle.den, and numerator in hclge_ptp_adjfine()
[all …]
/linux/drivers/net/ethernet/marvell/octeontx2/nic/
H A Dotx2_ptp.c13 static bool is_tstmp_atomic_update_supported(struct otx2_ptp *ptp) in is_tstmp_atomic_update_supported() argument
19 if (!ptp->nic) in is_tstmp_atomic_update_supported()
22 mutex_lock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported()
23 req = otx2_mbox_alloc_msg_ptp_get_cap(&ptp->nic->mbox); in is_tstmp_atomic_update_supported()
25 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported()
29 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in is_tstmp_atomic_update_supported()
31 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported()
34 rsp = (struct ptp_get_cap_rsp *)otx2_mbox_get_rsp(&ptp->nic->mbox.mbox, 0, in is_tstmp_atomic_update_supported()
36 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported()
49 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_hw_adjtime() local
[all …]
/linux/Documentation/ABI/testing/
H A Dsysfs-ptp1 What: /sys/class/ptp/
7 features of PTP hardware clocks.
9 What: /sys/class/ptp/ptp<N>/
13 This directory contains the attributes of the Nth PTP
14 hardware clock registered into the PTP class driver
17 What: /sys/class/ptp/ptp<N>/clock_name
21 This file contains the name of the PTP hardware clock
28 What: /sys/class/ptp/ptp<N>/max_adjustment
32 This file contains the PTP hardware clock's maximum
36 What: /sys/class/ptp/ptp<N>/max_vclocks
[all …]
/linux/drivers/net/ethernet/sfc/siena/
H A Dptp.c9 * PTP support is assisted by firmware running on the MC, which provides
11 * PTP event packets are queued onto internal queues for subsequent processing;
17 * with the hardware timestamp. The PTP receive packet queue is searched
21 * It is important for the operation of the PTP protocol that the ordering
47 #include "nic.h" /* indirectly includes ptp.h */
49 /* Maximum number of events expected to make up a PTP event */
76 /* Offsets into PTP packet for identification. These offsets are from the
77 * start of the IP header, not the MAC header. Note that neither PTP V1 nor
78 * PTP V2 permit the use of IPV4 options.
91 /* The minimum length of a PTP V1 packet for offsets, etc. to be valid:
[all …]
/linux/drivers/net/ethernet/sfc/
H A Dptp.c9 * PTP support is assisted by firmware running on the MC, which provides
11 * PTP event packets are queued onto internal queues for subsequent processing;
17 * with the hardware timestamp. The PTP receive packet queue is searched
21 * It is important for the operation of the PTP protocol that the ordering
47 #include "nic.h" /* indirectly includes ptp.h */
50 /* Maximum number of events expected to make up a PTP event */
80 /* Offsets into PTP packet for identification. These offsets are from the
81 * start of the IP header, not the MAC header. Note that neither PTP V1 nor
82 * PTP V2 permit the use of IPV4 options.
92 /* The minimum length of a PTP V1 packet for offsets, etc. to be valid:
[all …]
/linux/drivers/net/ethernet/intel/idpf/
H A Didpf_ptp.c8 * idpf_ptp_get_access - Determine the access type of the PTP features
13 * Return: the type of supported access for the PTP feature.
18 if (adapter->ptp->caps & direct) in idpf_ptp_get_access()
20 else if (adapter->ptp->caps & mailbox) in idpf_ptp_get_access()
27 * idpf_ptp_get_features_access - Determine the access type of PTP features
30 * Fulfill the adapter structure with type of the supported PTP features
35 struct idpf_ptp *ptp = adapter->ptp; in idpf_ptp_get_features_access() local
41 ptp->get_dev_clk_time_access = idpf_ptp_get_access(adapter, in idpf_ptp_get_features_access()
48 ptp->get_cross_tstamp_access = idpf_ptp_get_access(adapter, in idpf_ptp_get_features_access()
55 ptp->set_dev_clk_time_access = idpf_ptp_get_access(adapter, in idpf_ptp_get_features_access()
[all …]
H A Didpf_virtchnl_ptp.c9 * idpf_ptp_get_caps - Send virtchnl get ptp capabilities message
12 * Send virtchnl get PTP capabilities message.
37 struct idpf_ptp *ptp = adapter->ptp; in idpf_ptp_get_caps() local
56 ptp->caps = le32_to_cpu(recv_ptp_caps_msg->caps); in idpf_ptp_get_caps()
57 ptp->base_incval = le64_to_cpu(recv_ptp_caps_msg->base_incval); in idpf_ptp_get_caps()
58 ptp->max_adj = le32_to_cpu(recv_ptp_caps_msg->max_adj); in idpf_ptp_get_caps()
60 scnd_mbx = &ptp->secondary_mbx; in idpf_ptp_get_caps()
70 /* Determine the access type for the PTP features */ in idpf_ptp_get_caps()
73 access_type = ptp->get_dev_clk_time_access; in idpf_ptp_get_caps()
80 ptp->dev_clk_regs.dev_clk_ns_l = idpf_get_reg_addr(adapter, in idpf_ptp_get_caps()
[all …]
H A Didpf_ptp.h10 * struct idpf_ptp_cmd - PTP command masks
19 /* struct idpf_ptp_dev_clk_regs - PTP device registers
34 * @cmd: PTP command register
36 * @cmd_sync: PTP command synchronization register
70 * enum idpf_ptp_access - the type of access to PTP operations
82 * struct idpf_ptp_secondary_mbx - PTP secondary mailbox
83 * @peer_mbx_q_id: PTP mailbox queue ID
84 * @peer_id: Peer ID for PTP Device Control daemon
159 * struct idpf_ptp - PTP parameters
160 * @info: structure defining PTP hardware capabilities
[all …]
/linux/drivers/net/phy/
H A Ddp83640_reg.h12 #define PTP_CTL 0x0014 /* PTP Control Register */
13 #define PTP_TDR 0x0015 /* PTP Time Data Register */
14 #define PTP_STS 0x0016 /* PTP Status Register */
15 #define PTP_TSTS 0x0017 /* PTP Trigger Status Register */
16 #define PTP_RATEL 0x0018 /* PTP Rate Low Register */
17 #define PTP_RATEH 0x0019 /* PTP Rate High Register */
18 #define PTP_RDCKSUM 0x001a /* PTP Read Checksum */
19 #define PTP_WRCKSUM 0x001b /* PTP Write Checksum */
20 #define PTP_TXTS 0x001c /* PTP Transmit Timestamp Register, in four 16-bit reads */
21 #define PTP_RXTS 0x001d /* PTP Receive Timestamp Register, in six? 16-bit reads */
[all …]
/linux/drivers/net/ethernet/google/gve/
H A Dgve_ptp.c31 const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info); in gve_ptp_do_aux_work() local
32 struct gve_priv *priv = ptp->priv; in gve_ptp_do_aux_work()
55 struct gve_ptp *ptp; in gve_ptp_init() local
59 dev_dbg(&priv->pdev->dev, "Device does not support PTP\n"); in gve_ptp_init()
63 priv->ptp = kzalloc(sizeof(*priv->ptp), GFP_KERNEL); in gve_ptp_init()
64 if (!priv->ptp) in gve_ptp_init()
67 ptp = priv->ptp; in gve_ptp_init()
68 ptp->info = gve_ptp_caps; in gve_ptp_init()
69 ptp->clock = ptp_clock_register(&ptp->info, &priv->pdev->dev); in gve_ptp_init()
71 if (IS_ERR(ptp->clock)) { in gve_ptp_init()
[all …]
/linux/drivers/net/ethernet/intel/iavf/
H A Diavf_ptp.c8 container_of_const(info, struct iavf_adapter, ptp.info)
99 adapter->ptp.hwtstamp_config = *config; in iavf_ptp_set_ts_config()
105 * iavf_ptp_cap_supported - Check if a PTP capability is supported
118 return (adapter->ptp.hw_caps.caps & cap) == cap; in iavf_ptp_cap_supported()
122 * iavf_allocate_ptp_cmd - Allocate a PTP command message structure
126 * Allocates a PTP command message and pre-fills it with the provided message
129 * Return: allocated PTP command.
147 * iavf_queue_ptp_cmd - Queue PTP command for sending over virtchnl
151 * Queue the given command structure into the PTP virtchnl command queue tos
157 mutex_lock(&adapter->ptp.aq_cmd_lock); in iavf_queue_ptp_cmd()
[all …]
/linux/drivers/ptp/
H A Dptp_vclock.c3 * PTP virtual clock driver
43 static int ptp_vclock_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_vclock_adjfine() argument
45 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_adjfine()
60 static int ptp_vclock_adjtime(struct ptp_clock_info *ptp, s64 delta) in ptp_vclock_adjtime() argument
62 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_adjtime()
72 static int ptp_vclock_gettime(struct ptp_clock_info *ptp, in ptp_vclock_gettime() argument
75 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_gettime()
87 static int ptp_vclock_gettimex(struct ptp_clock_info *ptp, in ptp_vclock_gettimex() argument
91 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_gettimex()
111 static int ptp_vclock_settime(struct ptp_clock_info *ptp, in ptp_vclock_settime() argument
[all …]
/linux/drivers/virtio/
H A Dvirtio_rtc_ptp.c3 * Expose virtio_rtc clocks as PTP clocks.
8 * Derived from ptp_kvm_common.c, virtual PTP 1588 clock for use with KVM
23 * struct viortc_ptp_clock - PTP clock abstraction
24 * @ptp_clock: PTP clock handle for unregistering
26 * @ptp_info: PTP clock description
78 * @vio_ptp: virtio_rtc PTP clock
113 * PTP clock operations
117 * viortc_ptp_getcrosststamp() - PTP clock getcrosststamp op
118 * @ptp: PTP clock info
124 static int viortc_ptp_getcrosststamp(struct ptp_clock_info *ptp, in viortc_ptp_getcrosststamp() argument
[all …]
/linux/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
H A Dbase.c44 const int slot = pt->base >> pt->ptp->shift; in nvkm_mmu_ptp_put()
45 struct nvkm_mmu_ptp *ptp = pt->ptp; in nvkm_mmu_ptp_put() local
48 * there will be now, so return PTP to the cache. in nvkm_mmu_ptp_put()
50 if (!ptp->free) in nvkm_mmu_ptp_put()
51 list_add(&ptp->head, &mmu->ptp.list); in nvkm_mmu_ptp_put()
52 ptp->free |= BIT(slot); in nvkm_mmu_ptp_put()
54 /* If there's no more sub-allocations, destroy PTP. */ in nvkm_mmu_ptp_put()
55 if (ptp->free == ptp->mask) { in nvkm_mmu_ptp_put()
56 nvkm_mmu_ptc_put(mmu, force, &ptp->pt); in nvkm_mmu_ptp_put()
57 list_del(&ptp->head); in nvkm_mmu_ptp_put()
[all …]
/linux/drivers/net/ethernet/intel/ice/
H A Dice_ptp.c66 return !ctrl_pf ? NULL : &ctrl_pf->ptp; in ice_get_ctrl_ptp()
80 const struct ptp_clock_info *info = &pf->ptp.info; in ice_ptp_find_pin_idx()
105 switch (pf->ptp.tx_interrupt_mode) { in ice_ptp_cfg_tx_interrupt()
118 enable = pf->ptp.tstamp_config.tx_type == HWTSTAMP_TX_ON; in ice_ptp_cfg_tx_interrupt()
187 enable_rx = pf->ptp.tstamp_config.rx_filter == HWTSTAMP_FILTER_ALL; in ice_ptp_restore_timestamp_mode()
335 * time stored in the device private PTP structure as the basis for timestamp
347 discard_time = pf->ptp.cached_phc_jiffies + msecs_to_jiffies(2000); in ice_ptp_extend_40b_ts()
349 pf->ptp.tx_hwtstamp_discarded++; in ice_ptp_extend_40b_ts()
353 return ice_ptp_extend_32b_ts(pf->ptp.cached_phc_time, in ice_ptp_extend_40b_ts()
359 * @tx: the PTP Tx timestamp tracker to check
[all …]
/linux/drivers/net/ethernet/intel/e1000e/
H A Dptp.c4 /* PTP 1588 Hardware Clock (PHC)
5 * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb)
19 * @ptp: ptp clock structure
27 static int e1000e_phc_adjfine(struct ptp_clock_info *ptp, long delta) in e1000e_phc_adjfine() argument
29 struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, in e1000e_phc_adjfine()
61 * @ptp: ptp clock structure
66 static int e1000e_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) in e1000e_phc_adjtime() argument
68 struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, in e1000e_phc_adjtime()
135 * @ptp: ptp clock structure
141 static int e1000e_phc_getcrosststamp(struct ptp_clock_info *ptp, in e1000e_phc_getcrosststamp() argument
[all …]
/linux/drivers/net/ethernet/chelsio/cxgb4/
H A Dcxgb4_ptp.c2 * cxgb4_ptp.c:Chelsio PTP support for T5/T6
54 * cxgb4_ptp_is_ptp_tx - determine whether TX packet is PTP or not
55 * @skb: skb of outgoing ptp request
80 * cxgb4_ptp_is_ptp_rx - determine whether RX packet is PTP or not
81 * @skb: skb of incoming ptp request
94 * cxgb4_ptp_read_hwstamp - read timestamp for TX event PTP message
121 * cxgb4_ptprx_timestamping - Enable Timestamp for RX PTP event message
145 "PTP: %s error %d\n", __func__, -err); in cxgb4_ptprx_timestamping()
166 "PTP: %s error %d\n", __func__, -err); in cxgb4_ptp_txtype()
192 "PTP: %s error %d\n", __func__, -err); in cxgb4_ptp_redirect_rx_packet()
[all …]
/linux/drivers/net/ethernet/mellanox/mlx4/
H A Den_clock.c83 * mlx4_en_remove_timestamp - disable PTP device
86 * Stop the PTP support.
120 * @ptp: ptp clock structure
128 static int mlx4_en_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in mlx4_en_phc_adjfine() argument
132 struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, in mlx4_en_phc_adjfine()
147 * @ptp: ptp clock structure
152 static int mlx4_en_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) in mlx4_en_phc_adjtime() argument
154 struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, in mlx4_en_phc_adjtime()
167 * @ptp: ptp clock structure
173 static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, in mlx4_en_phc_gettime() argument
[all …]
/linux/include/linux/
H A Dptp_classify.h3 * PTP 1588 support
5 * This file implements a BPF that recognizes PTP event messages.
20 #define PTP_CLASS_NONE 0x00 /* not a PTP event message */
50 /* PTP header flag fields */
85 * ptp_classify_raw - classify a PTP packet
89 * determine the PTP class. In case the skb does not contain any
90 * PTP protocol data, PTP_CLASS_NONE will be returned, otherwise
97 * ptp_parse_header - Get pointer to the PTP v2 header
107 * Return: Pointer to the ptp v2 header or NULL if not found
112 * ptp_get_msgtype - Extract ptp message type from given header
[all …]
/linux/Documentation/devicetree/bindings/pinctrl/
H A Dmarvell,kirkwood-pinctrl.txt28 mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
29 mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig)
30 mpp6 6 sysrst(out), spi(mosi), ptp(trig)
31 mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
32 mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
34 mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
36 mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig)
37 mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
38 ptp-2(trig)
66 mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
[all …]
/linux/drivers/net/ethernet/cavium/common/
H A Dcavium_ptp.c2 /* cavium_ptp.c - PTP 1588 clock on Cavium hardware
61 struct cavium_ptp *ptp; in cavium_ptp_get() local
69 ptp = pci_get_drvdata(pdev); in cavium_ptp_get()
70 if (!ptp) in cavium_ptp_get()
71 ptp = ERR_PTR(-EPROBE_DEFER); in cavium_ptp_get()
72 if (IS_ERR(ptp)) in cavium_ptp_get()
75 return ptp; in cavium_ptp_get()
79 void cavium_ptp_put(struct cavium_ptp *ptp) in cavium_ptp_put() argument
81 if (!ptp) in cavium_ptp_put()
83 pci_dev_put(ptp->pdev); in cavium_ptp_put()
[all …]
H A Dcavium_ptp.h2 /* cavium_ptp.h - PTP 1588 clock on Cavium hardware
30 void cavium_ptp_put(struct cavium_ptp *ptp);
32 static inline u64 cavium_ptp_tstamp2time(struct cavium_ptp *ptp, u64 tstamp) in cavium_ptp_tstamp2time() argument
37 spin_lock_irqsave(&ptp->spin_lock, flags); in cavium_ptp_tstamp2time()
38 ret = timecounter_cyc2time(&ptp->time_counter, tstamp); in cavium_ptp_tstamp2time()
39 spin_unlock_irqrestore(&ptp->spin_lock, flags); in cavium_ptp_tstamp2time()
56 static inline void cavium_ptp_put(struct cavium_ptp *ptp) {} in cavium_ptp_put() argument
58 static inline u64 cavium_ptp_tstamp2time(struct cavium_ptp *ptp, u64 tstamp) in cavium_ptp_tstamp2time() argument
/linux/drivers/net/phy/mscc/
H A Dmscc_ptp.c161 /* Pick bytes from PTP header */
429 static void vsc85xx_dequeue_skb(struct vsc85xx_ptp *ptp) in vsc85xx_dequeue_skb() argument
441 reg = vsc85xx_ts_read_csr(ptp->phydev, PROCESSOR, in vsc85xx_dequeue_skb()
451 reg = vsc85xx_ts_read_csr(ptp->phydev, PROCESSOR, in vsc85xx_dequeue_skb()
459 len = skb_queue_len_lockless(&ptp->tx_queue); in vsc85xx_dequeue_skb()
464 skb = skb_dequeue(&ptp->tx_queue); in vsc85xx_dequeue_skb()
489 skb_queue_tail(&ptp->tx_queue, skb); in vsc85xx_dequeue_skb()
493 static void vsc85xx_get_tx_ts(struct vsc85xx_ptp *ptp) in vsc85xx_get_tx_ts() argument
498 vsc85xx_dequeue_skb(ptp); in vsc85xx_get_tx_ts()
501 reg = vsc85xx_ts_read_csr(ptp->phydev, PROCESSOR, in vsc85xx_get_tx_ts()
[all …]
/linux/Documentation/devicetree/bindings/ptp/
H A Dbrcm,ptp-dte.txt1 * Broadcom Digital Timing Engine(DTE) based PTP clock
9 "brcm,ptp-dte"
11 "brcm,iproc-ptp-dte" - for iproc based SoC's
16 ptp: ptp-dte@180af650 {
17 compatible = "brcm,iproc-ptp-dte", "brcm,ptp-dte";

12345678910>>...18