~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/soc/mscc/ocelot_ptp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
  2 /*
  3  * Microsemi Ocelot Switch driver
  4  *
  5  * License: Dual MIT/GPL
  6  * Copyright (c) 2017 Microsemi Corporation
  7  * Copyright 2020 NXP
  8  */
  9 
 10 #ifndef _MSCC_OCELOT_PTP_H_
 11 #define _MSCC_OCELOT_PTP_H_
 12 
 13 #include <linux/ptp_clock_kernel.h>
 14 #include <soc/mscc/ocelot.h>
 15 
 16 #define OCELOT_MAX_PTP_ID               63
 17 #define OCELOT_PTP_FIFO_SIZE            128
 18 
 19 #define PTP_PIN_CFG_RSZ                 0x20
 20 #define PTP_PIN_TOD_SEC_MSB_RSZ         PTP_PIN_CFG_RSZ
 21 #define PTP_PIN_TOD_SEC_LSB_RSZ         PTP_PIN_CFG_RSZ
 22 #define PTP_PIN_TOD_NSEC_RSZ            PTP_PIN_CFG_RSZ
 23 #define PTP_PIN_WF_HIGH_PERIOD_RSZ      PTP_PIN_CFG_RSZ
 24 #define PTP_PIN_WF_LOW_PERIOD_RSZ       PTP_PIN_CFG_RSZ
 25 
 26 #define PTP_PIN_CFG_DOM                 BIT(0)
 27 #define PTP_PIN_CFG_SYNC                BIT(2)
 28 #define PTP_PIN_CFG_ACTION(x)           ((x) << 3)
 29 #define PTP_PIN_CFG_ACTION_MASK         PTP_PIN_CFG_ACTION(0x7)
 30 
 31 enum {
 32         PTP_PIN_ACTION_IDLE = 0,
 33         PTP_PIN_ACTION_LOAD,
 34         PTP_PIN_ACTION_SAVE,
 35         PTP_PIN_ACTION_CLOCK,
 36         PTP_PIN_ACTION_DELTA,
 37         PTP_PIN_ACTION_NOSYNC,
 38         PTP_PIN_ACTION_SYNC,
 39 };
 40 
 41 #define PTP_CFG_MISC_PTP_EN             BIT(2)
 42 
 43 #define PTP_CFG_CLK_ADJ_CFG_ENA         BIT(0)
 44 #define PTP_CFG_CLK_ADJ_CFG_DIR         BIT(1)
 45 
 46 #define PTP_CFG_CLK_ADJ_FREQ_NS         BIT(30)
 47 
 48 int ocelot_ptp_gettime64(struct ptp_clock_info *ptp, struct timespec64 *ts);
 49 int ocelot_ptp_settime64(struct ptp_clock_info *ptp,
 50                          const struct timespec64 *ts);
 51 int ocelot_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta);
 52 int ocelot_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm);
 53 int ocelot_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
 54                       enum ptp_pin_function func, unsigned int chan);
 55 int ocelot_ptp_enable(struct ptp_clock_info *ptp,
 56                       struct ptp_clock_request *rq, int on);
 57 int ocelot_init_timestamp(struct ocelot *ocelot,
 58                           const struct ptp_clock_info *info);
 59 int ocelot_deinit_timestamp(struct ocelot *ocelot);
 60 #endif
 61 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php