change console=tty0 to enable linux framebuffer console
[jz_uboot.git] / cpu / ixp / npe / include / IxTimeSyncAcc.h
blob25effed90b4085f1c7dffee616332bf056cc95a2
1 /**
2 * @file IxTimeSyncAcc.h
4 * @author Intel Corporation
5 * @date 07 May 2004
7 * @brief Header file for IXP400 Access Layer to IEEE 1588(TM) Precision
8 * Clock Synchronisation Protocol Hardware Assist
10 * @version 1
12 * @par
13 * IXP400 SW Release version 2.0
15 * -- Copyright Notice --
17 * @par
18 * Copyright 2001-2005, Intel Corporation.
19 * All rights reserved.
21 * @par
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
24 * are met:
25 * 1. Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 * 3. Neither the name of the Intel Corporation nor the names of its contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
34 * @par
35 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
36 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
39 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
40 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
41 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
44 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 * SUCH DAMAGE.
47 * @par
48 * -- End of Copyright Notice --
51 /**
52 * @defgroup IxTimeSyncAcc IXP400 Time Sync Access Component API
54 * @brief Public API for IxTimeSyncAcc
56 * @{
58 #ifndef IXTIMESYNCACC_H
59 #define IXTIMESYNCACC_H
61 #ifdef __ixp46X
63 #include "IxOsal.h"
65 /**
66 * Section for enum
69 /**
70 * @ingroup IxTimeSyncAcc
72 * @enum IxTimeSyncAccStatus
74 * @brief The status as returned from the API
76 typedef enum /**< IxTimeSyncAccStatus */
78 IX_TIMESYNCACC_SUCCESS = IX_SUCCESS, /**< Requested operation successful */
79 IX_TIMESYNCACC_INVALIDPARAM, /**< An invalid parameter was passed */
80 IX_TIMESYNCACC_NOTIMESTAMP, /**< While polling no time stamp available */
81 IX_TIMESYNCACC_INTERRUPTMODEINUSE, /**< Polling not allowed while operating in interrupt mode */
82 IX_TIMESYNCACC_FAILED /**< Internal error occurred */
83 }IxTimeSyncAccStatus;
85 /**
86 * @ingroup IxTimeSyncAcc
88 * @enum IxTimeSyncAccAuxMode
90 * @brief Master or Slave Auxiliary Time Stamp (Snap Shot)
92 typedef enum /**< IxTimeSyncAccAuxMode */
94 IX_TIMESYNCACC_AUXMODE_MASTER, /**< Auxiliary Master Mode */
95 IX_TIMESYNCACC_AUXMODE_SLAVE, /**< Auxiliary Slave Mode */
96 IX_TIMESYNCACC_AUXMODE_INVALID /**< Invalid Auxiliary Mode */
97 }IxTimeSyncAccAuxMode;
99 /**
100 * @ingroup IxTimeSyncAcc
102 * @enum IxTimeSyncAcc1588PTPPort
104 * @brief IEEE 1588 PTP Communication Port(Channel)
106 typedef enum /**< IxTimeSyncAcc1588PTPPort */
108 IX_TIMESYNCACC_NPE_A_1588PTP_PORT, /**< PTP Communication Port on NPE-A */
109 IX_TIMESYNCACC_NPE_B_1588PTP_PORT, /**< PTP Communication Port on NPE-B */
110 IX_TIMESYNCACC_NPE_C_1588PTP_PORT, /**< PTP Communication Port on NPE-C */
111 IX_TIMESYNCACC_NPE_1588PORT_INVALID /**< Invalid PTP Communication Port */
112 } IxTimeSyncAcc1588PTPPort;
115 * @ingroup IxTimeSyncAcc
117 * @enum IxTimeSyncAcc1588PTPPortMode
119 * @brief Master or Slave mode for IEEE 1588 PTP Communication Port
121 typedef enum /**< IxTimeSyncAcc1588PTPPortMode */
123 IX_TIMESYNCACC_1588PTP_PORT_MASTER, /**< PTP Communication Port in Master Mode */
124 IX_TIMESYNCACC_1588PTP_PORT_SLAVE, /**< PTP Communication Port in Slave Mode */
125 IX_TIMESYNCACC_1588PTP_PORT_ANYMODE, /**< PTP Communication Port in ANY Mode
126 allows time stamping of all messages
127 including non-1588 PTP */
128 IX_TIMESYNCACC_1588PTP_PORT_MODE_INVALID /**< Invalid PTP Port Mode */
129 }IxTimeSyncAcc1588PTPPortMode;
132 * @ingroup IxTimeSyncAcc
134 * @enum IxTimeSyncAcc1588PTPMsgType
136 * @brief 1588 PTP Messages types that can be detected on communication port
138 * Note that client code can determine this based on master/slave mode in which
139 * it is already operating in and this information is made available for the sake
140 * of convenience only.
142 typedef enum /**< IxTimeSyncAcc1588PTPMsgType */
144 IX_TIMESYNCACC_1588PTP_MSGTYPE_SYNC, /**< PTP Sync message sent by Master or received by Slave */
145 IX_TIMESYNCACC_1588PTP_MSGTYPE_DELAYREQ, /**< PTP Delay_Req message sent by Slave or received by Master */
146 IX_TIMESYNCACC_1588PTP_MSGTYPE_UNKNOWN /**< Other PTP and non-PTP message sent or received by both
147 Master and/or Slave */
148 } IxTimeSyncAcc1588PTPMsgType;
151 * Section for struct
155 * @ingroup IxTimeSyncAcc
157 * @struct IxTimeSyncAccTimeValue
159 * @brief Struct to hold 64 bit SystemTime and TimeStamp values
161 typedef struct /**< IxTimeSyncAccTimeValue */
163 UINT32 timeValueLowWord; /**< Lower 32 bits of the time value */
164 UINT32 timeValueHighWord; /**< Upper 32 bits of the time value */
165 } IxTimeSyncAccTimeValue;
168 * @ingroup IxTimeSyncAcc
170 * @struct IxTimeSyncAccUuid
172 * @brief Struct to hold 48 bit UUID values captured in Sync or Delay_Req messages
174 typedef struct /**< IxTimeSyncAccUuid */
176 UINT32 uuidValueLowWord; /**<The lower 32 bits of the UUID */
177 UINT16 uuidValueHighHalfword; /**<The upper 16 bits of the UUID */
178 } IxTimeSyncAccUuid;
181 * @ingroup IxTimeSyncAcc
183 * @struct IxTimeSyncAccPtpMsgData
185 * @brief Struct for data from the PTP message returned when TimeStamp available
187 typedef struct /**< IxTimeSyncAccPtpMsgData */
189 IxTimeSyncAcc1588PTPMsgType ptpMsgType; /**< PTP Messages type */
190 IxTimeSyncAccTimeValue ptpTimeStamp; /**< 64 bit TimeStamp value from PTP Message */
191 IxTimeSyncAccUuid ptpUuid; /**< 48 bit UUID value from the PTP Message */
192 UINT16 ptpSequenceNumber; /**< 16 bit Sequence Number from PTP Message */
193 } IxTimeSyncAccPtpMsgData;
196 * @ingroup IxTimeSyncAcc
198 * @struct IxTimeSyncAccStats
200 * @brief Statistics for the PTP messages
202 typedef struct /**< IxTimeSyncAccStats */
204 UINT32 rxMsgs; /**< Count of timestamps for received PTP Messages */
205 UINT32 txMsgs; /**< Count of timestamps for transmitted PTP Messages */
206 } IxTimeSyncAccStats;
209 * @ingroup IxTimeSyncAcc
211 * @typedef IxTimeSyncAccTargetTimeCallback
213 * @brief Callback for use by target time stamp interrupt
215 typedef void (*IxTimeSyncAccTargetTimeCallback)(IxTimeSyncAccTimeValue targetTime);
218 * @ingroup IxTimeSyncAcc
220 * @typedef IxTimeSyncAccAuxTimeCallback
222 * @brief Callback for use by auxiliary time interrupts
224 typedef void (*IxTimeSyncAccAuxTimeCallback)(IxTimeSyncAccAuxMode auxMode,
225 IxTimeSyncAccTimeValue auxTime);
228 * Section for prototypes interface functions
232 * @ingroup IxTimeSyncAcc
234 * @fn IxTimeSyncAccStatus ixTimeSyncAccPTPPortConfigSet(
235 IxTimeSyncAcc1588PTPPort ptpPort,
236 IxTimeSyncAcc1588PTPPortMode ptpPortMode)
238 * @brief Configures the IEEE 1588 message detect on particular PTP port.
240 * @param ptpPort [in] - PTP port to config
241 * @param ptpPortMode [in]- Port to operate in Master or Slave mode
243 * This API will enable the time stamping on a particular PTP port.
245 * @li Re-entrant : No
246 * @li ISR Callable : No
248 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
249 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
250 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
252 PUBLIC IxTimeSyncAccStatus
253 ixTimeSyncAccPTPPortConfigSet(IxTimeSyncAcc1588PTPPort ptpPort,
254 IxTimeSyncAcc1588PTPPortMode ptpPortMode);
257 * @ingroup IxTimeSyncAcc
259 * @fn IxTimeSyncAccStatus ixTimeSyncAccPTPPortConfigGet(
260 IxTimeSyncAcc1588PTPPort ptpPort,
261 IxTimeSyncAcc1588PTPPortMode *ptpPortMode)
263 * @brief Retrieves IEEE 1588 PTP operation mode on particular PTP port.
265 * @param ptpPort [in] - PTP port
266 * @param ptpPortMode [in]- Mode of operation of PTP port (Master or Slave)
268 * This API will identify the time stamping capability of a PTP port by means
269 * of obtaining its mode of operation.
271 * @li Re-entrant : No
272 * @li ISR Callable : No
274 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
275 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
276 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
278 PUBLIC IxTimeSyncAccStatus
279 ixTimeSyncAccPTPPortConfigGet(IxTimeSyncAcc1588PTPPort ptpPort,
280 IxTimeSyncAcc1588PTPPortMode *ptpPortMode);
283 * @ingroup IxTimeSyncAcc
285 * @fn IxTimeSyncAccStatus ixTimeSyncAccPTPRxPoll(
286 IxTimeSyncAcc1588PTPPort ptpPort,
287 IxTimeSyncAccPtpMsgData *ptpMsgData)
289 * @brief Polls the IEEE 1588 message/time stamp detect status on a particular
290 * PTP Port on the Receive side.
292 * @param ptpPort [in] - PTP port to poll
293 * @param ptpMsgData [out] - Current TimeStamp and other Data
295 * This API will poll for the availability of a time stamp on the received Sync
296 * (Slave) or Delay_Req (Master) messages.
297 * The client application will provide the buffer.
299 * @li Re-entrant : No
300 * @li ISR Callable : No
302 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
303 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
304 * @li IX_TIMESYNCACC_NOTIMESTAMP - No time stamp available
305 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
307 PUBLIC IxTimeSyncAccStatus
308 ixTimeSyncAccPTPRxPoll(IxTimeSyncAcc1588PTPPort ptpPort,
309 IxTimeSyncAccPtpMsgData *ptpMsgData);
312 * @ingroup IxTimeSyncAcc
314 * @fn IxTimeSyncAccStatus ixTimeSyncAccPTPTxPoll(
315 IxTimeSyncAcc1588PTPPort ptpPort,
316 IxTimeSyncAccPtpMsgData *ptpMsgData)
319 * @brief Polls the IEEE 1588 message/time stamp detect status on a particular
320 * PTP Port on the Transmit side.
322 * @param ptpPort [in] - PTP port to poll
323 * @param ptpMsgData [out] - Current TimeStamp and other Data
325 * This API will poll for the availability of a time stamp on the transmitted
326 * Sync (Master) or Delay_Req (Slave) messages.
327 * The client application will provide the buffer.
329 * @li Re-entrant : No
330 * @li ISR Callable : No
332 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
333 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
334 * @li IX_TIMESYNCACC_NOTIMESTAMP - No time stamp available
335 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
337 PUBLIC IxTimeSyncAccStatus
338 ixTimeSyncAccPTPTxPoll(IxTimeSyncAcc1588PTPPort ptpPort,
339 IxTimeSyncAccPtpMsgData *ptpMsgData);
342 * @ingroup IxTimeSyncAcc
344 * @fn IxTimeSyncAccStatus ixTimeSyncAccSystemTimeSet(
345 IxTimeSyncAccTimeValue systemTime)
347 * @brief Sets the System Time in the IEEE 1588 hardware assist block
349 * @param systemTime [in] - Value to set System Time
351 * This API will set the SystemTime to given value.
353 * @li Re-entrant : yes
354 * @li ISR Callable : no
356 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
357 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
359 PUBLIC IxTimeSyncAccStatus
360 ixTimeSyncAccSystemTimeSet(IxTimeSyncAccTimeValue systemTime);
363 * @ingroup IxTimeSyncAcc
365 * @fn IxTimeSyncAccStatus ixTimeSyncAccSystemTimeGet(
366 IxTimeSyncAccTimeValue *systemTime)
368 * @brief Gets the System Time from the IEEE 1588 hardware assist block
370 * @param systemTime [out] - Copy the current System Time into the client
371 * application provided buffer
373 * This API will get the SystemTime from IEEE1588 block and return to client
375 * @li Re-entrant : no
376 * @li ISR Callable : no
378 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
379 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
380 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
382 PUBLIC IxTimeSyncAccStatus
383 ixTimeSyncAccSystemTimeGet(IxTimeSyncAccTimeValue *systemTime);
386 * @ingroup IxTimeSyncAcc
388 * @fn IxTimeSyncAccStatus ixTimeSyncAccTickRateSet(
389 UINT32 tickRate)
391 * @brief Sets the Tick Rate (Frequency Scaling Value) in the IEEE 1588
392 * hardware assist block
394 * @param tickRate [in] - Value to set Tick Rate
396 * This API will set the Tick Rate (Frequency Scaling Value) in the IEEE
397 * 1588 block to the given value. The Accumulator register (not client
398 * visible) is incremented by this TickRate value every clock cycle. When
399 * the Accumulator overflows, the SystemTime is incremented by one. This
400 * TickValue can therefore be used to adjust the system timer.
402 * @li Re-entrant : yes
403 * @li ISR Callable : no
405 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
406 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
408 PUBLIC IxTimeSyncAccStatus
409 ixTimeSyncAccTickRateSet(UINT32 tickRate);
412 * @ingroup IxTimeSyncAcc
414 * @fn IxTimeSyncAccStatus ixTimeSyncAccTickRateGet(
415 UINT32 *tickRate)
417 * @brief Gets the Tick Rate (Frequency Scaling Value) from the IEEE 1588
418 * hardware assist block
420 * @param tickRate [out] - Current Tick Rate value in the IEEE 1588 block
422 * This API will get the TickRate on IEE15588 block. Refer to @ref
423 * ixTimeSyncAccTickRateSet for notes on usage of this value.
425 * @li Reentrant : yes
426 * @li ISR Callable : no
428 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
429 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
430 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
432 PUBLIC IxTimeSyncAccStatus
433 ixTimeSyncAccTickRateGet(UINT32 *tickRate);
436 * @ingroup IxTimeSyncAcc
438 * @fn IxTimeSyncAccStatus ixTimeSyncAccTargetTimeInterruptEnable(
439 IxTimeSyncAccTargetTimeCallback targetTimeCallback)
441 * @brief Enables the interrupt to verify the condition where the System Time
442 * greater or equal to the Target Time in the IEEE 1588 hardware assist block.
443 * If the condition is true an interrupt will be sent to XScale.
445 * @param targetTimeCallback [in] - Callback to be invoked when interrupt fires
447 * This API will enable the Target Time reached/hit condition interrupt.
449 * NOTE: The client application needs to ensure that the APIs
450 * @ref ixTimeSyncAccTargetTimeInterruptEnable, @ref ixTimeSyncAccTargetTimeSet and
451 * @ref ixTimeSyncAccTargetTimeInterruptDisable are accessed in mutual exclusive
452 * manner with respect to each other.
454 * @li Re-entrant : no
455 * @li ISR Callable : yes
457 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
458 * @li IX_TIMESYNCACC_INVALIDPARAM - Null parameter passed for callback
459 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
461 PUBLIC IxTimeSyncAccStatus
462 ixTimeSyncAccTargetTimeInterruptEnable(IxTimeSyncAccTargetTimeCallback targetTimeCallback);
465 * @ingroup IxTimeSyncAcc
467 * @fn IxTimeSyncAccStatus ixTimeSyncAccTargetTimeInterruptDisable(
468 void)
470 * @brief Disables the interrupt for the condition explained in the function
471 * description of @ref ixTimeSyncAccTargetTimeInterruptEnable.
473 * This API will disable the Target Time interrupt.
475 * NOTE: The client application needs to ensure that the APIs
476 * @ref ixTimeSyncAccTargetTimeInterruptEnable, @ref ixTimeSyncAccTargetTimeSet and
477 * @ref ixTimeSyncAccTargetTimeInterruptDisable are accessed in mutual exclusive
478 * manner with respect to each other.
480 * @li Re-entrant : no
481 * @li ISR Callable : yes
483 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
484 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
486 PUBLIC IxTimeSyncAccStatus
487 ixTimeSyncAccTargetTimeInterruptDisable(void);
490 * @ingroup IxTimeSyncAcc
492 * @fn IxTimeSyncAccStatus ixTimeSyncAccTargetTimePoll(
493 BOOL *ttmPollFlag,
494 IxTimeSyncAccTimeValue *targetTime)
496 * @brief Poll to verify the condition where the System Time greater or equal to
497 * the Target Time in the IEEE 1588 hardware assist block. If the condition is
498 * true an event flag is set in the hardware.
500 * @param ttmPollFlag [out] - TRUE if the target time reached/hit condition event set
501 * FALSE if the target time reached/hit condition event is
502 not set
503 * @param targetTime [out] - Capture current targetTime into client provided buffer
505 * Poll the target time reached/hit condition status. Return true and the current
506 * target time value, if the condition is true else return false.
508 * NOTE: The client application will need to clear the event flag that will be set
509 * as long as the condition that the System Time greater or equal to the Target Time is
510 * valid, in one of the following ways:
511 * 1) Invoke the API to change the target time
512 * 2) Change the system timer value
514 * @li Re-entrant : yes
515 * @li ISR Callable : no
517 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
518 * @li IX_TIMESYNCACC_INVALIDPARAM - Null parameter passed
519 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
520 * @li IX_TIMESYNCACC_INTERRUPTMODEINUSE - Interrupt mode in use
522 PUBLIC IxTimeSyncAccStatus
523 ixTimeSyncAccTargetTimePoll(BOOL *ttmPollFlag,
524 IxTimeSyncAccTimeValue *targetTime);
527 * @ingroup IxTimeSyncAcc
529 * @fn IxTimeSyncAccStatus ixTimeSyncAccTargetTimeSet(
530 IxTimeSyncAccTimeValue targetTime)
532 * @brief Sets the Target Time in the IEEE 1588 hardware assist block
534 * @param targetTime [in] - Value to set Target Time
536 * This API will set the Target Time to a given value.
538 * NOTE: The client application needs to ensure that the APIs
539 * @ref ixTimeSyncAccTargetTimeInterruptEnable, @ref ixTimeSyncAccTargetTimeSet and
540 * @ref ixTimeSyncAccTargetTimeInterruptDisable are accessed in mutual exclusive
541 * manner with respect to each other.
543 * @li Reentrant : no
544 * @li ISR Callable : yes
546 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
547 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
549 PUBLIC IxTimeSyncAccStatus
550 ixTimeSyncAccTargetTimeSet(IxTimeSyncAccTimeValue targetTime);
553 * @ingroup IxTimeSyncAcc
555 * @fn IxTimeSyncAccStatus ixTimeSyncAccTargetTimeGet(
556 IxTimeSyncAccTimeValue *targetTime)
558 * @brief Gets the Target Time in the IEEE 1588 hardware assist block
560 * @param targetTime [out] - Copy current time to client provided buffer
562 * This API will get the Target Time from IEEE 1588 block and return to the
563 * client application
565 * @li Re-entrant : yes
566 * @li ISR Callable : no
568 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
569 * @li IX_TIMESYNCACC_INVALIDPARAM - Null parameter passed
570 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
572 PUBLIC IxTimeSyncAccStatus
573 ixTimeSyncAccTargetTimeGet(IxTimeSyncAccTimeValue *targetTime);
576 * @ingroup IxTimeSyncAcc
578 * @fn IxTimeSyncAccStatus ixTimeSyncAccAuxTimeInterruptEnable(
579 IxTimeSyncAccAuxMode auxMode,
580 IxTimeSyncAccAuxTimeCallback auxTimeCallback)
582 * @brief Enables the interrupt notification for the given mode of Auxiliary Time
583 * Stamp in the IEEE 1588 hardware assist block
585 * @param auxMode [in] - Auxiliary time stamp register (slave or master) to use
586 * @param auxTimeCallback [in] - Callback to be invoked when interrupt fires
588 * This API will enable the Auxiliary Master/Slave Time stamp Interrupt.
590 * <pre>
591 * NOTE: 1) An individual callback is to be registered for each Slave and Master
592 * Auxiliary Time Stamp registers. Thus to register for both Master and Slave time
593 * stamp interrupts either the same callback or two separate callbacks the API has
594 * to be invoked twice.
595 * 2) On the IXDP465 Development Platform, the Auxiliary Timestamp signal for
596 * slave mode is tied to GPIO 8 pin. This signal is software routed by default to
597 * PCI for backwards compatibility with the IXDP425 Development Platform. This
598 * routing must be disabled for the auxiliary slave time stamp register to work
599 * properly. The following commands may be used to accomplish this. However, refer
600 * to the IXDP465 Development Platform Users Guide or the BSP/LSP documentation for
601 * more specific information.
603 * For Linux (at the Redboot prompt i.e., before loading zImage):
604 * mfill -b 0x54100000 -1 -l 1 -p 8
605 * mfill -b 0x54100001 -1 -l 1 -p 0x7f
606 * For vxWorks, at the prompt:
607 * intDisable(25)
608 * ixdp400FpgaIODetach(8)
609 * </pre>
611 * @li Re-entrant : no
612 * @li ISR Callable : no
614 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
615 * @li IX_TIMESYNCACC_INVALIDPARAM - Null parameter passed for callback or
616 invalid auxiliary snapshot mode
617 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
619 PUBLIC IxTimeSyncAccStatus
620 ixTimeSyncAccAuxTimeInterruptEnable(IxTimeSyncAccAuxMode auxMode,
621 IxTimeSyncAccAuxTimeCallback auxTimeCallback);
624 * @ingroup IxTimeSyncAcc
626 * @fn IxTimeSyncAccStatus ixTimeSyncAccAuxTimeInterruptDisable(
627 IxTimeSyncAccAuxMode auxMode)
629 * @brief Disables the interrupt for the indicated mode of Auxiliary Time Stamp
630 * in the IEEE 1588 hardware assist block
632 * @param auxMode [in] - Auxiliary time stamp mode (slave or master) using which
633 * the interrupt will be disabled.
635 * This API will disable the Auxiliary Time Stamp Interrupt (Master or Slave)
637 * @li Re-entrant : yes
638 * @li ISR Callable : no
640 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
641 * @li IX_TIMESYNCACC_INVALIDPARAM - Invalid parameters passed
642 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
644 PUBLIC IxTimeSyncAccStatus
645 ixTimeSyncAccAuxTimeInterruptDisable(IxTimeSyncAccAuxMode auxMode);
648 * @ingroup IxTimeSyncAcc
650 * @fn IxTimeSyncAccStatus ixTimeSyncAccAuxTimePoll(
651 IxTimeSyncAccAuxMode auxMode,
652 BOOL *auxPollFlag,
653 IxTimeSyncAccTimeValue *auxTime)
655 * @brief Poll for the Auxiliary Time Stamp captured for the mode indicated
656 * (Master or Slave)
658 * @param auxMode [in] - Auxiliary Snapshot Register (Slave or Master) to be checked
659 * @param auxPollFlag [out] - TRUE if the time stamp captured in auxiliary
660 snapshot register
661 * FALSE if the time stamp not captured in
662 auxiliary snapshot register
663 * @param auxTime [out] - Copy the current Auxiliary Snapshot Register value into the
664 * client provided buffer
666 * Polls for the Time stamp in the appropriate Auxiliary Snapshot Registers based
667 * on the mode specified. Return true and the contents of the Auxiliary snapshot,
668 * if it is available else return false.
670 * Please refer to the note #2 of the API @ref ixTimeSyncAccAuxTimeInterruptEnable
671 * for more information for Auxiliary Slave mode.
673 * @li Re-entrant : yes
674 * @li ISR Callable : no
676 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
677 * @li IX_TIMESYNCACC_INVALIDPARAM - Null parameter passed for auxPollFlag,
678 callback or invalid auxiliary snapshot mode
679 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
680 * @li IX_TIMESYNCACC_INTERRUPTMODEINUSE - Interrupt mode in use
682 PUBLIC IxTimeSyncAccStatus
683 ixTimeSyncAccAuxTimePoll(IxTimeSyncAccAuxMode auxMode,
684 BOOL *auxPollFlag,
685 IxTimeSyncAccTimeValue *auxTime);
688 * @ingroup IxTimeSyncAcc
690 * @fn IxTimeSyncAccStatus ixTimeSyncAccReset(void)
692 * @brief Resets the IEEE 1588 hardware assist block
694 * Sets the reset bit in the IEEE1588 silicon which fully resets the silicon block
696 * @li Reentrant : yes
697 * @li ISR Callable : no
699 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
700 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
702 PUBLIC IxTimeSyncAccStatus
703 ixTimeSyncAccReset(void);
706 * @ingroup IxTimeSyncAcc
708 * @fn IxTimeSyncAccStatus ixTimeSyncAccStatsGet(IxTimeSyncAccStats
709 *timeSyncStats)
711 * @brief Returns the IxTimeSyncAcc Statistics in the client supplied buffer
713 * @param timeSyncStats [out] - TimeSync statistics counter values
715 * This API will return the statistics of the received or transmitted messages.
717 * NOTE: 1) These counters are updated only when the client polls for the time
718 * stamps or interrupt are enabled. This is because the IxTimeSyncAcc module
719 * does not either transmit or receive messages and does only run the code
720 * when explicit requests received by client application.
722 * 2) These statistics reflect the number of valid PTP messages exchanged
723 * in Master and Slave modes but includes all the messages (including valid
724 * non-PTP messages) while operating in the Any mode.
726 * @li Reentrant : no
727 * @li ISR Callable : no
729 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
730 * @li IX_TIMESYNCACC_INVALIDPARAM - NULL parameter passed
731 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
733 PUBLIC IxTimeSyncAccStatus
734 ixTimeSyncAccStatsGet(IxTimeSyncAccStats *timeSyncStats);
737 * @ingroup IxTimeSyncAcc
739 * @fn void ixTimeSyncAccStatsReset(void)
741 * @brief Reset Time Sync statistics
743 * This API will reset the statistics counters of the TimeSync access layer.
745 * @li Reentrant : yes
746 * @li ISR Callable: no
748 * @return @li None
750 PUBLIC void
751 ixTimeSyncAccStatsReset(void);
754 * @ingroup IxTimeSyncAcc
756 * @fn IxTimeSyncAccStatus ixTimeSyncAccShow(void)
758 * @brief Displays the Time Sync current status
760 * This API will display status on the current configuration of the IEEE
761 * 1588 hardware assist block, contents of the various time stamp registers,
762 * outstanding interrupts and/or events.
764 * Note that this is intended for debug only, and in contrast to the other
765 * functions, it does not clear the any of the status bits associated with
766 * active timestamps and so is passive in its nature.
768 * @li Reentrant : yes
769 * @li ISR Callable : no
771 * @return @li IX_TIMESYNCACC_SUCCESS - Operation is successful
772 * @li IX_TIMESYNCACC_FAILED - Internal error occurred
774 PUBLIC IxTimeSyncAccStatus
775 ixTimeSyncAccShow(void);
777 #endif /* __ixp46X */
778 #endif /* IXTIMESYNCACC_H */
781 * @} defgroup IxTimeSyncAcc