| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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_adjfreq() - Adjust the frequency of the PTP cycle counter. 33 * @info: The PTP clock info structure. 40 struct qede_ptp *ptp = container_of(info, struct qede_ptp, clock_info); in qede_ptp_adjfreq() local 41 struct qede_dev *edev = ptp->edev; in qede_ptp_adjfreq() 46 spin_lock_bh(&ptp->lock); in qede_ptp_adjfreq() 47 rc = ptp->ops->adjfreq(edev->cdev, ppb); in qede_ptp_adjfreq() 48 spin_unlock_bh(&ptp->lock); in qede_ptp_adjfreq() 50 DP_ERR(edev, "PTP adjfreq called while interface is down\n"); in qede_ptp_adjfreq() [all …]
|
| /kernel/linux/linux-6.6/drivers/net/ethernet/marvell/octeontx2/af/ |
| D | ptp.c | 2 /* Marvell PTP driver 16 #include "ptp.h" 19 #define DRV_NAME "Marvell PTP Driver" 66 #define is_rev_A0(ptp) (((ptp)->pdev->revision & 0x0F) == 0x0) argument 67 #define is_rev_A1(ptp) (((ptp)->pdev->revision & 0x0F) == 0x1) argument 69 /* PTP atomic update operation type */ 76 static struct ptp *first_ptp_block; 79 static bool is_ptp_dev_cnf10ka(struct ptp *ptp) in is_ptp_dev_cnf10ka() argument 81 return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_A_PTP; in is_ptp_dev_cnf10ka() 84 static bool is_ptp_dev_cn10ka(struct ptp *ptp) in is_ptp_dev_cn10ka() argument [all …]
|
| /kernel/linux/linux-6.6/drivers/ptp/ |
| D | ptp_clock.c | 3 * PTP 1588 clock support 79 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_settime() local 81 if (ptp_clock_freerun(ptp)) { in ptp_clock_settime() 82 pr_err("ptp: physical clock is free running\n"); in ptp_clock_settime() 86 return ptp->info->settime64(ptp->info, tp); in ptp_clock_settime() 91 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_gettime() local 94 if (ptp->info->gettimex64) in ptp_clock_gettime() 95 err = ptp->info->gettimex64(ptp->info, tp, NULL); in ptp_clock_gettime() 97 err = ptp->info->gettime64(ptp->info, tp); in ptp_clock_gettime() 103 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_adjtime() local [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 28 ptp->info->getmaxphase(ptp->info)); in max_phase_adjustment_show() 36 struct ptp_clock *ptp = dev_get_drvdata(dev); \ 37 return snprintf(page, PAGE_SIZE-1, "%d\n", ptp->info->var); \ 52 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_enable_store() local 53 struct ptp_clock_info *ops = ptp->info; in extts_enable_store() 77 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 …]
|
| /kernel/linux/linux-5.10/drivers/ptp/ |
| D | ptp_clock.c | 3 * PTP 1588 clock support 99 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_settime() local 101 return ptp->info->settime64(ptp->info, tp); in ptp_clock_settime() 106 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_gettime() local 109 if (ptp->info->gettimex64) in ptp_clock_gettime() 110 err = ptp->info->gettimex64(ptp->info, tp, NULL); in ptp_clock_gettime() 112 err = ptp->info->gettime64(ptp->info, tp); in ptp_clock_gettime() 118 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_adjtime() local 122 ops = ptp->info; in ptp_clock_adjtime() 149 ptp->dialed_frequency = tx->freq; in ptp_clock_adjtime() [all …]
|
| D | ptp_sysfs.c | 3 * PTP 1588 clock support - sysfs interface. 15 struct ptp_clock *ptp = dev_get_drvdata(dev); in clock_name_show() local 16 return sysfs_emit(page, "%s\n", ptp->info->name); in clock_name_show() 24 struct ptp_clock *ptp = dev_get_drvdata(dev); \ 25 return snprintf(page, PAGE_SIZE-1, "%d\n", ptp->info->var); \ 40 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_enable_store() local 41 struct ptp_clock_info *ops = ptp->info; in extts_enable_store() 65 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_fifo_show() local 66 struct timestamp_event_queue *queue = &ptp->tsevq; in extts_fifo_show() 74 if (mutex_lock_interruptible(&ptp->tsevq_mux)) in extts_fifo_show() [all …]
|
| D | Kconfig | 3 # PTP clock support configuration 6 menu "PTP clock support" 9 tristate "PTP clock support" 16 standard defines a Precision Time Protocol (PTP), which can 22 This driver adds support for PTP clocks as character 23 devices. If you want to use a PTP clock, then you should 27 will be called ptp. 30 tristate "Broadcom DTE as PTP clock" 37 (DTE) in the Broadcom SoC's as a PTP clock. 40 for PTP purposes. [all …]
|
| /kernel/linux/linux-6.6/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 66 if (BNXT_PTP_USE_RTC(ptp->bp)) in bnxt_ptp_settime() 67 return bnxt_ptp_cfg_settime(ptp->bp, ns); in bnxt_ptp_settime() 69 spin_lock_bh(&ptp->ptp_lock); in bnxt_ptp_settime() 70 timecounter_init(&ptp->tc, &ptp->cc, ns); in bnxt_ptp_settime() 71 spin_unlock_bh(&ptp->ptp_lock); in bnxt_ptp_settime() 79 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; in bnxt_refclk_read() local 85 high_before = readl(bp->bar0 + ptp->refclk_mapped_regs[1]); in bnxt_refclk_read() 87 low = readl(bp->bar0 + ptp->refclk_mapped_regs[0]); in bnxt_refclk_read() 89 high_now = readl(bp->bar0 + ptp->refclk_mapped_regs[1]); in bnxt_refclk_read() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/net/ethernet/microchip/ |
| D | lan743x_ptp.c | 69 struct lan743x_ptp *ptp = &adapter->ptp; in lan743x_ptp_tx_ts_enqueue_ts() local 71 spin_lock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_enqueue_ts() 72 if (ptp->tx_ts_queue_size < LAN743X_PTP_NUMBER_OF_TX_TIMESTAMPS) { in lan743x_ptp_tx_ts_enqueue_ts() 73 ptp->tx_ts_seconds_queue[ptp->tx_ts_queue_size] = seconds; in lan743x_ptp_tx_ts_enqueue_ts() 74 ptp->tx_ts_nseconds_queue[ptp->tx_ts_queue_size] = nano_seconds; in lan743x_ptp_tx_ts_enqueue_ts() 75 ptp->tx_ts_header_queue[ptp->tx_ts_queue_size] = header; in lan743x_ptp_tx_ts_enqueue_ts() 76 ptp->tx_ts_queue_size++; in lan743x_ptp_tx_ts_enqueue_ts() 81 spin_unlock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_enqueue_ts() 86 struct lan743x_ptp *ptp = &adapter->ptp; in lan743x_ptp_tx_ts_complete() local 93 spin_lock_bh(&ptp->tx_ts_lock); in lan743x_ptp_tx_ts_complete() [all …]
|
| /kernel/linux/linux-5.10/drivers/net/ethernet/marvell/octeontx2/af/ |
| D | ptp.c | 2 /* Marvell PTP driver 12 #include "ptp.h" 16 #define DRV_NAME "Marvell PTP Driver" 45 /* To get the input clock frequency with which PTP co-processor in get_clock_rate() 72 struct ptp *ptp_get(void) in ptp_get() 75 struct ptp *ptp; in ptp_get() local 77 /* If the PTP pci device is found on the system and ptp in ptp_get() 78 * driver is bound to it then the PTP pci device is returned in ptp_get() 86 ptp = pci_get_drvdata(pdev); in ptp_get() 87 if (!ptp) in ptp_get() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 */ 77 /* Offsets into PTP packet for identification. These offsets are from the 78 * start of the IP header, not the MAC header. Note that neither PTP V1 nor 79 * PTP V2 permit the use of IPV4 options. 92 /* The minimum length of a PTP V1 packet for offsets, etc. to be valid: [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/net/ethernet/marvell/octeontx2/nic/ |
| D | otx2_ptp.c | 2 /* Marvell OcteonTx2 PTP support for ethernet driver 12 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_adjfine() local 17 if (!ptp->nic) in otx2_ptp_adjfine() 20 req = otx2_mbox_alloc_msg_ptp_op(&ptp->nic->mbox); in otx2_ptp_adjfine() 27 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in otx2_ptp_adjfine() 36 struct otx2_ptp *ptp = container_of(cc, struct otx2_ptp, cycle_counter); in ptp_cc_read() local 41 if (!ptp->nic) in ptp_cc_read() 44 req = otx2_mbox_alloc_msg_ptp_op(&ptp->nic->mbox); in ptp_cc_read() 50 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in ptp_cc_read() 54 rsp = (struct ptp_rsp *)otx2_mbox_get_rsp(&ptp->nic->mbox.mbox, 0, in ptp_cc_read() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-5.10/Documentation/ABI/testing/ |
| D | sysfs-ptp | 1 What: /sys/class/ptp/ 7 features of PTP hardware clocks. 9 What: /sys/class/ptp/ptpN/ 13 This directory contains the attributes of the Nth PTP 14 hardware clock registered into the PTP class driver 17 What: /sys/class/ptp/ptpN/clock_name 21 This file contains the name of the PTP hardware clock 28 What: /sys/class/ptp/ptpN/max_adjustment 32 This file contains the PTP hardware clock's maximum 36 What: /sys/class/ptp/ptpN/n_alarms [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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_adjfreq(struct ptp_clock_info *ptp, s32 ppb) in ravb_ptp_adjfreq() argument 93 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjfreq() 94 ptp.info); in ravb_ptp_adjfreq() 105 addend = priv->ptp.default_addend; in ravb_ptp_adjfreq() 112 priv->ptp.current_addend = addend; in ravb_ptp_adjfreq() 127 static int ravb_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) in ravb_ptp_adjtime() argument 129 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjtime() [all …]
|