| /linux/drivers/net/ethernet/broadcom/bnxt/ |
| H A D | bnxt_ptp.c | 62 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg, in bnxt_ptp_settime() local 67 if (BNXT_PTP_USE_RTC(ptp->bp)) in bnxt_ptp_settime() 68 return bnxt_ptp_cfg_settime(ptp->bp, ns); in bnxt_ptp_settime() 70 write_seqlock_irqsave(&ptp->ptp_lock, flags); in bnxt_ptp_settime() 71 timecounter_init(&ptp->tc, &ptp->cc, ns); in bnxt_ptp_settime() 72 write_sequnlock_irqrestore(&ptp->ptp_lock, flags); in bnxt_ptp_settime() 80 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; in __bnxt_refclk_read() local 86 high_before = readl(bp->bar0 + ptp->refclk_mapped_regs[1]); in __bnxt_refclk_read() 88 low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]); in __bnxt_refclk_read() 90 high_now = readl(bp->bar0 + ptp->refclk_mapped_regs[1]); in __bnxt_refclk_read() [all …]
|
| /linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
| H A D | otx2_ptp.c | 13 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 D | sysfs-ptp | 1 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 D | ptp.c | 9 * 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 D | ptp.c | 9 * 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 D | idpf_ptp.c | 8 * 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 D | idpf_virtchnl_ptp.c | 9 * 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 D | idpf_ptp.h | 10 * 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 D | dp83640_reg.h | 12 #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 D | gve_ptp.c | 44 const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info); in gve_ptp_do_aux_work() local 45 struct gve_priv *priv = ptp->priv; in gve_ptp_do_aux_work() 70 struct gve_ptp *ptp; in gve_ptp_init() local 74 dev_dbg(&priv->pdev->dev, "Device does not support PTP\n"); in gve_ptp_init() 78 priv->ptp = kzalloc(sizeof(*priv->ptp), GFP_KERNEL); in gve_ptp_init() 79 if (!priv->ptp) in gve_ptp_init() 82 ptp = priv->ptp; in gve_ptp_init() 83 ptp->info = gve_ptp_caps; in gve_ptp_init() 84 ptp->clock = ptp_clock_register(&ptp->info, &priv->pdev->dev); in gve_ptp_init() 86 if (IS_ERR(ptp->clock)) { in gve_ptp_init() [all …]
|
| /linux/drivers/ptp/ |
| H A D | ptp_chardev.c | 3 * PTP 1588 clock support - character device implementation. 50 void ptp_disable_all_events(struct ptp_clock *ptp) in ptp_disable_all_events() argument 52 struct ptp_clock_info *info = ptp->info; in ptp_disable_all_events() 55 mutex_lock(&ptp->pincfg_mux); in ptp_disable_all_events() 67 mutex_unlock(&ptp->pincfg_mux); in ptp_disable_all_events() 70 int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, in ptp_set_pinfunc() argument 73 struct ptp_clock_info *info = ptp->info; in ptp_set_pinfunc() 135 struct ptp_clock *ptp = container_of(pccontext->clk, struct ptp_clock, clock); in ptp_open() local 149 scoped_guard(spinlock_irq, &ptp->tsevqs_lock) in ptp_open() 150 list_add_tail(&queue->qlist, &ptp->tsevqs); in ptp_open() [all …]
|
| H A D | ptp_vclock.c | 3 * 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 …]
|
| H A D | ptp_kvm_common.c | 3 * Virtual PTP 1588 clock for use with KVM guests 58 static int ptp_kvm_getcrosststamp(struct ptp_clock_info *ptp, in ptp_kvm_getcrosststamp() argument 66 * PTP clock operations 69 static int ptp_kvm_adjfine(struct ptp_clock_info *ptp, long delta) in ptp_kvm_adjfine() argument 74 static int ptp_kvm_adjtime(struct ptp_clock_info *ptp, s64 delta) in ptp_kvm_adjtime() argument 79 static int ptp_kvm_settime(struct ptp_clock_info *ptp, in ptp_kvm_settime() argument 85 static int ptp_kvm_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) in ptp_kvm_gettime() argument 105 static int ptp_kvm_enable(struct ptp_clock_info *ptp, in ptp_kvm_enable() argument 113 .name = "KVM virtual PTP", 158 MODULE_DESCRIPTION("PTP clock using KVMCLOCK");
|
| /linux/drivers/virtio/ |
| H A D | virtio_rtc_ptp.c | 3 * 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 D | base.c | 44 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/e1000e/ |
| H A D | ptp.c | 4 /* 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 D | cxgb4_ptp.c | 2 * 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 D | en_clock.c | 83 * 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 D | ptp_classify.h | 3 * 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 D | marvell,kirkwood-pinctrl.txt | 28 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 D | cavium_ptp.c | 2 /* 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 D | cavium_ptp.h | 2 /* 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/Documentation/devicetree/bindings/ptp/ |
| H A D | brcm,ptp-dte.txt | 1 * 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";
|
| /linux/drivers/net/ethernet/marvell/octeontx2/af/ |
| H A D | ptp.h | 2 /* Marvell PTP driver 15 struct ptp { struct 18 u64 (*read_ptp_tstmp)(struct ptp *ptp); argument 27 struct ptp *ptp_get(void); argument 28 void ptp_put(struct ptp *ptp);
|
| /linux/Documentation/driver-api/ |
| H A D | ptp.rst | 4 PTP hardware clock infrastructure for Linux 7 This patch set introduces support for IEEE 1588 PTP clocks in 9 presents a standardized method for developing PTP user space 11 ancillary features of PTP hardware clocks. 15 complete set of PTP hardware clock functionality. 29 PTP hardware clock kernel API 32 A PTP clock driver registers itself with the class driver. The 39 The class driver supports multiple PTP clock drivers. In normal use 40 cases, only one PTP clock is needed. However, for testing and 44 PTP hardware clock user space API [all …]
|