/Linux-v5.15/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 …]
|
/Linux-v5.15/drivers/ptp/ |
D | ptp_clock.c | 3 * PTP 1588 clock support 78 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_settime() local 80 if (ptp_vclock_in_use(ptp)) { in ptp_clock_settime() 81 pr_err("ptp: virtual clock in use\n"); in ptp_clock_settime() 85 return ptp->info->settime64(ptp->info, tp); in ptp_clock_settime() 90 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_clock_gettime() local 93 if (ptp->info->gettimex64) in ptp_clock_gettime() 94 err = ptp->info->gettimex64(ptp->info, tp, NULL); in ptp_clock_gettime() 96 err = ptp->info->gettime64(ptp->info, tp); in ptp_clock_gettime() 102 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 snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name); in clock_name_show() 25 struct ptp_clock *ptp = dev_get_drvdata(dev); \ 26 return snprintf(page, PAGE_SIZE-1, "%d\n", ptp->info->var); \ 41 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_enable_store() local 42 struct ptp_clock_info *ops = ptp->info; in extts_enable_store() 66 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_fifo_show() local 67 struct timestamp_event_queue *queue = &ptp->tsevq; in extts_fifo_show() 75 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" 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 16 static int ptp_vclock_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_vclock_adjfine() argument 18 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_adjfine() 33 static int ptp_vclock_adjtime(struct ptp_clock_info *ptp, s64 delta) in ptp_vclock_adjtime() argument 35 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_adjtime() 45 static int ptp_vclock_gettime(struct ptp_clock_info *ptp, in ptp_vclock_gettime() argument 48 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_gettime() 60 static int ptp_vclock_settime(struct ptp_clock_info *ptp, in ptp_vclock_settime() argument 63 struct ptp_vclock *vclock = info_to_vclock(ptp); in ptp_vclock_settime() 74 static long ptp_vclock_refresh(struct ptp_clock_info *ptp) in ptp_vclock_refresh() argument [all …]
|
D | ptp_chardev.c | 3 * PTP 1588 clock support - character device implementation. 48 int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, in ptp_set_pinfunc() argument 51 struct ptp_clock_info *info = ptp->info; in ptp_set_pinfunc() 111 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_ioctl() local 115 struct ptp_clock_info *ops = ptp->info; in ptp_ioctl() 132 caps.max_adj = ptp->info->max_adj; in ptp_ioctl() 133 caps.n_alarm = ptp->info->n_alarm; in ptp_ioctl() 134 caps.n_ext_ts = ptp->info->n_ext_ts; in ptp_ioctl() 135 caps.n_per_out = ptp->info->n_per_out; in ptp_ioctl() 136 caps.pps = ptp->info->pps; in ptp_ioctl() [all …]
|
/Linux-v5.15/drivers/net/ethernet/broadcom/bnxt/ |
D | bnxt_ptp.c | 49 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg, in bnxt_ptp_settime() local 53 spin_lock_bh(&ptp->ptp_lock); in bnxt_ptp_settime() 54 timecounter_init(&ptp->tc, &ptp->cc, ns); in bnxt_ptp_settime() 55 spin_unlock_bh(&ptp->ptp_lock); in bnxt_ptp_settime() 63 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; in bnxt_refclk_read() local 69 *ns = readl(bp->bar0 + ptp->refclk_mapped_regs[0]); in bnxt_refclk_read() 71 *ns |= (u64)readl(bp->bar0 + ptp->refclk_mapped_regs[1]) << 32; in bnxt_refclk_read() 77 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; in bnxt_ptp_get_current_time() local 79 if (!ptp) in bnxt_ptp_get_current_time() 81 spin_lock_bh(&ptp->ptp_lock); in bnxt_ptp_get_current_time() [all …]
|
/Linux-v5.15/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_adjfreq(struct ptp_clock_info *ptp, s32 ppb) in hclge_ptp_adjfreq() argument 27 struct hclge_dev *hdev = hclge_ptp_get_hdev(ptp); in hclge_ptp_adjfreq() 28 struct hclge_ptp_cycle *cycle = &hdev->ptp->cycle; in hclge_ptp_adjfreq() 50 * denominator is fixed to ptp->cycle.den, and numerator in hclge_ptp_adjfreq() [all …]
|
/Linux-v5.15/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 …]
|
/Linux-v5.15/drivers/net/ethernet/marvell/octeontx2/af/ |
D | ptp.c | 2 /* Marvell PTP driver 13 #include "ptp.h" 17 #define DRV_NAME "Marvell PTP Driver" 42 static struct ptp *first_ptp_block; 51 /* To get the input clock frequency with which PTP co-processor in get_clock_rate() 78 struct ptp *ptp_get(void) in ptp_get() 80 struct ptp *ptp = first_ptp_block; in ptp_get() local 82 /* Check PTP block is present in hardware */ in ptp_get() 85 /* Check driver is bound to PTP block */ in ptp_get() 86 if (!ptp) in ptp_get() [all …]
|
/Linux-v5.15/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 */ 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-v5.15/drivers/net/ethernet/marvell/octeontx2/nic/ |
D | otx2_ptp.c | 13 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 return otx2_sync_mbox_msg(&ptp->nic->mbox); in otx2_ptp_adjfine() 32 struct otx2_ptp *ptp = container_of(cc, struct otx2_ptp, cycle_counter); in ptp_cc_read() local 37 if (!ptp->nic) in ptp_cc_read() 40 req = otx2_mbox_alloc_msg_ptp_op(&ptp->nic->mbox); in ptp_cc_read() 46 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in ptp_cc_read() 50 rsp = (struct ptp_rsp *)otx2_mbox_get_rsp(&ptp->nic->mbox.mbox, 0, in ptp_cc_read() 60 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_adjtime() local [all …]
|
/Linux-v5.15/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/max_vclocks [all …]
|
/Linux-v5.15/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-v5.15/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 …]
|
/Linux-v5.15/include/linux/ |
D | ptp_clock_kernel.h | 3 * PTP 1588 clock support 19 * struct ptp_clock_request - request PTP clock event 55 * struct ptp_clock_info - describes a PTP hardware clock 115 * @verify: Confirm that a pin can perform a given function. The PTP 148 int (*adjfine)(struct ptp_clock_info *ptp, long scaled_ppm); 149 int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta); 150 int (*adjphase)(struct ptp_clock_info *ptp, s32 phase); 151 int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); 152 int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts); 153 int (*gettimex64)(struct ptp_clock_info *ptp, struct timespec64 *ts, [all …]
|
/Linux-v5.15/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-v5.15/drivers/net/ethernet/intel/ice/ |
D | ice_ptp.c | 67 * This function will configure timestamping during PTP initialization 76 pf->ptp.tstamp_config.rx_filter = HWTSTAMP_FILTER_ALL; in ice_ptp_cfg_timestamp() 77 pf->ptp.tstamp_config.tx_type = HWTSTAMP_TX_ON; in ice_ptp_cfg_timestamp() 79 pf->ptp.tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE; in ice_ptp_cfg_timestamp() 80 pf->ptp.tstamp_config.tx_type = HWTSTAMP_TX_OFF; in ice_ptp_cfg_timestamp() 85 * ice_get_ptp_clock_index - Get the PTP clock index 88 * Determine the clock index of the PTP clock associated with this device. If 95 * Returns: the index of the PTP clock associated with this device, or -1 if 108 if (pf->ptp.clock) in ice_get_ptp_clock_index() 109 return ptp_clock_index(pf->ptp.clock); in ice_get_ptp_clock_index() [all …]
|
/Linux-v5.15/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 25 static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) in e1000e_phc_adjfreq() argument 27 struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, in e1000e_phc_adjfreq() 36 if ((delta > ptp->max_adj) || (delta <= -1000000000)) in e1000e_phc_adjfreq() 73 * @ptp: ptp clock structure 78 static int e1000e_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) in e1000e_phc_adjtime() argument 80 struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, in e1000e_phc_adjtime() 146 * @ptp: ptp clock structure [all …]
|
/Linux-v5.15/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 …]
|
D | ptp.h | 3 * Marvell 88E6xxx Switch PTP support 66 /* Offset 0x0E/0x0F: PTP Global Time */ 112 /* Offset 0x01/0x02: PTP Arrival 0 Time */ 116 /* Offset 0x03: PTP Arrival 0 Sequence ID */ 119 /* Offset 0x04: PTP Arrival 1 Status */ 122 /* Offset 0x05/0x6E: PTP Arrival 1 Time */ 126 /* Offset 0x07: PTP Arrival 1 Sequence ID */ 129 /* Offset 0x08: PTP Departure Status */ 132 /* Offset 0x09/0x0a: PTP Deperture Time */ 136 /* Offset 0x0b: PTP Departure Sequence ID */ [all …]
|
/Linux-v5.15/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-v5.15/drivers/net/ethernet/stmicro/stmmac/ |
D | stmmac_ptp.c | 3 PTP 1588 clock using the STMMAC. 17 * @ptp: pointer to ptp_clock_info structure 22 static int stmmac_adjust_freq(struct ptp_clock_info *ptp, s32 ppb) in stmmac_adjust_freq() argument 25 container_of(ptp, struct stmmac_priv, ptp_clock_ops); in stmmac_adjust_freq() 52 * @ptp: pointer to ptp_clock_info structure 57 static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta) in stmmac_adjust_time() argument 60 container_of(ptp, struct stmmac_priv, ptp_clock_ops); in stmmac_adjust_time() 79 /* If EST is enabled, disabled it before adjust ptp time. */ in stmmac_adjust_time() 93 /* Caculate new basetime and re-configured EST after PTP time adjust. */ in stmmac_adjust_time() 127 * @ptp: pointer to ptp_clock_info structure [all …]
|
/Linux-v5.15/drivers/net/ethernet/mellanox/mlx4/ |
D | en_clock.c | 78 * mlx4_en_remove_timestamp - disable PTP device 81 * Stop the PTP support. 115 * @ptp: ptp clock structure 121 static int mlx4_en_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) in mlx4_en_phc_adjfreq() argument 127 struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, in mlx4_en_phc_adjfreq() 149 * @ptp: ptp clock structure 154 static int mlx4_en_phc_adjtime(struct ptp_clock_info *ptp, s64 delta) in mlx4_en_phc_adjtime() argument 156 struct mlx4_en_dev *mdev = container_of(ptp, struct mlx4_en_dev, in mlx4_en_phc_adjtime() 169 * @ptp: ptp clock structure 175 static int mlx4_en_phc_gettime(struct ptp_clock_info *ptp, in mlx4_en_phc_gettime() argument [all …]
|
/Linux-v5.15/Documentation/devicetree/bindings/pinctrl/ |
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 …]
|