xref: /openbmc/linux/include/sound/sof/info.h (revision 4bb1eb3c)
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
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. All rights reserved.
7  */
8 
9 #ifndef __INCLUDE_SOUND_SOF_INFO_H__
10 #define __INCLUDE_SOUND_SOF_INFO_H__
11 
12 #include <sound/sof/header.h>
13 #include <sound/sof/stream.h>
14 
15 /*
16  * Firmware boot and version
17  */
18 
19 #define SOF_IPC_MAX_ELEMS	16
20 
21 /*
22  * Firmware boot info flag bits (64-bit)
23  */
24 #define SOF_IPC_INFO_BUILD		BIT(0)
25 #define SOF_IPC_INFO_LOCKS		BIT(1)
26 #define SOF_IPC_INFO_LOCKSV		BIT(2)
27 #define SOF_IPC_INFO_GDB		BIT(3)
28 
29 /* extended data types that can be appended onto end of sof_ipc_fw_ready */
30 enum sof_ipc_ext_data {
31 	SOF_IPC_EXT_UNUSED		= 0,
32 	SOF_IPC_EXT_WINDOW		= 1,
33 	SOF_IPC_EXT_CC_INFO		= 2,
34 	SOF_IPC_EXT_PROBE_INFO		= 3,
35 	SOF_IPC_EXT_USER_ABI_INFO	= 4,
36 };
37 
38 /* FW version - SOF_IPC_GLB_VERSION */
39 struct sof_ipc_fw_version {
40 	struct sof_ipc_hdr hdr;
41 	uint16_t major;
42 	uint16_t minor;
43 	uint16_t micro;
44 	uint16_t build;
45 	uint8_t date[12];
46 	uint8_t time[10];
47 	uint8_t tag[6];
48 	uint32_t abi_version;
49 
50 	/* reserved for future use */
51 	uint32_t reserved[4];
52 } __packed;
53 
54 /* FW ready Message - sent by firmware when boot has completed */
55 struct sof_ipc_fw_ready {
56 	struct sof_ipc_cmd_hdr hdr;
57 	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
58 	uint32_t hostbox_offset; /* host initiated IPC mailbox */
59 	uint32_t dspbox_size;
60 	uint32_t hostbox_size;
61 	struct sof_ipc_fw_version version;
62 
63 	/* Miscellaneous flags */
64 	uint64_t flags;
65 
66 	/* reserved for future use */
67 	uint32_t reserved[4];
68 } __packed;
69 
70 /*
71  * Extended Firmware data. All optional, depends on platform/arch.
72  */
73 enum sof_ipc_region {
74 	SOF_IPC_REGION_DOWNBOX	= 0,
75 	SOF_IPC_REGION_UPBOX,
76 	SOF_IPC_REGION_TRACE,
77 	SOF_IPC_REGION_DEBUG,
78 	SOF_IPC_REGION_STREAM,
79 	SOF_IPC_REGION_REGS,
80 	SOF_IPC_REGION_EXCEPTION,
81 };
82 
83 struct sof_ipc_ext_data_hdr {
84 	struct sof_ipc_cmd_hdr hdr;
85 	uint32_t type;		/**< SOF_IPC_EXT_ */
86 } __packed;
87 
88 struct sof_ipc_window_elem {
89 	struct sof_ipc_hdr hdr;
90 	uint32_t type;		/**< SOF_IPC_REGION_ */
91 	uint32_t id;		/**< platform specific - used to map to host memory */
92 	uint32_t flags;		/**< R, W, RW, etc - to define */
93 	uint32_t size;		/**< size of region in bytes */
94 	/* offset in window region as windows can be partitioned */
95 	uint32_t offset;
96 } __packed;
97 
98 /* extended data memory windows for IPC, trace and debug */
99 struct sof_ipc_window {
100 	struct sof_ipc_ext_data_hdr ext_hdr;
101 	uint32_t num_windows;
102 	struct sof_ipc_window_elem window[];
103 }  __packed;
104 
105 struct sof_ipc_cc_version {
106 	struct sof_ipc_ext_data_hdr ext_hdr;
107 	uint32_t major;
108 	uint32_t minor;
109 	uint32_t micro;
110 
111 	/* reserved for future use */
112 	uint32_t reserved[4];
113 
114 	uint8_t name[16]; /* null terminated compiler name */
115 	uint8_t optim[4]; /* null terminated compiler -O flag value */
116 	uint8_t desc[32]; /* null terminated compiler description */
117 } __packed;
118 
119 /* extended data: Probe setup */
120 struct sof_ipc_probe_support {
121 	struct sof_ipc_ext_data_hdr ext_hdr;
122 
123 	uint32_t probe_points_max;
124 	uint32_t injection_dmas_max;
125 
126 	/* reserved for future use */
127 	uint32_t reserved[2];
128 } __packed;
129 
130 /* extended data: user abi version(s) */
131 struct sof_ipc_user_abi_version {
132 	struct sof_ipc_ext_data_hdr ext_hdr;
133 
134 	uint32_t abi_dbg_version;
135 }  __packed;
136 
137 #endif
138