/linux-6.12.1/drivers/net/ethernet/qlogic/qede/ |
D | qede_ptp.c | 21 /* 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-6.12.1/drivers/net/ethernet/marvell/octeontx2/af/ |
D | ptp.c | 2 /* Marvell PTP driver 16 #include "ptp.h" 19 #define DRV_NAME "Marvell PTP Driver" 67 #define is_rev_A0(ptp) (((ptp)->pdev->revision & 0x0F) == 0x0) argument 68 #define is_rev_A1(ptp) (((ptp)->pdev->revision & 0x0F) == 0x1) argument 70 /* PTP atomic update operation type */ 77 static struct ptp *first_ptp_block; 80 static bool is_ptp_dev_cnf10ka(struct ptp *ptp) in is_ptp_dev_cnf10ka() argument 82 return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_A_PTP; in is_ptp_dev_cnf10ka() 85 static bool is_ptp_dev_cn10ka(struct ptp *ptp) in is_ptp_dev_cn10ka() argument [all …]
|
/linux-6.12.1/drivers/ptp/ |
D | ptp_clock.c | 3 * PTP 1588 clock support 29 .name = "ptp", 96 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_settime() local 98 if (ptp_clock_freerun(ptp)) { in ptp_clock_settime() 99 pr_err("ptp: physical clock is free running\n"); in ptp_clock_settime() 103 return ptp->info->settime64(ptp->info, tp); in ptp_clock_settime() 108 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_gettime() local 111 if (ptp->info->gettimex64) in ptp_clock_gettime() 112 err = ptp->info->gettimex64(ptp->info, tp, NULL); in ptp_clock_gettime() 114 err = ptp->info->gettime64(ptp->info, tp); in ptp_clock_gettime() [all …]
|
D | ptp_sysfs.c | 3 * PTP 1588 clock support - sysfs interface. 16 struct ptp_clock *ptp = dev_get_drvdata(dev); in clock_name_show() local 17 return sysfs_emit(page, "%s\n", ptp->info->name); in clock_name_show() 25 struct ptp_clock *ptp = dev_get_drvdata(dev); in max_phase_adjustment_show() local 27 return sysfs_emit(page, "%d\n", ptp->info->getmaxphase(ptp->info)); in max_phase_adjustment_show() 35 struct ptp_clock *ptp = dev_get_drvdata(dev); \ 36 return sysfs_emit(page, "%d\n", ptp->info->var); \ 51 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_enable_store() local 52 struct ptp_clock_info *ops = ptp->info; in extts_enable_store() 76 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_fifo_show() local [all …]
|
D | Kconfig | 3 # PTP clock support configuration 6 menu "PTP clock support" 9 tristate "PTP clock support" 17 standard defines a Precision Time Protocol (PTP), which can 23 This driver adds support for PTP clocks as character 24 devices. If you want to use a PTP clock, then you should 28 will be called ptp. 37 into vmlinux while the PTP support itself is in a loadable 39 If PTP support is disabled, this dependency will still be 43 tristate "Broadcom DTE as PTP clock" [all …]
|
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 …]
|
D | ptp_chardev.c | 3 * PTP 1588 clock support - character device implementation. 49 int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, in ptp_set_pinfunc() argument 52 struct ptp_clock_info *info = ptp->info; in ptp_set_pinfunc() 108 struct ptp_clock *ptp = in ptp_open() local 124 spin_lock_irqsave(&ptp->tsevqs_lock, flags); in ptp_open() 125 list_add_tail(&queue->qlist, &ptp->tsevqs); in ptp_open() 126 spin_unlock_irqrestore(&ptp->tsevqs_lock, flags); in ptp_open() 132 debugfs_create_dir(debugfsname, ptp->debugfs_root); in ptp_open() 146 struct ptp_clock *ptp = in ptp_release() local 151 spin_lock_irqsave(&ptp->tsevqs_lock, flags); in ptp_release() [all …]
|
/linux-6.12.1/drivers/net/ethernet/broadcom/bnxt/ |
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 spin_lock_irqsave(&ptp->ptp_lock, flags); in bnxt_ptp_settime() 71 timecounter_init(&ptp->tc, &ptp->cc, ns); in bnxt_ptp_settime() 72 spin_unlock_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-6.12.1/drivers/net/ethernet/marvell/octeontx2/nic/ |
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-6.12.1/drivers/net/ethernet/hisilicon/hns3/hns3pf/ |
D | hclge_ptp.c | 10 struct hclge_ptp *ptp = hdev->ptp; in hclge_ptp_get_cycle() local 12 ptp->cycle.quo = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_QUO_REG) & in hclge_ptp_get_cycle() 14 ptp->cycle.numer = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_NUM_REG); in hclge_ptp_get_cycle() 15 ptp->cycle.den = readl(hdev->ptp->io_base + HCLGE_PTP_CYCLE_DEN_REG); in hclge_ptp_get_cycle() 17 if (ptp->cycle.den == 0) { in hclge_ptp_get_cycle() 18 dev_err(&hdev->pdev->dev, "invalid ptp cycle denominator!\n"); in hclge_ptp_get_cycle() 25 static int hclge_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in hclge_ptp_adjfine() argument 27 struct hclge_dev *hdev = hclge_ptp_get_hdev(ptp); in hclge_ptp_adjfine() 28 struct hclge_ptp_cycle *cycle = &hdev->ptp->cycle; in hclge_ptp_adjfine() 38 * denominator is fixed to ptp->cycle.den, and numerator in hclge_ptp_adjfine() [all …]
|
/linux-6.12.1/drivers/net/ethernet/microchip/ |
D | lan743x_ptp.c | 81 struct lan743x_ptp *ptp = &adapter->ptp; in lan743x_ptp_tx_ts_enqueue_ts() local 83 spin_lock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_enqueue_ts() 84 if (ptp->tx_ts_queue_size < LAN743X_PTP_NUMBER_OF_TX_TIMESTAMPS) { in lan743x_ptp_tx_ts_enqueue_ts() 85 ptp->tx_ts_seconds_queue[ptp->tx_ts_queue_size] = seconds; in lan743x_ptp_tx_ts_enqueue_ts() 86 ptp->tx_ts_nseconds_queue[ptp->tx_ts_queue_size] = nano_seconds; in lan743x_ptp_tx_ts_enqueue_ts() 87 ptp->tx_ts_header_queue[ptp->tx_ts_queue_size] = header; in lan743x_ptp_tx_ts_enqueue_ts() 88 ptp->tx_ts_queue_size++; in lan743x_ptp_tx_ts_enqueue_ts() 93 spin_unlock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_enqueue_ts() 98 struct lan743x_ptp *ptp = &adapter->ptp; in lan743x_ptp_tx_ts_complete() local 105 spin_lock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_complete() [all …]
|
/linux-6.12.1/Documentation/ABI/testing/ |
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-6.12.1/drivers/net/ethernet/sfc/siena/ |
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-6.12.1/drivers/net/ethernet/sfc/ |
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-6.12.1/drivers/net/phy/ |
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-6.12.1/drivers/net/ethernet/renesas/ |
D | ravb_ptp.c | 2 /* PTP 1588 clock using the Renesas Ethernet AVB 73 u32 gti_ns_plus_1 = (priv->ptp.current_addend >> 20) + 1; in ravb_ptp_update_compare() 90 /* PTP clock operations */ 91 static int ravb_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ravb_ptp_adjfine() argument 93 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjfine() 94 ptp.info); in ravb_ptp_adjfine() 100 addend = (u32)adjust_by_scaled_ppm(priv->ptp.default_addend, in ravb_ptp_adjfine() 105 priv->ptp.current_addend = addend; in ravb_ptp_adjfine() 120 static int ravb_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) in ravb_ptp_adjtime() argument 122 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjtime() [all …]
|
D | rcar_gen4_ptp.c | 15 #define ptp_to_priv(ptp) container_of(ptp, struct rcar_gen4_ptp_private, info) argument 29 static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in rcar_gen4_ptp_adjfine() argument 31 struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); in rcar_gen4_ptp_adjfine() 47 static void _rcar_gen4_ptp_gettime(struct ptp_clock_info *ptp, in _rcar_gen4_ptp_gettime() argument 50 struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); in _rcar_gen4_ptp_gettime() 57 static int rcar_gen4_ptp_gettime(struct ptp_clock_info *ptp, in rcar_gen4_ptp_gettime() argument 60 struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); in rcar_gen4_ptp_gettime() 64 _rcar_gen4_ptp_gettime(ptp, ts); in rcar_gen4_ptp_gettime() 71 static void _rcar_gen4_ptp_settime(struct ptp_clock_info *ptp, in _rcar_gen4_ptp_settime() argument 74 struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); in _rcar_gen4_ptp_settime() [all …]
|
/linux-6.12.1/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ |
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-6.12.1/include/linux/ |
D | ptp_clock_kernel.h | 3 * PTP 1588 clock support 19 * struct ptp_clock_request - request PTP clock event 59 * struct ptp_clock_info - describes a PTP hardware clock 145 * @verify: Confirm that a pin can perform a given function. The PTP 178 int (*adjfine)(struct ptp_clock_info *ptp, long scaled_ppm); 179 int (*adjphase)(struct ptp_clock_info *ptp, s32 phase); 180 s32 (*getmaxphase)(struct ptp_clock_info *ptp); 181 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); 182 int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts); 183 int (*gettimex64)(struct ptp_clock_info *ptp, struct timespec64 *ts, [all …]
|
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-6.12.1/drivers/net/ethernet/intel/ice/ |
D | ice_ptp.c | 179 * @info: the driver's PTP info structure 220 * @info: the driver's PTP info structure 269 switch (pf->ptp.tx_interrupt_mode) { in ice_ptp_cfg_tx_interrupt() 282 enable = pf->ptp.tstamp_config.tx_type == HWTSTAMP_TX_ON; in ice_ptp_cfg_tx_interrupt() 351 enable_rx = pf->ptp.tstamp_config.rx_filter == HWTSTAMP_FILTER_ALL; in ice_ptp_restore_timestamp_mode() 487 * time stored in the device private PTP structure as the basis for timestamp 499 discard_time = pf->ptp.cached_phc_jiffies + msecs_to_jiffies(2000); in ice_ptp_extend_40b_ts() 501 pf->ptp.tx_hwtstamp_discarded++; in ice_ptp_extend_40b_ts() 505 return ice_ptp_extend_32b_ts(pf->ptp.cached_phc_time, in ice_ptp_extend_40b_ts() 511 * @tx: the PTP Tx timestamp tracker to check [all …]
|
/linux-6.12.1/drivers/net/ethernet/intel/e1000e/ |
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-6.12.1/drivers/net/ethernet/chelsio/cxgb4/ |
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-6.12.1/drivers/net/dsa/mv88e6xxx/ |
D | hwtstamp.h | 18 /* Global 6352 PTP registers */ 19 /* Offset 0x00: PTP EtherType */ 33 /* Offset 0x05: PTP Global Configuration */ 39 /* Offset 0x07: PTP Global Configuration */ 48 /* Offset 0x08: PTP Interrupt Status */ 51 /* Per-Port 6352 PTP Registers */ 52 /* Offset 0x00: PTP Configuration 0 */ 62 /* Offset 0x01: PTP Configuration 1 */ 65 /* Offset 0x02: PTP Configuration 2 */ 71 /* Offset 0x03: PTP LED Configuration */ [all …]
|
/linux-6.12.1/drivers/net/ethernet/stmicro/stmmac/ |
D | stmmac_ptp.c | 3 PTP 1588 clock using the STMMAC. 17 * @ptp: pointer to ptp_clock_info structure 24 static int stmmac_adjust_freq(struct ptp_clock_info *ptp, long scaled_ppm) in stmmac_adjust_freq() argument 27 container_of(ptp, struct stmmac_priv, ptp_clock_ops); in stmmac_adjust_freq() 43 * @ptp: pointer to ptp_clock_info structure 48 static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta) in stmmac_adjust_time() argument 51 container_of(ptp, struct stmmac_priv, ptp_clock_ops); in stmmac_adjust_time() 70 /* If EST is enabled, disabled it before adjust ptp time. */ in stmmac_adjust_time() 84 /* Calculate new basetime and re-configured EST after PTP time adjust. */ in stmmac_adjust_time() 118 * @ptp: pointer to ptp_clock_info structure [all …]
|