1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
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.
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
9 #ifndef __INCLUDE_SOUND_SOF_TRACE_H__
10 #define __INCLUDE_SOUND_SOF_TRACE_H__
12 #include <sound/sof/header.h>
13 #include <sound/sof/stream.h>
19 #define SOF_TRACE_FILENAME_SIZE 32
21 /* DMA for Trace params info - SOF_IPC_DEBUG_DMA_PARAMS */
22 struct sof_ipc_dma_trace_params {
23 struct sof_ipc_cmd_hdr hdr;
24 struct sof_ipc_host_buffer buffer;
28 /* DMA for Trace params info - SOF_IPC_DEBUG_DMA_PARAMS */
29 struct sof_ipc_dma_trace_posn {
30 struct sof_ipc_reply rhdr;
31 uint32_t host_offset; /* Offset of DMA host buffer */
32 uint32_t overflow; /* overflow bytes if any */
33 uint32_t messages; /* total trace messages */
43 #define SOF_IPC_PANIC_MAGIC 0x0dead000
44 #define SOF_IPC_PANIC_MAGIC_MASK 0x0ffff000
45 #define SOF_IPC_PANIC_CODE_MASK 0x00000fff
46 #define SOF_IPC_PANIC_MEM (SOF_IPC_PANIC_MAGIC | 0x0)
47 #define SOF_IPC_PANIC_WORK (SOF_IPC_PANIC_MAGIC | 0x1)
48 #define SOF_IPC_PANIC_IPC (SOF_IPC_PANIC_MAGIC | 0x2)
49 #define SOF_IPC_PANIC_ARCH (SOF_IPC_PANIC_MAGIC | 0x3)
50 #define SOF_IPC_PANIC_PLATFORM (SOF_IPC_PANIC_MAGIC | 0x4)
51 #define SOF_IPC_PANIC_TASK (SOF_IPC_PANIC_MAGIC | 0x5)
52 #define SOF_IPC_PANIC_EXCEPTION (SOF_IPC_PANIC_MAGIC | 0x6)
53 #define SOF_IPC_PANIC_DEADLOCK (SOF_IPC_PANIC_MAGIC | 0x7)
54 #define SOF_IPC_PANIC_STACK (SOF_IPC_PANIC_MAGIC | 0x8)
55 #define SOF_IPC_PANIC_IDLE (SOF_IPC_PANIC_MAGIC | 0x9)
56 #define SOF_IPC_PANIC_WFI (SOF_IPC_PANIC_MAGIC | 0xa)
57 #define SOF_IPC_PANIC_ASSERT (SOF_IPC_PANIC_MAGIC | 0xb)
59 /* panic info include filename and line number */
60 struct sof_ipc_panic_info {
61 struct sof_ipc_hdr hdr;
62 uint32_t code; /* SOF_IPC_PANIC_ */
63 char filename[SOF_TRACE_FILENAME_SIZE];