diff options
Diffstat (limited to 'drivers/staging/nmf-cm/inc/nmf-tracedescription.h')
-rw-r--r-- | drivers/staging/nmf-cm/inc/nmf-tracedescription.h | 324 |
1 files changed, 324 insertions, 0 deletions
diff --git a/drivers/staging/nmf-cm/inc/nmf-tracedescription.h b/drivers/staging/nmf-cm/inc/nmf-tracedescription.h new file mode 100644 index 00000000000..9611803b978 --- /dev/null +++ b/drivers/staging/nmf-cm/inc/nmf-tracedescription.h @@ -0,0 +1,324 @@ +/* + * 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_ */ |