|
8 | 8 |
|
9 | 9 | /** |
10 | 10 | * \file include/ipc/trace.h |
11 | | - * \brief IPC definitions |
12 | | - * \author Liam Girdwood <liam.r.girdwood@linux.intel.com> |
13 | | - * \author Keyon Jie <yang.jie@linux.intel.com> |
14 | | - * \author Karol Trzcinski <karolx.trzcinski@linux.intel.com> |
| 11 | + * \brief Host-DSP IPC trace DMA configuration, filtering, and panic descriptors. |
| 12 | + * \ingroup trace_logging_api |
15 | 13 | */ |
16 | 14 |
|
17 | 15 | #ifndef __IPC_TRACE_H__ |
|
21 | 19 | #include <ipc/stream.h> |
22 | 20 | #include <stdint.h> |
23 | 21 |
|
24 | | -/* |
25 | | - * DMA for Trace |
26 | | - */ |
27 | | - |
| 22 | +/** Maximum filename string length embedded in panic reports */ |
28 | 23 | #define SOF_TRACE_FILENAME_SIZE 32 |
29 | 24 |
|
30 | | -/* DMA for Trace params info - SOF_IPC_TRACE_DMA_PARAMS */ |
31 | | -/* Deprecated - use sof_ipc_dma_trace_params_ext */ |
| 25 | +/** |
| 26 | + * \brief Legacy host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS). |
| 27 | + * \ingroup trace_logging_api |
| 28 | + * @deprecated Use sof_ipc_dma_trace_params_ext instead. |
| 29 | + */ |
32 | 30 | struct sof_ipc_dma_trace_params { |
33 | | - struct sof_ipc_cmd_hdr hdr; |
34 | | - struct sof_ipc_host_buffer buffer; |
35 | | - uint32_t stream_tag; |
| 31 | + struct sof_ipc_cmd_hdr hdr; /**< IPC command header */ |
| 32 | + struct sof_ipc_host_buffer buffer; /**< Host-allocated circular buffer descriptor */ |
| 33 | + uint32_t stream_tag; /**< Assigned host DMA stream tag */ |
36 | 34 | } __attribute__((packed, aligned(4))); |
37 | 35 |
|
38 | | -/* DMA for Trace params info - SOF_IPC_TRACE_DMA_PARAMS_EXT */ |
| 36 | +/** |
| 37 | + * \brief Extended host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS_EXT). |
| 38 | + * \ingroup trace_logging_api |
| 39 | + */ |
39 | 40 | struct sof_ipc_dma_trace_params_ext { |
40 | | - struct sof_ipc_cmd_hdr hdr; |
41 | | - struct sof_ipc_host_buffer buffer; |
42 | | - uint32_t stream_tag; |
43 | | - uint64_t timestamp_ns; /* in nanosecnd */ |
44 | | - uint32_t reserved[8]; |
| 41 | + struct sof_ipc_cmd_hdr hdr; /**< IPC command header */ |
| 42 | + struct sof_ipc_host_buffer buffer; /**< Host-allocated circular buffer descriptor */ |
| 43 | + uint32_t stream_tag; /**< Assigned host DMA stream tag */ |
| 44 | + uint64_t timestamp_ns; /**< Host wallclock timestamp at synchronization point in ns */ |
| 45 | + uint32_t reserved[8]; /**< Reserved for future expansion */ |
45 | 46 | } __attribute__((packed, aligned(4))); |
46 | 47 |
|
47 | | -/* DMA for Trace params info - SOF_IPC_TRACE_DMA_POSITION */ |
| 48 | +/** |
| 49 | + * \brief DMA trace circular buffer position report sent to host (SOF_IPC_TRACE_DMA_POSITION). |
| 50 | + * \ingroup trace_logging_api |
| 51 | + */ |
48 | 52 | struct sof_ipc_dma_trace_posn { |
49 | | - struct sof_ipc_reply rhdr; |
50 | | - uint32_t host_offset; /* Offset of DMA host buffer */ |
51 | | - uint32_t overflow; /* overflow bytes if any */ |
52 | | - uint32_t messages; /* total trace messages */ |
| 53 | + struct sof_ipc_reply rhdr; /**< IPC reply header */ |
| 54 | + uint32_t host_offset; /**< Current write offset in host DMA buffer in bytes */ |
| 55 | + uint32_t overflow; /**< Cumulative count of dropped bytes due to buffer overflow */ |
| 56 | + uint32_t messages; /**< Total trace messages processed since boot */ |
53 | 57 | } __attribute__((packed, aligned(4))); |
54 | 58 |
|
55 | 59 | /* Values used in sof_ipc_trace_filter_elem */ |
@@ -85,34 +89,37 @@ struct sof_ipc_trace_filter { |
85 | 89 | * Commom debug |
86 | 90 | */ |
87 | 91 |
|
88 | | -/* |
89 | | - * SOF panic codes |
| 92 | +/** \name SOF Panic Codes |
| 93 | + * Firmware panic identifiers written to mailboxes or reported upon crash. |
| 94 | + * @{ |
90 | 95 | */ |
91 | | -#define SOF_IPC_PANIC_MAGIC 0x0dead000 |
92 | | -#define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000 |
93 | | -#define SOF_IPC_PANIC_CODE_MASK 0x00000fff |
94 | | - |
95 | | -#define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0) |
96 | | -#define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1) |
97 | | -#define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2) |
98 | | -#define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3) |
99 | | -#define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4) |
100 | | -#define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5) |
101 | | -#define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6) |
102 | | -#define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7) |
103 | | -#define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8) |
104 | | -#define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9) |
105 | | -#define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa) |
106 | | -#define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb) |
107 | | - |
108 | | -/* panic info include filename and line number |
109 | | - * filename array will not include null terminator if fully filled |
| 96 | +#define SOF_IPC_PANIC_MAGIC 0x0dead000 /**< Magic pattern identifying valid panic packet */ |
| 97 | +#define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000 /**< Mask isolating panic magic pattern */ |
| 98 | +#define SOF_IPC_PANIC_CODE_MASK 0x00000fff /**< Mask isolating specific panic category */ |
| 99 | + |
| 100 | +#define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0) /**< Memory allocation exhaustion panic */ |
| 101 | +#define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1) /**< Scheduling task failure panic */ |
| 102 | +#define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2) /**< Host IPC transport failure panic */ |
| 103 | +#define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3) /**< Architecture exception panic */ |
| 104 | +#define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4) /**< Platform device driver panic */ |
| 105 | +#define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5) /**< Real-time task deadline panic */ |
| 106 | +#define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6) /**< Unhandled CPU exception panic */ |
| 107 | +#define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7) /**< Multicore spinlock deadlock panic */ |
| 108 | +#define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8) /**< Stack guard overflow panic */ |
| 109 | +#define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9) /**< Idle power state transition panic */ |
| 110 | +#define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa) /**< Wait-For-Interrupt lockup panic */ |
| 111 | +#define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb) /**< Assertion failure panic */ |
| 112 | +/** @} */ |
| 113 | + |
| 114 | +/** |
| 115 | + * \brief DSP panic crash dump descriptor reported to host. |
| 116 | + * \ingroup trace_logging_api |
110 | 117 | */ |
111 | 118 | struct sof_ipc_panic_info { |
112 | | - struct sof_ipc_hdr hdr; |
113 | | - uint32_t code; /* SOF_IPC_PANIC_ */ |
114 | | - char filename[SOF_TRACE_FILENAME_SIZE]; |
115 | | - uint32_t linenum; |
| 119 | + struct sof_ipc_hdr hdr; /**< IPC base header */ |
| 120 | + uint32_t code; /**< Panic classification code (SOF_IPC_PANIC_*) */ |
| 121 | + char filename[SOF_TRACE_FILENAME_SIZE]; /**< Source filename where panic occurred */ |
| 122 | + uint32_t linenum; /**< Source line number where panic occurred */ |
116 | 123 | } __attribute__((packed, aligned(4))); |
117 | 124 |
|
118 | 125 | #endif /* __IPC_TRACE_H__ */ |
0 commit comments