csl_cpts.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /**
  2. * @file csl_cpts.h
  3. *
  4. * @brief
  5. * Header file containing various enumerations, structure definitions and function
  6. * declarations for the Time synchronization submodule of EMAC.
  7. * \par
  8. * ============================================================================
  9. * @n (C) Copyright 2009-2014, Texas Instruments, Inc.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. *
  18. * Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the
  21. * distribution.
  22. *
  23. * Neither the name of Texas Instruments Incorporated nor the names of
  24. * its contributors may be used to endorse or promote products derived
  25. * from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  30. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  31. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  33. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  34. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  35. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  36. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef CSL_CPTS_H_
  41. #define CSL_CPTS_H_
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #include <ti/csl/soc.h>
  46. #include <ti/csl/csl.h>
  47. #include <ti/csl/cslr_cpts.h>
  48. /**
  49. @defgroup CSL_CPTS_SYMBOL CPTS Symbols Defined
  50. @ingroup CSL_CPTS_API
  51. */
  52. /**
  53. @defgroup CSL_CPTS_DATASTRUCT CPTS Data Structures
  54. @ingroup CSL_CPTS_API
  55. */
  56. /**
  57. @defgroup CSL_CPTS_FUNCTION CPTS Functions
  58. @ingroup CSL_CPTS_API
  59. */
  60. /**
  61. @defgroup CSL_CPTS_ENUM CPTS Enumerated Data Types
  62. @ingroup CSL_CPTS_API
  63. */
  64. /**
  65. @addtogroup CSL_CPTS_SYMBOL
  66. @{
  67. */
  68. /**
  69. @}
  70. */
  71. /** @addtogroup CSL_CPTS_DATASTRUCT
  72. @{ */
  73. /** @brief
  74. *
  75. * Defines CPTS event types.
  76. */
  77. /** Time stamp push event */
  78. #define CSL_CPTS_EVENTTYPE_TS_PUSH 0
  79. /** Time stamp rollover event (32-bit mode only) */
  80. #define CSL_CPTS_EVENTTYPE_TS_ROLLOVER 1
  81. /** Time stamp Half Rollover event (32-bit mode only) */
  82. #define CSL_CPTS_EVENTTYPE_TS_HALFROLLOVER 2
  83. /** Hardware Time stamp push event */
  84. #define CSL_CPTS_EVENTTYPE_HW_TS_PUSH 3
  85. /** Ethernet receive event */
  86. #define CSL_CPTS_EVENTTYPE_ETH_RECEIVE 4
  87. /** Ethernet Transmit event */
  88. #define CSL_CPTS_EVENTTYPE_ETH_TRANSMIT 5
  89. /** Time stamp compare event (non-toggle mode only) */
  90. #define CSL_CPTS_EVENTTYPE_TS_COMP 6
  91. /** Host event */
  92. #define CSL_CPTS_EVENTTYPE_HOST 7
  93. /** @brief
  94. *
  95. * Holds the Time sync submodule's version info.
  96. */
  97. typedef struct {
  98. /** Minor version value */
  99. Uint32 minorVer;
  100. /** Major version value */
  101. Uint32 majorVer;
  102. /** RTL version value */
  103. Uint32 rtlVer;
  104. /** Identification value */
  105. Uint32 id;
  106. } CSL_CPTS_VERSION;
  107. /** @brief
  108. *
  109. * Holds Time sync event info contents.
  110. */
  111. typedef struct {
  112. /** 32-bit Event Time stamp */
  113. Uint32 timeStamp;
  114. /** Upper 32-bit Event Time stamp provided by new generation CPTS */
  115. Uint32 timeStampHi;
  116. /** Event Sequence Id */
  117. Uint32 seqId;
  118. /** Event Message Type */
  119. Uint32 msgType;
  120. /** Event Type */
  121. Uint32 eventType;
  122. /** EMAC Port number */
  123. Uint32 portNo;
  124. /** Event Domain */
  125. Uint32 domain;
  126. } CSL_CPTS_EVENTINFO;
  127. /**
  128. @}
  129. */
  130. /** ============================================================================
  131. *
  132. * @defgroup CSL_CPTS_API Time Sync Submodule (CPTS)
  133. * @ingroup CSL_CPSW_API
  134. *
  135. *
  136. * @subsection xxx Overview
  137. *
  138. * CSL CPTS API has common implementation for multiple SoCs along with below SoC specific
  139. * implementation with the mapping as below.
  140. * -# cpts v0 - SOC_K2K/SOC_K2H
  141. * -# cpts v1 - SOC_K2E/SOC_K2L
  142. * -# cpts v2 - SOC_K2G
  143. * -# cpts v4 - SOC_C6678
  144. *
  145. * @note: there may not be any ip specific implementation for that soc, if it contains only cslr_* files
  146. *
  147. * ============================================================================
  148. */
  149. #if defined(SOC_K2K) || defined(SOC_K2H)
  150. #include <ti/csl/src/ip/cpsw/V0/csl_cpts.h>
  151. #elif defined(SOC_C6678)
  152. #include <ti/csl/src/ip/cpsw/V4/csl_cpts.h>
  153. #elif defined(SOC_K2E)
  154. #include <ti/csl/src/ip/cpsw/V1/csl_cpts.h>
  155. #elif defined(SOC_K2L)
  156. #include <ti/csl/src/ip/cpsw/V1/csl_cpts.h>
  157. #elif defined(SOC_K2G)
  158. #include <ti/csl/src/ip/cpsw/V2/csl_cpts.h>
  159. #endif /* SOC_XXXXX */
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #endif
  164. /**
  165. @}
  166. */