| 1 |
|
| 2 | |
| 3 | * This file is provided under a dual BSD/GPLv2 license. When using or
|
| 4 | * redistributing this file, you may do so under either license.
|
| 5 | *
|
| 6 | * Copyright(c) 2018 Intel Corporation
|
| 7 |
|
| 8 |
|
| 9 | #ifndef __INCLUDE_SOUND_SOF_TRACE_H__
|
| 10 | #define __INCLUDE_SOUND_SOF_TRACE_H__
|
| 11 |
|
| 12 | #include <sound/sof/header.h>
|
| 13 | #include <sound/sof/stream.h>
|
| 14 |
|
| 15 | |
| 16 | * DMA for Trace
|
| 17 |
|
| 18 |
|
| 19 | #define SOF_TRACE_FILENAME_SIZE 32
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 | struct sof_ipc_dma_trace_params {
|
| 24 | struct sof_ipc_cmd_hdr hdr;
|
| 25 | struct sof_ipc_host_buffer buffer;
|
| 26 | uint32_t stream_tag;
|
| 27 | } __packed;
|
| 28 |
|
| 29 |
|
| 30 | struct sof_ipc_dma_trace_params_ext {
|
| 31 | struct sof_ipc_cmd_hdr hdr;
|
| 32 | struct sof_ipc_host_buffer buffer;
|
| 33 | uint32_t stream_tag;
|
| 34 | uint64_t timestamp_ns;
|
| 35 | uint32_t reserved[8];
|
| 36 | } __packed;
|
| 37 |
|
| 38 |
|
| 39 | struct sof_ipc_dma_trace_posn {
|
| 40 | struct sof_ipc_reply rhdr;
|
| 41 | uint32_t host_offset;
|
| 42 | uint32_t overflow;
|
| 43 | uint32_t messages;
|
| 44 | } __packed;
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 | #define SOF_IPC_TRACE_FILTER_ELEM_SET_LEVEL 0x01
|
| 50 | #define SOF_IPC_TRACE_FILTER_ELEM_BY_UUID 0x02
|
| 51 | #define SOF_IPC_TRACE_FILTER_ELEM_BY_PIPE 0x03
|
| 52 | #define SOF_IPC_TRACE_FILTER_ELEM_BY_COMP 0x04
|
| 53 |
|
| 54 |
|
| 55 | #define SOF_IPC_TRACE_FILTER_ELEM_FIN 0x80
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 | struct sof_ipc_trace_filter_elem {
|
| 61 | uint32_t key;
|
| 62 | uint32_t value;
|
| 63 | } __packed;
|
| 64 |
|
| 65 |
|
| 66 | struct sof_ipc_trace_filter {
|
| 67 | struct sof_ipc_cmd_hdr hdr;
|
| 68 | uint32_t elem_cnt;
|
| 69 | uint32_t reserved[8];
|
| 70 |
|
| 71 | struct sof_ipc_trace_filter_elem elems[];
|
| 72 | } __packed;
|
| 73 |
|
| 74 | |
| 75 | * Commom debug
|
| 76 |
|
| 77 |
|
| 78 | |
| 79 | * SOF panic codes
|
| 80 |
|
| 81 | #define SOF_IPC_PANIC_MAGIC 0x0dead000
|
| 82 | #define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000
|
| 83 | #define SOF_IPC_PANIC_CODE_MASK 0x00000fff
|
| 84 | #define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0)
|
| 85 | #define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1)
|
| 86 | #define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2)
|
| 87 | #define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3)
|
| 88 | #define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4)
|
| 89 | #define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5)
|
| 90 | #define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6)
|
| 91 | #define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7)
|
| 92 | #define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8)
|
| 93 | #define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9)
|
| 94 | #define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa)
|
| 95 | #define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb)
|
| 96 |
|
| 97 | |
| 98 | * filename array will not include null terminator if fully filled
|
| 99 |
|
| 100 | struct sof_ipc_panic_info {
|
| 101 | struct sof_ipc_hdr hdr;
|
| 102 | uint32_t code;
|
| 103 | uint8_t filename[SOF_TRACE_FILENAME_SIZE];
|
| 104 | uint32_t linenum;
|
| 105 | } __packed;
|
| 106 |
|
| 107 | #endif
|