summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/inc/nmf-tracedescription.h
blob: bce589079b9d191310e31e26d821bbe3d049233d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
/*
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Jean-Philippe FASSINO <jean-philippe.fassino@stericsson.com> for ST-Ericsson.
 * License terms:  GNU General Public License (GPL), version 2, with
 * user space exemption described in the top-level COPYING file in
 * the Linux kernel source tree.
 */
/*!
 * \brief NMF xti/stm trace format description
 *
 * \defgroup NMF_TRACE_FORMAT NMF xti/stm trace format description
 *
 * The NMF trace is output by either xti ip on 8815 or stm ip on 8820 and 8500.
 * Each type of trace is output on a dedicated channel. Following is a description
 * of each of this traces.
 *
 * Traces have generally a timestamp added by hardware but is not described here.
 * \ingroup NMF_ABI
 */
#ifndef TRACE_FORMAT_H_
#define TRACE_FORMAT_H_

#include <inc/nmf-limits.h>

/*!
 * \brief XTI/STM Channel where trace are dumped
 *
 * \note This type is only for defining constants, please not reference it.
 *
 * \note Ever if this format is able to be generated on same channel, Host EE & CM channel are separated
 * in order to avoir concurrency and access STM IP without require mutual exclusion.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    MPC_EE_CHANNEL      = 100,                  //!< MPC EE channel (MPC activity) in 32bits bundle
    CM_CHANNEL          = 101,                  //!< CM channel (MPC deployment) in 64bits bundle
    HOST_EE_CHANNEL     = 151                   //!< Host EE channel (deployment & activity) in 64bits bundle
} t_nmfTraceChannelDescription;

/*!
 * \brief Message trace type
 *
 * \note This type is only for defining constants, please not reference it.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_TYPE_RESET            = 1,                //!< Reset trace type
    TRACE_TYPE_COMPONENT        = 2,                //!< Component instantiate trace type
    TRACE_TYPE_BIND             = 3,                //!< Component bind trace type
    TRACE_TYPE_METHOD           = 4,                //!< Component method trace type
    TRACE_TYPE_ACTIVITY         = 5,                //!< Activity trace type
    TRACE_TYPE_PANIC            = 6,                //!< Panic trace type
    TRACE_TYPE_COMMUNICATION    = 7,                //!< Communication trace type
    TRACE_TYPE_ALLOCATOR        = 8,                //!< Allocator trace type
    TRACE_TYPE_ALLOC            = 9,                //!< Alloc trace type
    TRACE_TYPE_USER             = 10                //!< User trace type
} t_nmfTraceTypeDescription;

#define TRACE_MAJOR_VERSION         1       //!< Current major trace version number \ingroup NMF_TRACE_FORMAT
#define TRACE_MINOR_VERSION         2       //!< Current minor trace version number \ingroup NMF_TRACE_FORMAT

/*!
 * \brief Trace header description.
 *
 * \note XTI will add 64bits time-stamp in first field of this structure, but not generated by us !
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceChannelHeader {
    // t_uint64           timeStamp;
    t_uint8             traceType;          //!< Trace type
    t_uint8             reserved;
    t_uint16            traceSize;          //!< Trace size (depending on trace type description)
};

/*!
 * \brief Trace header union
 *
 * The purpose of this is to optimize header setting in one instruction.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef union {
    struct t_nmfTraceChannelHeader   s;
    t_uint32                         v;
} t_nmfTraceChannelHeaderUnion;


/*!
 * \brief Trace reset description
 *
 * Inform tools to reset their internal state because network will be dumped new time.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceReset {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16                       minorVersion;                        //!< NMF trace format minor version
    t_uint16                       majorVersion;                        //!< NMF trace format major version
};

/**
 * \brief Component instantiation trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_COMPONENT_COMMAND_ADD         = 0x1,
    TRACE_COMPONENT_COMMAND_REMOVE      = 0x2
} t_nmfTraceComponentCommandDescription;


/*!
 * \brief Component instantiation trace description
 *
 * Component instantiation trace is generated each time an instance of a component is added or removed.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceComponent {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceComponentCommandDescription
    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA, in SMPEE: 0x1
    t_uint32            componentContext;                               //!< Component context belonging domain (DSP this or ARM class this)
    t_uint32            componentUserContext;                           //!< User friendly component Id belonging the channel (CM handle or ARM class this)
    t_uint8             componentLocalName[MAX_COMPONENT_NAME_LENGTH];  //!< local name of component as given by user (null terminated)
    t_uint8             componentTemplateName[MAX_TEMPLATE_NAME_LENGTH];//!< template name of component  (null terminated)
};

/**
 * \brief Component binding trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_BIND_COMMAND_BIND_SYNCHRONOUS         = 0x1,
    TRACE_BIND_COMMAND_UNBIND_SYNCHRONOUS       = 0x2,
    TRACE_BIND_COMMAND_BIND_ASYNCHRONOUS        = 0x3,
    TRACE_BIND_COMMAND_UNBIND_ASYNCHRONOUS      = 0x4
} t_nmfTraceBindCommandDescription;

/**
 * \brief Component binding trace description
 *
 * \note clientComponentContext & serverComponentContext take value 0xffffffff when client or server are Component Manager.
 * \note serverComponentContext take value 0x00000000 when binding to void.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceBind {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceBindCommandDescription
    t_uint16            reserved;
    t_uint16            clientDomainId;                                 //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA, in SMPEE: 0x1
    t_uint16            serverDomainId;                                 //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA, in SMPEE: 0x1
    t_uint32            clientComponentContext;                         //!< Component context belonging domain (DSP this or ARM class this)
    t_uint32            serverComponentContext;                         //!< Component context belonging domain (DSP this or ARM class this)
    t_uint8             requiredItfName[MAX_INTERFACE_NAME_LENGTH];     //!< Required interface name
    t_uint8             providedItfName[MAX_INTERFACE_NAME_LENGTH];     //!< Provided interface name
};

/*!
 * \brief Component interface method name trace description
 *
 * For each methods of each interfaces provided by a component, one such trace is dumped.
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceMethod {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA, in SMPEE: 0x1
    t_uint16            reserved;
    t_uint32            methodId;                                       //!< Unique Method Id belonging the component
    t_uint32            componentContext;                               //!< Component context belonging domain (DSP this or ARM class this)
    t_uint8             methodName[MAX_INTERFACE_METHOD_NAME_LENGTH];   //!< Symbolic method name
};

/**
 * \brief Activity trace trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_ACTIVITY_START                    = 0x1,                  //!< Start method
    TRACE_ACTIVITY_END                      = 0x2,                  //!< End method
    TRACE_ACTIVITY_POST                     = 0x3,                  //!< Post method
    TRACE_ACTIVITY_CALL                     = 0x4,                  //!< Synchronous call method
    TRACE_ACTIVITY_RETURN                   = 0x5                   //!< Synchronous return method
} t_nmfTraceActivityCommandDescription;

/*!
 * \brief Execution Engine scheduling activity trace description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceActivity {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceActivityCommandDescription
    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA
    t_uint32            componentContext;                               //!< Unique component Id (Component Handle for CM, Component this for EE)
    t_uint32            methodId;                                       //!< Unique Method Id belonging the component
};

/**
 * \brief Component instantiation trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_COMMUNICATION_COMMAND_SEND         = 0x1,
    TRACE_COMMUNICATION_COMMAND_RECEIVE      = 0x2
} t_nmfTraceCommunicationCommandDescription;

/**
 * \brief Inter-processor communication signaling trace description
 *
 * Use when trigging interrupt through core.
 *
 * \note Not used on SMP EE
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceCommunication {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceCommunicationCommandDescription
    t_uint16            reserved_0;
    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA
    t_uint16            remoteDomainId;                                 //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA
};

/**
 * \brief Component instantiation trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_ALLOCATOR_COMMAND_CREATE      = 0x1,
    TRACE_ALLOCATOR_COMMAND_DESTROY     = 0x2
} t_nmfTraceAllocatorCommandDescription;

/*!
 * \brief Panic trace description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceAllocator {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceAllocatorCommandDescription
    t_uint16            allocId;                                        //!< Memory allocator ID
    t_uint32            size;                                           //!< Memory allocator size
    t_uint8             name[32];                                       //!< Memory allocator name
};

/**
 * \brief Component instantiation trace command description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
typedef enum {
    TRACE_ALLOC_COMMAND_ALLOC           = 0x1,
    TRACE_ALLOC_COMMAND_FREE            = 0x2
} t_nmfTraceAllocCommandDescription;

/*!
 * \brief Panic trace description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceAlloc {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            command;                                        //!< See \ref t_nmfTraceAllocatorCommandDescription
    t_uint16            allocId;                                        //!< Memory allocator ID
    t_uint32            offset;                                         //!< Memory chunk offet
    t_uint32            size;                                           //!< Memory chunk size
};

/*!
 * \brief Panic trace description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTracePanic {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint16            reason;                                         //!< See \ref t_panic_reason for description
    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA
    t_uint32            componentContext;                               //!< Unique component Id (Component Handle for CM, Component this for EE)
    t_uint32            information1;                                   //!< Reason dependent information 1st
    t_uint32            information2;                                   //!< Reason dependent information 2nd
};

/*!
 * \brief User trace description
 *
 * \ingroup NMF_TRACE_FORMAT
 */
struct t_nmfTraceUser {
    t_nmfTraceChannelHeaderUnion   header;                              //!< Trace header

    t_uint32            key;                                            //!< User key
    t_uint16            domainId;                                       //!< In CM: 0x01:Arm | 0x02:SAA | 0x03:SVA | 0x04:SIA
    t_uint16            reserved;
    t_uint32            componentContext;                               //!< Unique component Id (Component Handle for CM, Component this for EE)
    t_uint32            callerAddress;                                  //!< Unique code address belonging the component
};

/*
struct t_nmfTracePower{
    struct t_nmfTraceChannelHeader   header;
};
*/

#endif /* TRACE_FORMAT_H_ */