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 */
41 #ifndef _CSL_CPTS_H_
42 #define _CSL_CPTS_H_
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 #include <ti/csl/soc.h>
49 #include <ti/csl/csl.h>
50 #include <ti/csl/cslr_cpts.h>
52 /** ============================================================================
53 *
54 * @defgroup CSL_CPTS_API Time Sync Submodule (CPTS)
55 * @ingroup CSL_CPTS_API
56 *
57 * @section Introduction
58 *
59 * @subsection xxx Overview
60 *
61 * @subsection References
62 * -# Ethernet Media Access Controller User Guide
63 * ============================================================================
64 */
65 /**
66 @defgroup CSL_CPTS_SYMBOL CPTS Symbols Defined
67 @ingroup CSL_CPTS_API
68 */
69 /**
70 @defgroup CSL_CPTS_DATASTRUCT CPTS Data Structures
71 @ingroup CSL_CPTS_API
72 */
73 /**
74 @defgroup CSL_CPTS_FUNCTION CPTS Functions
75 @ingroup CSL_CPTS_API
76 */
77 /**
78 @defgroup CSL_CPTS_ENUM CPTS Enumerated Data Types
79 @ingroup CSL_CPTS_API
80 */
82 /**
83 @addtogroup CSL_CPTS_SYMBOL
84 @{
85 */
87 /**
88 @}
89 */
91 /** @addtogroup CSL_CPTS_DATASTRUCT
92 @{ */
94 /** @brief
95 *
96 * Defines CPTS event types.
97 */
98 /** Time stamp push event */
99 #define CSL_CPTS_EVENTTYPE_TS_PUSH 0
101 /** Time stamp rollover event (32-bit mode only) */
102 #define CSL_CPTS_EVENTTYPE_TS_ROLLOVER 1
104 /** Time stamp Half Rollover event (32-bit mode only) */
105 #define CSL_CPTS_EVENTTYPE_TS_HALFROLLOVER 2
107 /** Hardware Time stamp push event */
108 #define CSL_CPTS_EVENTTYPE_HW_TS_PUSH 3
110 /** Ethernet receive event */
111 #define CSL_CPTS_EVENTTYPE_ETH_RECEIVE 4
113 /** Ethernet Transmit event */
114 #define CSL_CPTS_EVENTTYPE_ETH_TRANSMIT 5
116 /** Time stamp compare event (non-toggle mode only) */
117 #define CSL_CPTS_EVENTTYPE_TS_COMP 6
119 /** Host event */
120 #define CSL_CPTS_EVENTTYPE_HOST 7
122 /** @brief
123 *
124 * Holds the Time sync submodule's version info.
125 */
126 typedef struct {
127 /** Minor version value */
128 Uint32 minorVer;
130 /** Major version value */
131 Uint32 majorVer;
133 /** RTL version value */
134 Uint32 rtlVer;
136 /** Identification value */
137 Uint32 id;
138 } CSL_CPTS_VERSION;
140 /** @brief
141 *
142 * Holds Time sync event info contents.
143 */
144 typedef struct {
145 /** 32-bit Event Time stamp */
146 Uint32 timeStamp;
148 /** Upper 32-bit Event Time stamp provided by new generation CPTS */
149 Uint32 timeStampHi;
151 /** Event Sequence Id */
152 Uint32 seqId;
154 /** Event Message Type */
155 Uint32 msgType;
157 /** Event Type */
158 Uint32 eventType;
160 /** EMAC Port number */
161 Uint32 portNo;
163 /** Event Domain */
164 Uint32 domain;
165 } CSL_CPTS_EVENTINFO;
167 /**
168 @}
169 */
171 #if defined(SOC_K2K) || defined(SOC_C6678)
173 #include <ti/csl/src/ip/cpsw/V0/csl_cpts.h>
175 #elif defined(SOC_K2H)
177 #include <ti/csl/src/ip/cpsw/V0/csl_cpts.h>
179 #elif defined(SOC_K2E)
181 #include <ti/csl/src/ip/cpsw/V1/csl_cpts.h>
183 #elif defined(SOC_K2L)
185 #include <ti/csl/src/ip/cpsw/V1/csl_cpts.h>
187 #elif defined(SOC_K2G)
189 #include <ti/csl/src/ip/cpsw/V2/csl_cpts.h>
191 #endif /* SOC_XXXXX */
193 #ifdef __cplusplus
194 }
195 #endif
197 #endif
199 /**
200 @}
201 */