AM64x MCU+ SDK  08.03.00
icss_timeSyncApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ICSS_TIMESYNC_API_H_
34 #define ICSS_TIMESYNC_API_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /* ========================================================================== */
42 /* Include Files */
43 /* ========================================================================== */
44 
46 #include <kernel/dpl/HwiP.h>
47 #include <kernel/dpl/TimerP.h>
48 #include <kernel/dpl/TaskP.h>
49 #include <kernel/dpl/EventP.h>
50 
51 #define lswap(x) ((((x) & 0xff000000) >> 24) | \
52  (((x) & 0x00ff0000) >> 8) | \
53  (((x) & 0x0000ff00) << 8) | \
54  (((x) & 0x000000ff) << 24))
55 
56 #define htonl_ts(l) (lswap(l))
57 #define ntohl_ts(l) (lswap(l))
58 
59 #define htons_ts(s) ((u_short)((u_short)(s) >> 8) | (u_short)((u_short)(s) << 8))
60 #define ntohs_ts(s) htons_ts(s)
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
65 /*TODO: Review this*/
66 #define TASK_STACK_SIZE (2048)
67 
68 #define ICSS_TIMESYNC_EVENT_BIT0 (0x000001)
69 #define ICSS_TIMESYNC_EVENT_BIT1 (0x000002)
70 #define ICSS_TIMESYNC_EVENT_BIT2 (0x000004)
71 #define ICSS_TIMESYNC_EVENT_BIT3 (0x000008)
72 #define ICSS_TIMESYNC_EVENT_BIT4 (0x000010)
73 #define ICSS_TIMESYNC_EVENT_BIT5 (0x000020)
74 #define ICSS_TIMESYNC_EVENT_BIT6 (0x000040)
75 #define ICSS_TIMESYNC_EVENT_BIT7 (0x000080)
76 
77 /* Data types */
78 /* Primitive data types */
79 
85 #define SYNT_DEPTH 3
86 
90 #define TS_NUM_DOMAINS 1
91 
92 /*Below are the masks used for PTP state machine*/
93 
98 #define TS_STATE_MACHINE_FIRST_ADJUSTMENT_DONE 1
99 
104 #define TS_STATE_MACHINE_LINE_DELAY_COMPUTED 2
105 
109 #define TS_STATE_MACHINE_SYNC_INTERVAL_COMPUTED 4
110 
115 #define TS_STATE_MACHINE_READY_FOR_SYNC 7
116 
122 #define TS_STATE_MACHINE_DEVICE_IN_SYNC 8
123 
129 #define OFFSET_ALGO_BIN_SIZE 5
130 
136 #define OFFSET_ALGO_CLUSTER_SIZE 3
137 
141 typedef enum
142 {
144  FAULTY = 2,
145  DISABLED = 3,
148  MASTER = 6,
149  PASSIVE = 7,
151  SLAVE = 9
152 
154 
158 typedef enum
159 {
160 
162  UDP_IPV4 = 1,
164  UDP_IPV6 = 2,
169  PROFINET = 6,
170  UNKNOWN = 0xFFFE
171 
173 
177 typedef enum
178 {
179 
181  TC = 1,
183  OC = 2,
185  BOTH = 3
187 
191 typedef enum
192 {
194  E2E = 1,
196  P2P = 2
198 
202 typedef enum
203 {
211  DELAY_RESP_FRAME = 3
212 
214 
218 typedef enum
219 {
220  ATOMIC_CLOCK = 0x10,
221  GPS = 0x20,
223  PTP = 0x40,
224  NTP = 0x50,
225  HAND_SET = 0x60,
226  OTHER = 0x90,
228 } timeSource;
229 
233 typedef struct
234 {
235  uint64_t seconds;
236  uint32_t nanoseconds;
237 } timeStamp;
238 
239 
243 typedef struct
244 {
245  uint64_t seconds;
248 
253 typedef void (*TimeSync_SyncLossCallBack_t)(void);
254 
259 typedef void (*TimeSync_stackResetCallback_t)(void *arg);
260 
264 typedef struct
265 {
267  uint8_t clockIdentity[8];
269  uint16_t ptpPortNumber;
277 
281 typedef struct
282 {
284  uint8_t priority1;
286  uint8_t priority2;
288  uint8_t clockClass;
290  uint8_t clockAccuracy;
292  uint8_t timeSource;
294  uint16_t stepRemoved;
296  uint16_t clockVariance;
297  /*Current UTC offset*/
298  uint16_t UTCOffset;
300  uint8_t gmIdentity[8];
301 
302  /*PTP Flag params. See standard
303  * index 0 - PTP Leap second 61
304  * index 1 - PTP Leap second 59
305  * ....
306  * ....
307  * index 11 - PTP Security*/
308 
309  uint8_t ptp_flags[12];
310 
312 
316 typedef struct
317 {
318  /*Rx buffers*/
319  uint8_t *pdelayReq_RxBuf[2];
320  uint8_t *pdelayRes_RxBuf[2];
321  uint8_t *pdelayResFlwUp_RxBuf[2];
322  /*For E2E master. Not supported right now*/
323  uint8_t *delayReq_RxBuf[2];
324 
325  /*Tx buffers*/
326  uint8_t *pdelayReq_TxBuf[2];
327  uint8_t *pdelayRes_TxBuf[2];
328  uint8_t *pdelayResFlwUp_TxBuf[2];
329  uint8_t *sync_TxBuf;
330  uint8_t *announce_TxBuf;
331  uint8_t *followUp_TxBuf[2];
332  uint8_t *delayReq_TxBuf;
333 
334  /*Buffer sizes. These change based on whether
335  * it's Annex E or Annex F. Pdelay buffer size and
336  * delay request (E2E) buffer sizes are fixed
337  * because we only support fixed modes*/
338  uint8_t syncBuf_size;
339  uint8_t flwUpBuf_size;
341 
343 
347 typedef struct
348 {
350  uint8_t domainNumber[TS_NUM_DOMAINS];
355  /*Synchronization loss callback function*/
357  /*PTP stack reset callback function*/
361 
364 
367 
370 
374 
378 
382 
386 
389 
392 
395 
397  uint32_t txIntNum;
398 
400  uint16_t asymmetryCorrection[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
401 
405 
408 
410  uint8_t clockIdentity[8];
411 
415  uint32_t sync0_interval;
416 
418  uint8_t hsrEnabled;
419 
427  uint8_t ll_has_hsrTag;
428 
431  uint8_t custom_tx_api;
432 
438 
442  uint8_t emac_mode;
443 
448  uint8_t frame_offset;
449 
450  /*OS tick period (in microseconds). Normalized value is 1000 means factor of 1, 500 means
451  * OS counts twice as fast so divide time period by 2*/
452  uint32_t tickPeriod;
453 
454  /* Rx PHY Latency in nano seconds */
455  uint32_t rxPhyLatency;
456 
457  /* Tx PHY Latency in nano seconds */
458  uint32_t txPhyLatency;
459 
462 
464 
468 typedef struct
469 {
471  uint8_t enabled;
472 
483  uint8_t stateMachine;
484 
486  uint16_t pDelReqSequenceID[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
487 
490 
492  uint16_t syncSequenceID;
493 
496 
498  uint16_t curSyncSeqId[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
499 
503  uint32_t ltaSyncInterval;
506 
508  int32_t currOffset;
513  int32_t prevOffset[2];
514 
515  /*Flags to determine if values in prevOffset[] are valid*/
516  int32_t prevOffsetValid[2];
517 
519  int32_t initialOffset;
520 
521  /*Once drift stabilizes, this is set to 1*/
522  uint8_t driftStable;
523 
524  /*Once offset becomes zero, this is set to 1*/
525  uint8_t offsetStable;
526 
528  uint8_t syncPortNum;
529 
531  uint32_t pathDelay[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
532 
533  /*Place holder to calculate line delay.
534  * Since line delay can sometimes be negative, we need a persistent variable*/
535  int64_t meanPathDelay;
536 
538  uint32_t clockDrift;
539 
540  /*long term average of offset. Compare with initial offset to find drift*/
541  int32_t ltaOffset;
542 
543  /*Flags to determine if ltaOffset value is valid*/
544  int32_t ltaOffsetValid;
545 
548 
551  uint64_t tickCounter;
552 
555 
559 
561  uint8_t forced2step[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
562 
563  /*debug*/
564  uint8_t bmcaDone;
565 
568 
571 
573 
578 typedef struct
579 {
586 
590  uint8_t driftThreshold;
591 
594 
598  uint8_t binFull;
599 
603  int32_t correction[OFFSET_ALGO_BIN_SIZE];
604 
606 
610 typedef struct
611 {
613  uint8_t ifTwoStep;
614 
617  uint64_t correctionField;
618 
620  uint64_t originTsSec;
622  uint32_t originTsNs;
623 
625  uint32_t rxTs;
626 
628  uint64_t rxTsSec;
629 
631  uint32_t txTs;
632 
634  uint64_t txTsSec;
635 
636 } syncParam_t;
637 
641 typedef struct
642 {
644  uint64_t syncIngressTs[SYNT_DEPTH];
645 
647  uint64_t correctedMasterTs[SYNT_DEPTH];
648 
650  double rcf;
651 
653  uint8_t index;
654 
656  uint8_t syntEnable;
657 
659  uint32_t syntIndex;
660 
662 
666 typedef struct
667 {
669  uint64_t deviceRxTS[SYNT_DEPTH];
670 
672  uint64_t correctedPeerTS[SYNT_DEPTH];
673 
675  double nrr;
676 
678  uint8_t curIndex;
679 
681  uint8_t nrrEnable;
682 
684  uint32_t nrrIndex;
685 
687 
688 
692 typedef struct
693 {
695  uint64_t correctionField;
696 
698  uint64_t timeStampSec;
700  uint32_t timeStampNS;
701 
703  uint32_t delReqTxTsSec;
705  uint32_t delReqTxTsNS;
706 
708 
712 typedef struct
713 {
715  uint8_t ifTwoStep;
716 
718  uint32_t T1Sec;
719 
721  uint32_t T1Nsec;
722 
724  uint64_t T2Sec;
725 
727  uint32_t T2Nsec;
728 
730  uint64_t T3Sec;
731 
733  uint32_t T3Nsec;
734 
736  uint64_t T4Sec;
737 
739  uint32_t T4Nsec;
740 
744 
748 
751 
754 
756 
760 typedef struct
761 {
762 
764  uint32_t srcIP;
765 
767  uint32_t dstIP;
768 
770  uint8_t dscp;
771 
773  uint8_t ttlVal;
774 
775 } ipParams_t;
776 
780 typedef struct
781 {
785  uint8_t ptpGeneralFrame[ICSS_EMAC_MAXMTU];
787  uint16_t ptpGeneralSize;
791  uint8_t ptpSrcMacID[6];
792 
793 } ptpDparams_t;
794 
798 typedef struct TimeSync_ParamsHandle_s
799 {
802 
803  uint8_t macId[6];
804  /* MAC ID passed to ICSS-EMAC during ICSS-EMAC initialization*/
805 
808 
810  uint8_t enabled;
811 
812  /*Get TX timestamp*/
815  uint8_t txPort;
816  uint8_t txprotocol;
819  /*Get RX timestamp*/
822  uint8_t rxPort;
823  uint8_t rxprotocol;
827  /*Set clock*/
829  uint8_t sequenceIdIn;
831  /*Adjust clock*/
832  int32_t drift;
833  uint32_t syncInterval;
837 
839  uint32_t pathDelay[ICSS_EMAC_MAX_PORTS_PER_INSTANCE];
840 
841  uint8_t syntIndexMap[3];
842  uint8_t prevIndexMap[3];
843 
844 
847 
850 
851  /*-----------------Slave tasks, semaphores and events----------------*/
852 
857 
864 
870 
876 
890 
892  uint32_t eventIdSync;
900  uint32_t eventIdDelayReq;
903 
904  /*Semaphore for sending Delay Request frames*/
906 
908 
909  /*Number of sync frames missed*/
910  uint32_t numSyncMissed;
911 
913 
916 
919 
922 
923  /*Time sync configuration handle*/
925 
926  /*Rx and Tx frame buffers*/
928 
931 
934 
937 
940 
941  uint32_t pDelayReqSendTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
942  uint32_t delayReqSendTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
943  uint32_t txTSTaskP1Stack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
944  uint32_t txTSTaskP2Stack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
945  uint32_t NRT_TaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
946  uint32_t backgroundTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)));
947 
949 
950 typedef struct TimeSync_ParamsHandle_s *TimeSync_ParamsHandle_t;
951 
952 /* ========================================================================== */
953 /* Error Codes */
954 /* ========================================================================== */
955 #define TIMESYNC_OK (0)
956 #define ERROR_TX_FRAMETYPE_NOTVALID (-1)
957 #define ERROR_TX_PORTNUMBER_NOTVALID (-2)
958 #define ERROR_HANDLE_INVALID (-3)
959 #define ERROR_RX_FRAMETYPE_NOTVALID (-4)
960 #define ERROR_RX_PORTNUMBER_NOTVALID (-5)
961 
962 /* ========================================================================== */
963 /* Function Declarations */
964 /* ========================================================================== */
965 
985  ptpFrameTypes_t rxFrameType, uint8_t rxPort, \
986  uint32_t *nanoseconds, uint64_t *seconds);
987 /* API */
988 
1006 
1020 int32_t TimeSync_getTxTimestamp(TimeSync_ParamsHandle_t timeSyncParamsHandle, \
1021  ptpFrameTypes_t txFrameType, uint8_t txPort, \
1022  uint32_t *nanoseconds, uint64_t *seconds);
1023 
1024 
1042  int32_t adjOffset);
1043 
1044 
1055 int32_t TimeSync_setClockTime(TimeSync_ParamsHandle_t timeSyncParamsHandle);
1056 
1073  uint32_t *nanoseconds, uint64_t *seconds);
1074 
1080 
1086 
1093  uint8_t dscpValue);
1094 
1097 #ifdef __cplusplus
1098 }
1099 #endif
1100 
1101 #endif /* ICSS_TIMESYNC_API_H_ */
timeSync_RuntimeVar_t::currOffset
int32_t currOffset
Definition: icss_timeSyncApi.h:508
TimeSync_ParamsHandle::tsSyntInfo
timeSync_SyntInfo_t * tsSyntInfo
Definition: icss_timeSyncApi.h:930
TimeSync_ParamsHandle::txFrameType
ptpFrameTypes_t txFrameType
Definition: icss_timeSyncApi.h:814
E2E
@ E2E
Definition: icss_timeSyncApi.h:194
TC
@ TC
Definition: icss_timeSyncApi.h:181
TimeSync_ParamsHandle::eventIdPdelayReq
uint32_t eventIdPdelayReq
Definition: icss_timeSyncApi.h:894
DISABLED
@ DISABLED
Definition: icss_timeSyncApi.h:145
TimeSync_ParamsHandle::__attribute__
uint32_t backgroundTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
TimeSync_frame_buffers_t
Time synchronization configuration structure.
Definition: icss_timeSyncApi.h:317
TimeSync_Config_t::txPhyLatency
uint32_t txPhyLatency
Definition: icss_timeSyncApi.h:458
TimeSync_updateLogMessageIntervalInPTPFrames
void TimeSync_updateLogMessageIntervalInPTPFrames(TimeSync_ParamsHandle_t timeSyncHandle)
Update log message interval in PTP TX buffers.
TimeSync_config
int32_t TimeSync_config(TimeSync_ParamsHandle_t timeSyncHandle)
Function to configure domain number and/or log message intervals and/or sync0 signal start time,...
ptpDparams_t
PTPd stack parameters.
Definition: icss_timeSyncApi.h:781
TimeSync_Config_t::tickPeriod
uint32_t tickPeriod
Definition: icss_timeSyncApi.h:452
TimeSync_ParamsHandle::timeSync_pDelayReqSendTask
TaskP_Object timeSync_pDelayReqSendTask
Definition: icss_timeSyncApi.h:846
INTERNAL_OSCILLATOR
@ INTERNAL_OSCILLATOR
Definition: icss_timeSyncApi.h:227
ICSS_EMAC_Handle
struct ICSS_EMAC_Config_s * ICSS_EMAC_Handle
Alias for ICSS EMAC Handle containing base addresses and modules.
Definition: icss_emac.h:368
timeSync_SyntInfo_t::rcf
double rcf
Definition: icss_timeSyncApi.h:650
timeSync_SyntInfo_t
Parameters required for clock syntonization.
Definition: icss_timeSyncApi.h:642
TimeSync_ParamsHandle::eventIdPdelayResp
uint32_t eventIdPdelayResp
Definition: icss_timeSyncApi.h:896
ExtendedTimestamp
802.1AS-rev ExtendedTimestamp
Definition: icss_timeSyncApi.h:244
TimeSync_ParamsHandle::sequenceIdIn
uint8_t sequenceIdIn
Definition: icss_timeSyncApi.h:829
timeStamp
802.1AS-rev Timestamp structure
Definition: icss_timeSyncApi.h:234
netWorkProtType
netWorkProtType
Network Protocol Type.
Definition: icss_timeSyncApi.h:159
TimeSync_Config_t::config
deviceConfig config
Definition: icss_timeSyncApi.h:388
TimeSync_getCurrentTime
void TimeSync_getCurrentTime(TimeSync_ParamsHandle_t timeSyncParamsHandle, uint32_t *nanoseconds, uint64_t *seconds)
Returns the current time on device.
TimeSync_ParamsHandle::sequenceIdOut_txTS
uint8_t sequenceIdOut_txTS
Definition: icss_timeSyncApi.h:817
timeSync_RuntimeVar_t::initialOffset
int32_t initialOffset
Definition: icss_timeSyncApi.h:519
PASSIVE
@ PASSIVE
Definition: icss_timeSyncApi.h:149
timeSync_RuntimeVar_t::delReqSequenceID
uint16_t delReqSequenceID
Definition: icss_timeSyncApi.h:489
TimeSync_Config_t::type
delayType type
Definition: icss_timeSyncApi.h:394
OTHER
@ OTHER
Definition: icss_timeSyncApi.h:226
timeSync_NrrInfo_t::nrr
double nrr
Definition: icss_timeSyncApi.h:675
timeSource
timeSource
802.1AS-rev Enumeration8
Definition: icss_timeSyncApi.h:219
port_State
port_State
Port States, from IEEE 1588v2.
Definition: icss_timeSyncApi.h:142
syncParam_t::originTsSec
uint64_t originTsSec
Definition: icss_timeSyncApi.h:620
TimeSync_ParamsHandle::__attribute__
uint32_t pDelayReqSendTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
TimeSync_parent_params_t
Parent clock params.
Definition: icss_timeSyncApi.h:265
TimeSync_ParamsHandle::numSyncMissed
uint32_t numSyncMissed
Definition: icss_timeSyncApi.h:910
TimeSync_Config_t::hsrEnabled
uint8_t hsrEnabled
Definition: icss_timeSyncApi.h:418
TimeSync_frame_buffers_t::delayReq_TxBuf
uint8_t * delayReq_TxBuf
Definition: icss_timeSyncApi.h:332
TimeSync_ParamsHandle::eventIdDelayReq
uint32_t eventIdDelayReq
Definition: icss_timeSyncApi.h:900
peerDelayParams_t::T3Sec
uint64_t T3Sec
Definition: icss_timeSyncApi.h:730
TimeSync_ParamsHandle::eventIdFlwUpGenerated
uint32_t eventIdFlwUpGenerated
Definition: icss_timeSyncApi.h:902
NTP
@ NTP
Definition: icss_timeSyncApi.h:224
delayReqRespParams_t::delReqTxTsNS
uint32_t delReqTxTsNS
Definition: icss_timeSyncApi.h:705
timeSync_RuntimeVar_t::announceSequenceID
uint16_t announceSequenceID
Definition: icss_timeSyncApi.h:495
TimeSync_ParamsHandle::timeSyncConfig
TimeSync_Config_t timeSyncConfig
Definition: icss_timeSyncApi.h:924
TimeSync_master_params_t::stepRemoved
uint16_t stepRemoved
Definition: icss_timeSyncApi.h:294
TimeSync_ParamsHandle::txPort
uint8_t txPort
Definition: icss_timeSyncApi.h:815
delayReqRespParams_t
Parameters required for calculating Cable Delay.
Definition: icss_timeSyncApi.h:693
PRE_MASTER
@ PRE_MASTER
Definition: icss_timeSyncApi.h:147
UDP_IPV4
@ UDP_IPV4
Definition: icss_timeSyncApi.h:162
TimeSync_Config_t::logSyncInterval
int8_t logSyncInterval
Definition: icss_timeSyncApi.h:363
timeSync_RuntimeVar_t::currSyncInterval
uint32_t currSyncInterval
Definition: icss_timeSyncApi.h:501
ExtendedTimestamp::fractionalNanoseconds
uint64_t fractionalNanoseconds
Definition: icss_timeSyncApi.h:246
peerDelayParams_t::delayResFwUpCorrField
uint64_t delayResFwUpCorrField
Definition: icss_timeSyncApi.h:753
TimeSync_ParamsHandle::__attribute__
uint32_t delayReqSendTaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
timeSync_RuntimeVar_t::firstSyncInterval
uint32_t firstSyncInterval
Definition: icss_timeSyncApi.h:505
TimeSync_ParamsHandle::udpParams
ipParams_t udpParams
Definition: icss_timeSyncApi.h:915
TimeSync_ParamsHandle::emacHandle
ICSS_EMAC_Handle emacHandle
Definition: icss_timeSyncApi.h:801
TimeSync_Config_t::syncSendInterval
uint32_t syncSendInterval
Definition: icss_timeSyncApi.h:377
peerDelayParams_t::T1Sec
uint32_t T1Sec
Definition: icss_timeSyncApi.h:718
SYNT_DEPTH
#define SYNT_DEPTH
Definition: icss_timeSyncApi.h:85
MASTER
@ MASTER
Definition: icss_timeSyncApi.h:148
timeSync_SyntInfo_t::syntEnable
uint8_t syntEnable
Definition: icss_timeSyncApi.h:656
INITIALIZING
@ INITIALIZING
Definition: icss_timeSyncApi.h:143
TimeSync_getTxTimestamp
int32_t TimeSync_getTxTimestamp(TimeSync_ParamsHandle_t timeSyncParamsHandle, ptpFrameTypes_t txFrameType, uint8_t txPort, uint32_t *nanoseconds, uint64_t *seconds)
Reads and provides timestamp of a transmitted event message.
timeSync_RuntimeVar_t::ltaSyncInterval
uint32_t ltaSyncInterval
Definition: icss_timeSyncApi.h:503
TimeSync_ParamsHandle::eventIdSync
uint32_t eventIdSync
Definition: icss_timeSyncApi.h:892
TimeSync_master_params_t::clockVariance
uint16_t clockVariance
Definition: icss_timeSyncApi.h:296
icss_emac.h
syncParam_t::ifTwoStep
uint8_t ifTwoStep
Definition: icss_timeSyncApi.h:613
DEVICE_NET
@ DEVICE_NET
Definition: icss_timeSyncApi.h:167
timeSync_RuntimeVar_t::offsetStable
uint8_t offsetStable
Definition: icss_timeSyncApi.h:525
delayReqRespParams_t::timeStampSec
uint64_t timeStampSec
Definition: icss_timeSyncApi.h:698
TimeSync_getRxTimestamp
int32_t TimeSync_getRxTimestamp(TimeSync_ParamsHandle_t timeSyncParamsHandle, ptpFrameTypes_t rxFrameType, uint8_t rxPort, uint32_t *nanoseconds, uint64_t *seconds)
Reads and provides timestamp of a received event message.
TimeSync_ParamsHandle::enabled
uint8_t enabled
Definition: icss_timeSyncApi.h:810
TimeSync_Config_t::pdelayBurstInterval
uint32_t pdelayBurstInterval
Definition: icss_timeSyncApi.h:404
TimeSync_Config_t::rxPhyLatency
uint32_t rxPhyLatency
Definition: icss_timeSyncApi.h:455
TaskP_Object
Opaque task object used with the task APIs.
Definition: TaskP.h:92
TimeSync_frame_buffers_t::announceBuf_size
uint8_t announceBuf_size
Definition: icss_timeSyncApi.h:340
TimeSync_ParamsHandle::rxFrameType
ptpFrameTypes_t rxFrameType
Definition: icss_timeSyncApi.h:821
peerDelayParams_t
Parameters required for calculating Cable Delay.
Definition: icss_timeSyncApi.h:713
HAND_SET
@ HAND_SET
Definition: icss_timeSyncApi.h:225
TimeSync_ParamsHandle::offsetAlgo
timeSync_Offset_Stable_Algo_t * offsetAlgo
Definition: icss_timeSyncApi.h:912
NON_SYNC_DELAY_FRAME
@ NON_SYNC_DELAY_FRAME
Definition: icss_timeSyncApi.h:205
timeSync_RuntimeVar_t::clockDrift
uint32_t clockDrift
Definition: icss_timeSyncApi.h:538
peerDelayParams_t::ifTwoStep
uint8_t ifTwoStep
Definition: icss_timeSyncApi.h:715
SLAVE
@ SLAVE
Definition: icss_timeSyncApi.h:151
TimeSync_ParamsHandle::timeSync_NRT_Task
TaskP_Object timeSync_NRT_Task
Definition: icss_timeSyncApi.h:863
ptpDparams_t::generalFrameFlag
uint8_t generalFrameFlag
Definition: icss_timeSyncApi.h:783
timeSync_RuntimeVar_t::tickCounter
uint64_t tickCounter
Definition: icss_timeSyncApi.h:551
UDP_IPV6
@ UDP_IPV6
Definition: icss_timeSyncApi.h:164
TimeSync_Config_t::logAnnounceSendInterval
int8_t logAnnounceSendInterval
Definition: icss_timeSyncApi.h:366
OC
@ OC
Definition: icss_timeSyncApi.h:183
TimeSync_master_params_t::timeSource
uint8_t timeSource
Definition: icss_timeSyncApi.h:292
peerDelayParams_t::T4Nsec
uint32_t T4Nsec
Definition: icss_timeSyncApi.h:739
timeSync_RuntimeVar_t::meanPathDelay
int64_t meanPathDelay
Definition: icss_timeSyncApi.h:535
TASK_STACK_SIZE
#define TASK_STACK_SIZE
Definition: icss_timeSyncApi.h:66
ipParams_t::ttlVal
uint8_t ttlVal
Definition: icss_timeSyncApi.h:773
TimeSync_Config_t::masterParams
TimeSync_master_params_t masterParams
Definition: icss_timeSyncApi.h:461
TimeSync_parent_params_t::observedClockPhaseChangeRate
int32_t observedClockPhaseChangeRate
Definition: icss_timeSyncApi.h:275
timeSync_RuntimeVar_t::syncLastSeenCounter
uint32_t syncLastSeenCounter
Definition: icss_timeSyncApi.h:554
timeSync_RuntimeVar_t::driftStable
uint8_t driftStable
Definition: icss_timeSyncApi.h:522
TimeSync_ParamsHandle::rxTimestamp_gPTP
timeStamp * rxTimestamp_gPTP
Definition: icss_timeSyncApi.h:824
delayReqRespParams_t::correctionField
uint64_t correctionField
Definition: icss_timeSyncApi.h:695
TimeSync_ParamsHandle::timeSync_TxTSTaskP2
TaskP_Object timeSync_TxTSTaskP2
Definition: icss_timeSyncApi.h:856
peerDelayParams_t::T4Sec
uint64_t T4Sec
Definition: icss_timeSyncApi.h:736
TimeSync_ParamsHandle::__attribute__
uint32_t NRT_TaskStack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
ICSS_EMAC_MAXMTU
#define ICSS_EMAC_MAXMTU
Maximum Valid size (incl header + VLAN TAG..., no CRC)
Definition: icss_emac.h:176
timeSync_NrrInfo_t::nrrIndex
uint32_t nrrIndex
Definition: icss_timeSyncApi.h:684
TimeSync_adjTimeSlowComp
int8_t TimeSync_adjTimeSlowComp(TimeSync_ParamsHandle_t timeSyncParamsHandle, int32_t adjOffset)
Adjusts the IEP clock by the drift value over one Sync interval.
EventP_Object
Opaque Event object used with the Event APIs.
Definition: EventP.h:60
peerDelayParams_t::pDelayReqRcvdTSNsec
uint32_t pDelayReqRcvdTSNsec
Definition: icss_timeSyncApi.h:747
TimeSync_Config_t::pDelReqPktInterval
uint32_t pDelReqPktInterval
Definition: icss_timeSyncApi.h:373
TS_NUM_DOMAINS
#define TS_NUM_DOMAINS
Definition: icss_timeSyncApi.h:90
TimeSync_Config_t::sync0_interval
uint32_t sync0_interval
Definition: icss_timeSyncApi.h:415
syncParam_t::originTsNs
uint32_t originTsNs
Definition: icss_timeSyncApi.h:622
TimeSync_updateDomainNumberInPTPFrames
void TimeSync_updateDomainNumberInPTPFrames(TimeSync_ParamsHandle_t timeSyncHandle)
Update PTP domain number in TX Buffers.
TimeSync_Config_t::emac_mode
uint8_t emac_mode
Definition: icss_timeSyncApi.h:442
TimerP.h
GPS
@ GPS
Definition: icss_timeSyncApi.h:221
ipParams_t
Used to populate IP/UDP Parameters. These must be populated from Switch params.
Definition: icss_timeSyncApi.h:761
TimeSync_ParamsHandle::timeSyncBuff
TimeSync_frame_buffers_t timeSyncBuff
Definition: icss_timeSyncApi.h:927
ipParams_t::dscp
uint8_t dscp
Definition: icss_timeSyncApi.h:770
timeSync_RuntimeVar_t::stateMachine
uint8_t stateMachine
PTP State machine used internally by driver This is a bitmap Bit 0 : Set 1 if First adjustment done B...
Definition: icss_timeSyncApi.h:483
UNCALIBRATED
@ UNCALIBRATED
Definition: icss_timeSyncApi.h:150
deviceConfig
deviceConfig
Current Device configuration.
Definition: icss_timeSyncApi.h:178
TimeSync_master_params_t::UTCOffset
uint16_t UTCOffset
Definition: icss_timeSyncApi.h:298
HwiP.h
timeSync_RuntimeVar_t::enabled
uint8_t enabled
Definition: icss_timeSyncApi.h:471
syncParam_t::correctionField
uint64_t correctionField
Definition: icss_timeSyncApi.h:617
TimeSync_Config_t::logPDelReqPktInterval
int8_t logPDelReqPktInterval
Definition: icss_timeSyncApi.h:360
peerDelayParams_t::T2Sec
uint64_t T2Sec
Definition: icss_timeSyncApi.h:724
TimeSync_ParamsHandle::drift
int32_t drift
Definition: icss_timeSyncApi.h:832
delayType
delayType
PTP Delay Mechanism Type. From Table 9 of Standard.
Definition: icss_timeSyncApi.h:192
TimeSync_master_params_t
Master and grand master clock params.
Definition: icss_timeSyncApi.h:282
TimeSync_ParamsHandle::delayReqTxSemObject
SemaphoreP_Object delayReqTxSemObject
Definition: icss_timeSyncApi.h:905
ExtendedTimestamp::seconds
uint64_t seconds
Definition: icss_timeSyncApi.h:245
timeSync_SyntInfo_t::index
uint8_t index
Definition: icss_timeSyncApi.h:653
PTP
@ PTP
Definition: icss_timeSyncApi.h:223
TimeSync_master_params_t::priority2
uint8_t priority2
Definition: icss_timeSyncApi.h:286
ipParams_t::srcIP
uint32_t srcIP
Definition: icss_timeSyncApi.h:764
OFFSET_ALGO_BIN_SIZE
#define OFFSET_ALGO_BIN_SIZE
Definition: icss_timeSyncApi.h:129
peerDelayParams_t::T3Nsec
uint32_t T3Nsec
Definition: icss_timeSyncApi.h:733
TimeSync_ParamsHandle::rxprotocol
uint8_t rxprotocol
Definition: icss_timeSyncApi.h:823
TimeSync_stackResetCallback_t
void(* TimeSync_stackResetCallback_t)(void *arg)
PTP Stack Reset callback function. Timesync handle (of type TimeSync_ParamsHandle_t) will be passed a...
Definition: icss_timeSyncApi.h:259
TimeSync_master_params_t::priority1
uint8_t priority1
Definition: icss_timeSyncApi.h:284
TimeSync_frame_buffers_t::flwUpBuf_size
uint8_t flwUpBuf_size
Definition: icss_timeSyncApi.h:339
TimeSync_Config_t::ptpDrvStackReset
TimeSync_stackResetCallback_t ptpDrvStackReset
Definition: icss_timeSyncApi.h:358
peerDelayParams_t::T1Nsec
uint32_t T1Nsec
Definition: icss_timeSyncApi.h:721
timeStamp::seconds
uint64_t seconds
Definition: icss_timeSyncApi.h:235
TimeSync_ParamsHandle::eventIdPdelayRespFlwUp
uint32_t eventIdPdelayRespFlwUp
Definition: icss_timeSyncApi.h:898
TimeSync_ParamsHandle::tsRunTimeVar
timeSync_RuntimeVar_t * tsRunTimeVar
Definition: icss_timeSyncApi.h:939
FAULTY
@ FAULTY
Definition: icss_timeSyncApi.h:144
BOTH
@ BOTH
Definition: icss_timeSyncApi.h:185
timeSync_RuntimeVar_t::syncPortNum
uint8_t syncPortNum
Definition: icss_timeSyncApi.h:528
TimeSync_frame_buffers_t::syncBuf_size
uint8_t syncBuf_size
Definition: icss_timeSyncApi.h:338
TaskP.h
TimeSync_ParamsHandle::timeSync_backgroundTask
TaskP_Object timeSync_backgroundTask
Definition: icss_timeSyncApi.h:869
peerDelayParams_t::pDelayReqRcvdTSSec
uint64_t pDelayReqRcvdTSSec
Definition: icss_timeSyncApi.h:743
UNKNOWN
@ UNKNOWN
Definition: icss_timeSyncApi.h:170
TimeSync_Config_t::frame_offset
uint8_t frame_offset
Definition: icss_timeSyncApi.h:448
delayReqRespParams_t::delReqTxTsSec
uint32_t delReqTxTsSec
Definition: icss_timeSyncApi.h:703
TimeSync_ParamsHandle::timeSync_delayReqSendTask
TaskP_Object timeSync_delayReqSendTask
Definition: icss_timeSyncApi.h:849
TimeSync_frame_buffers_t::sync_TxBuf
uint8_t * sync_TxBuf
Definition: icss_timeSyncApi.h:329
timeSync_Offset_Stable_Algo_t::binFull
uint8_t binFull
Definition: icss_timeSyncApi.h:598
timeSync_RuntimeVar_t::syncTimeoutInterval
uint32_t syncTimeoutInterval
Definition: icss_timeSyncApi.h:558
TimeSync_ParamsHandle::sequenceIdOut_rxTS
uint8_t sequenceIdOut_rxTS
Definition: icss_timeSyncApi.h:825
timeSync_RuntimeVar_t::masterParams
TimeSync_master_params_t masterParams
Definition: icss_timeSyncApi.h:567
timeSync_Offset_Stable_Algo_t
Variables used for offset stabilization algorithm.
Definition: icss_timeSyncApi.h:579
timeSync_RuntimeVar_t
Runtime variables for Time Sync implementation.
Definition: icss_timeSyncApi.h:469
syncParam_t::rxTs
uint32_t rxTs
Definition: icss_timeSyncApi.h:625
HwiP_Object
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:91
IEEE_802_3
@ IEEE_802_3
Definition: icss_timeSyncApi.h:166
TimeSync_Config_t::announceRcptTimeoutInterval
uint32_t announceRcptTimeoutInterval
Definition: icss_timeSyncApi.h:385
P2P
@ P2P
Definition: icss_timeSyncApi.h:196
ptpDparams_t::ptpGeneralSize
uint16_t ptpGeneralSize
Definition: icss_timeSyncApi.h:787
timeSync_NrrInfo_t
Parameters required for calculating Nighbor Rate Ratio.
Definition: icss_timeSyncApi.h:667
delayReqRespParams_t::timeStampNS
uint32_t timeStampNS
Definition: icss_timeSyncApi.h:700
DELAY_RESP_FRAME
@ DELAY_RESP_FRAME
Definition: icss_timeSyncApi.h:211
TimeSync_Config_t::pdelayBurstNumPkts
uint8_t pdelayBurstNumPkts
Definition: icss_timeSyncApi.h:407
timeSync_SyntInfo_t::syntIndex
uint32_t syntIndex
Definition: icss_timeSyncApi.h:659
syncParam_t::txTs
uint32_t txTs
Definition: icss_timeSyncApi.h:631
TimeSync_ParamsHandle::__attribute__
uint32_t txTSTaskP1Stack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
peerDelayParams_t::T2Nsec
uint32_t T2Nsec
Definition: icss_timeSyncApi.h:727
CONTROL_NET
@ CONTROL_NET
Definition: icss_timeSyncApi.h:168
TimeSync_ParamsHandle::syncInterval
uint32_t syncInterval
Definition: icss_timeSyncApi.h:833
TimeSync_Config_t::ll_has_hsrTag
uint8_t ll_has_hsrTag
Definition: icss_timeSyncApi.h:427
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
timeSync_RuntimeVar_t::ltaOffset
int32_t ltaOffset
Definition: icss_timeSyncApi.h:541
TimeSync_Config_t::syncOut_sync0Start
uint32_t syncOut_sync0Start
Definition: icss_timeSyncApi.h:352
timeSync_NrrInfo_t::curIndex
uint8_t curIndex
Definition: icss_timeSyncApi.h:678
TimeSync_master_params_t::clockAccuracy
uint8_t clockAccuracy
Definition: icss_timeSyncApi.h:290
TimeSync_Config_t
Time synchronization configuration structure.
Definition: icss_timeSyncApi.h:348
TimeSync_ParamsHandle::txprotocol
uint8_t txprotocol
Definition: icss_timeSyncApi.h:816
TimeSync_ParamsHandle::pruicssHandle
PRUICSS_Handle pruicssHandle
Definition: icss_timeSyncApi.h:807
TimeSync_ParamsHandle
Time synchronization parameter handle structure.
Definition: icss_timeSyncApi.h:799
TimeSync_ParamsHandle::clockTime
timeStamp clockTime
Definition: icss_timeSyncApi.h:828
TimeSync_ParamsHandle::__attribute__
uint32_t txTSTaskP2Stack[TASK_STACK_SIZE/sizeof(uint32_t)] __attribute__((aligned(32)))
syncParam_t::txTsSec
uint64_t txTsSec
Definition: icss_timeSyncApi.h:634
TimeSync_Config_t::txIntNum
uint32_t txIntNum
Definition: icss_timeSyncApi.h:397
TimeSync_Config_t::syncOut_sync0PWidth
uint32_t syncOut_sync0PWidth
Definition: icss_timeSyncApi.h:354
TimeSync_ParamsHandle::stackParams
ptpDparams_t stackParams
Definition: icss_timeSyncApi.h:836
PROFINET
@ PROFINET
Definition: icss_timeSyncApi.h:169
syncParam_t
Parameters required for calculating Cable Delay.
Definition: icss_timeSyncApi.h:611
TimeSync_ParamsHandle::delayParams
delayReqRespParams_t * delayParams
Definition: icss_timeSyncApi.h:921
TimeSync_parent_params_t::ptpPortNumber
uint16_t ptpPortNumber
Definition: icss_timeSyncApi.h:269
TimeSync_Config_t::timeSyncSyncLossCallBackfn
TimeSync_SyncLossCallBack_t timeSyncSyncLossCallBackfn
Definition: icss_timeSyncApi.h:356
TimeSync_Config_t::logAnnounceRcptTimeoutInterval
int8_t logAnnounceRcptTimeoutInterval
Definition: icss_timeSyncApi.h:369
timeSync_RuntimeVar_t::avgCorrectionField
uint32_t avgCorrectionField
Definition: icss_timeSyncApi.h:547
TimeSync_Config_t::custom_tx_api
uint8_t custom_tx_api
Definition: icss_timeSyncApi.h:431
TimeSync_SyncLossCallBack_t
void(* TimeSync_SyncLossCallBack_t)(void)
Sync loss callback function. Call cross module functions in case of loss of synchronization.
Definition: icss_timeSyncApi.h:253
TimeSync_setClockTime
int32_t TimeSync_setClockTime(TimeSync_ParamsHandle_t timeSyncParamsHandle)
Configures the driver memory.
ATOMIC_CLOCK
@ ATOMIC_CLOCK
Definition: icss_timeSyncApi.h:220
syncParam_t::rxTsSec
uint64_t rxTsSec
Definition: icss_timeSyncApi.h:628
TimeSync_ParamsHandle::timeSync_TxTSTaskP1
TaskP_Object timeSync_TxTSTaskP1
Definition: icss_timeSyncApi.h:854
SYNC_FRAME
@ SYNC_FRAME
Definition: icss_timeSyncApi.h:207
TimeSync_parent_params_t::observedOffsetScaledLogVariance
uint16_t observedOffsetScaledLogVariance
Definition: icss_timeSyncApi.h:273
TimeSync_ParamsHandle_t
struct TimeSync_ParamsHandle_s * TimeSync_ParamsHandle_t
Definition: icss_timeSyncApi.h:950
LISTENING
@ LISTENING
Definition: icss_timeSyncApi.h:146
timeSync_RuntimeVar_t::parentParams
TimeSync_parent_params_t parentParams
Definition: icss_timeSyncApi.h:570
TimeSync_Config_t::announceSendInterval
uint32_t announceSendInterval
Definition: icss_timeSyncApi.h:381
timeSync_Offset_Stable_Algo_t::driftThreshold
uint8_t driftThreshold
Definition: icss_timeSyncApi.h:590
timeSync_RuntimeVar_t::syncSequenceID
uint16_t syncSequenceID
Definition: icss_timeSyncApi.h:492
timeStamp::nanoseconds
uint32_t nanoseconds
Definition: icss_timeSyncApi.h:236
DELAY_REQ_FRAME
@ DELAY_REQ_FRAME
Definition: icss_timeSyncApi.h:209
TimeSync_frame_buffers_t::announce_TxBuf
uint8_t * announce_TxBuf
Definition: icss_timeSyncApi.h:330
timeSync_RuntimeVar_t::bmcaDone
uint8_t bmcaDone
Definition: icss_timeSyncApi.h:564
peerDelayParams_t::delayResCorrField
uint64_t delayResCorrField
Definition: icss_timeSyncApi.h:750
ipParams_t::dstIP
uint32_t dstIP
Definition: icss_timeSyncApi.h:767
PRUICSS_Handle
struct PRUICSS_Config_s * PRUICSS_Handle
A handle that is returned from a PRUICSS_open() call. This handle is required for calling other APIs.
Definition: pruicss/g_v0/pruicss.h:234
TimeSync_ParamsHandle::timeSync_txTSIsrObject
HwiP_Object timeSync_txTSIsrObject
Definition: icss_timeSyncApi.h:907
TimeSync_ParamsHandle::rxPort
uint8_t rxPort
Definition: icss_timeSyncApi.h:822
timeSync_NrrInfo_t::nrrEnable
uint8_t nrrEnable
Definition: icss_timeSyncApi.h:681
TimeSync_Config_t::protocol
netWorkProtType protocol
Definition: icss_timeSyncApi.h:391
TimeSync_updateDscpValueInDelayRequestFrame
void TimeSync_updateDscpValueInDelayRequestFrame(TimeSync_ParamsHandle_t timeSyncHandle, uint8_t dscpValue)
Update DSCP value in IP header in PTP Delay Request buffer.
timeSync_Offset_Stable_Algo_t::num_entries_index
uint8_t num_entries_index
Definition: icss_timeSyncApi.h:593
TimeSync_Config_t::timestamp_from_shared_ram
uint8_t timestamp_from_shared_ram
Definition: icss_timeSyncApi.h:437
TimeSync_master_params_t::clockClass
uint8_t clockClass
Definition: icss_timeSyncApi.h:288
ICSS_EMAC_MAX_PORTS_PER_INSTANCE
#define ICSS_EMAC_MAX_PORTS_PER_INSTANCE
Maximum number of Ports in a single ICSS
Definition: icss_emac.h:66
timeSync_RuntimeVar_t::ltaOffsetValid
int32_t ltaOffsetValid
Definition: icss_timeSyncApi.h:544
timeSync_Offset_Stable_Algo_t::lastSeen_good_drift_index
uint8_t lastSeen_good_drift_index
Definition: icss_timeSyncApi.h:585
TERRESTRIAL_RADIO
@ TERRESTRIAL_RADIO
Definition: icss_timeSyncApi.h:222
EventP.h
ptpFrameTypes_t
ptpFrameTypes_t
PTP Delay Mechanism Type. From Table 9 of Standard.
Definition: icss_timeSyncApi.h:203