xref: /freebsd/sys/contrib/ncsw/Peripherals/FM/Pcd/fm_pcd_ipc.h (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1 /*
2  * Copyright 2008-2012 Freescale Semiconductor Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above copyright
9  *       notice, this list of conditions and the following disclaimer in the
10  *       documentation and/or other materials provided with the distribution.
11  *     * Neither the name of Freescale Semiconductor nor the
12  *       names of its contributors may be used to endorse or promote products
13  *       derived from this software without specific prior written permission.
14  *
15  *
16  * ALTERNATIVELY, this software may be distributed under the terms of the
17  * GNU General Public License ("GPL") as published by the Free Software
18  * Foundation, either version 2 of that License or (at your option) any
19  * later version.
20  *
21  * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 
34 /**************************************************************************//**
35  @File          fm_pcd_ipc.h
36 
37  @Description   FM PCD Inter-Partition prototypes, structures and definitions.
38 *//***************************************************************************/
39 #ifndef __FM_PCD_IPC_H
40 #define __FM_PCD_IPC_H
41 
42 #include "std_ext.h"
43 
44 
45 /**************************************************************************//**
46  @Group         FM_grp Frame Manager API
47 
48  @Description   FM API functions, definitions and enums
49 
50  @{
51 *//***************************************************************************/
52 
53 
54 #if defined(__MWERKS__) && !defined(__GNUC__)
55 #pragma pack(push,1)
56 #endif /* defined(__MWERKS__) && ... */
57 
58 /**************************************************************************//**
59  @Description   Structure for getting a sw parser address according to a label
60                 Fields commented 'IN' are passed by the port module to be used
61                 by the FM module.
62                 Fields commented 'OUT' will be filled by FM before returning to port.
63 *//***************************************************************************/
64 typedef _Packed struct t_FmPcdIpcSwPrsLable
65 {
66     uint32_t    enumHdr;                        /**< IN. The existence of this header will invoke
67                                                      the sw parser code. */
68     uint8_t     indexPerHdr;                    /**< IN. Normally 0, if more than one sw parser
69                                                      attachments for the same header, use this
70 
71                                                    index to distinguish between them. */
72 } _PackedType t_FmPcdIpcSwPrsLable;
73 
74 /**************************************************************************//**
75  @Description   Structure for port-PCD communication.
76                 Fields commented 'IN' are passed by the port module to be used
77                 by the FM module.
78                 Fields commented 'OUT' will be filled by FM before returning to port.
79                 Some fields are optional (depending on configuration) and
80                 will be analized by the port and FM modules accordingly.
81 *//***************************************************************************/
82 
83 typedef  struct t_FmPcdIpcKgSchemesParams
84 {
85     uint8_t     guestId;
86     uint8_t     numOfSchemes;
87     uint8_t     schemesIds[FM_PCD_KG_NUM_OF_SCHEMES];
88 } _PackedType t_FmPcdIpcKgSchemesParams;
89 
90 typedef  struct t_FmPcdIpcKgClsPlanParams
91 {
92     uint8_t     guestId;
93     uint16_t    numOfClsPlanEntries;
94     uint8_t     clsPlanBase;
95 } _PackedType t_FmPcdIpcKgClsPlanParams;
96 
97 typedef _Packed struct t_FmPcdIpcPrsIncludePort
98 {
99     uint8_t     hardwarePortId;
100     bool        include;
101 } _PackedType t_FmPcdIpcPrsIncludePort;
102 
103 
104 #define FM_PCD_MAX_REPLY_SIZE           16
105 #define FM_PCD_MAX_MSG_SIZE             36
106 #define FM_PCD_MAX_REPLY_BODY_SIZE      36
107 
108 typedef _Packed struct {
109     uint32_t    msgId;
110     uint8_t     msgBody[FM_PCD_MAX_MSG_SIZE];
111 } _PackedType t_FmPcdIpcMsg;
112 
113 typedef _Packed struct t_FmPcdIpcReply {
114     uint32_t    error;
115     uint8_t     replyBody[FM_PCD_MAX_REPLY_BODY_SIZE];
116 } _PackedType t_FmPcdIpcReply;
117 
118 typedef _Packed struct t_FmIpcResourceAllocParams {
119     uint8_t     guestId;
120     uint16_t    base;
121     uint16_t    num;
122 }_PackedType t_FmIpcResourceAllocParams;
123 
124 #if defined(__MWERKS__) && !defined(__GNUC__)
125 #pragma pack(pop)
126 #endif /* defined(__MWERKS__) && ... */
127 
128 
129 
130 /**************************************************************************//**
131  @Function      FM_PCD_ALLOC_KG_SCHEMES
132 
133  @Description   Used by FM PCD front-end in order to allocate KG resources
134 
135  @Param[in/out] t_FmPcdIpcKgAllocParams Pointer
136 *//***************************************************************************/
137 #define FM_PCD_ALLOC_KG_SCHEMES                 3
138 
139 /**************************************************************************//**
140  @Function      FM_PCD_FREE_KG_SCHEMES
141 
142  @Description   Used by FM PCD front-end in order to Free KG resources
143 
144  @Param[in/out] t_FmPcdIpcKgSchemesParams Pointer
145 *//***************************************************************************/
146 #define FM_PCD_FREE_KG_SCHEMES                  4
147 
148 /**************************************************************************//**
149  @Function      FM_PCD_ALLOC_PROFILES
150 
151  @Description   Used by FM PCD front-end in order to allocate Policer profiles
152 
153  @Param[in/out] t_FmIpcResourceAllocParams Pointer
154 *//***************************************************************************/
155 #define FM_PCD_ALLOC_PROFILES                   5
156 
157 /**************************************************************************//**
158  @Function      FM_PCD_FREE_PROFILES
159 
160  @Description   Used by FM PCD front-end in order to Free Policer profiles
161 
162  @Param[in/out] t_FmIpcResourceAllocParams Pointer
163 *//***************************************************************************/
164 #define FM_PCD_FREE_PROFILES                    6
165 
166 /**************************************************************************//**
167  @Function      FM_PCD_SET_PORT_PROFILES
168 
169  @Description   Used by FM PCD front-end in order to allocate Policer profiles
170                 for specific port
171 
172  @Param[in/out] t_FmIpcResourceAllocParams Pointer
173 *//***************************************************************************/
174 #define FM_PCD_SET_PORT_PROFILES                7
175 
176 /**************************************************************************//**
177  @Function      FM_PCD_CLEAR_PORT_PROFILES
178 
179  @Description   Used by FM PCD front-end in order to allocate Policer profiles
180                 for specific port
181 
182  @Param[in/out] t_FmIpcResourceAllocParams Pointer
183 *//***************************************************************************/
184 #define FM_PCD_CLEAR_PORT_PROFILES              8
185 
186 /**************************************************************************//**
187  @Function      FM_PCD_GET_PHYS_MURAM_BASE
188 
189  @Description   Used by FM PCD front-end in order to get MURAM base address
190 
191  @Param[in/out] t_FmPcdIcPhysAddr Pointer
192 *//***************************************************************************/
193 #define FM_PCD_GET_PHYS_MURAM_BASE              9
194 
195 /**************************************************************************//**
196  @Function      FM_PCD_GET_SW_PRS_OFFSET
197 
198  @Description   Used by FM front-end to get the SW parser offset of the start of
199                 code relevant to a given label.
200 
201  @Param[in/out] t_FmPcdIpcSwPrsLable Pointer
202 *//***************************************************************************/
203 #define FM_PCD_GET_SW_PRS_OFFSET                10
204 
205 /**************************************************************************//**
206  @Function      FM_PCD_MASTER_IS_ENABLED
207 
208  @Description   Used by FM front-end in order to verify
209                 PCD enablement.
210 
211  @Param[in]     bool Pointer
212 *//***************************************************************************/
213 #define FM_PCD_MASTER_IS_ENABLED                15
214 
215 /**************************************************************************//**
216  @Function      FM_PCD_GUEST_DISABLE
217 
218  @Description   Used by FM front-end to inform back-end when
219                 front-end PCD is disabled
220 
221  @Param[in]     None
222 *//***************************************************************************/
223 #define FM_PCD_GUEST_DISABLE                    16
224 
225 /**************************************************************************//**
226  @Function      FM_PCD_FREE_KG_CLSPLAN
227 
228  @Description   Used by FM PCD front-end in order to Free KG classification plan entries
229 
230  @Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer
231 *//***************************************************************************/
232 #define FM_PCD_FREE_KG_CLSPLAN                  22
233 
234 /**************************************************************************//**
235  @Function      FM_PCD_ALLOC_KG_CLSPLAN
236 
237  @Description   Used by FM PCD front-end in order to allocate KG classification plan entries
238 
239  @Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer
240 *//***************************************************************************/
241 #define FM_PCD_ALLOC_KG_CLSPLAN                 23
242 
243 /**************************************************************************//**
244  @Function      FM_PCD_MASTER_IS_ALIVE
245 
246  @Description   Used by FM front-end to check that back-end exists
247 
248  @Param[in]     None
249 *//***************************************************************************/
250 #define FM_PCD_MASTER_IS_ALIVE                  24
251 
252 /**************************************************************************//**
253  @Function      FM_PCD_GET_COUNTER
254 
255  @Description   Used by FM front-end to read PCD counters
256 
257  @Param[in/out] t_FmPcdIpcGetCounter Pointer
258 *//***************************************************************************/
259 #define FM_PCD_GET_COUNTER                      25
260 
261 /**************************************************************************//**
262  @Function      FM_PCD_PRS_INC_PORT_STATS
263 
264  @Description   Used by FM front-end to set/clear statistics for port
265 
266  @Param[in/out] t_FmPcdIpcPrsIncludePort Pointer
267 *//***************************************************************************/
268 #define FM_PCD_PRS_INC_PORT_STATS               26
269 
270 #if (DPAA_VERSION >= 11)
271 /* TODO - doc */
272 #define FM_PCD_ALLOC_SP                         27
273 #endif /* (DPAA_VERSION >= 11) */
274 
275 
276 /** @} */ /* end of FM_PCD_IPC_grp group */
277 /** @} */ /* end of FM_grp group */
278 
279 
280 #endif /* __FM_PCD_IPC_H */
281