xref: /linux-6.15/include/sound/sof/info.h (revision ea89a742)
1e149ca29SPierre-Louis Bossart /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
253e0c72dSLiam Girdwood /*
353e0c72dSLiam Girdwood  * This file is provided under a dual BSD/GPLv2 license.  When using or
453e0c72dSLiam Girdwood  * redistributing this file, you may do so under either license.
553e0c72dSLiam Girdwood  *
6*ea89a742SPierre-Louis Bossart  * Copyright(c) 2018 Intel Corporation
753e0c72dSLiam Girdwood  */
853e0c72dSLiam Girdwood 
953e0c72dSLiam Girdwood #ifndef __INCLUDE_SOUND_SOF_INFO_H__
1053e0c72dSLiam Girdwood #define __INCLUDE_SOUND_SOF_INFO_H__
1153e0c72dSLiam Girdwood 
1253e0c72dSLiam Girdwood #include <sound/sof/header.h>
1353e0c72dSLiam Girdwood #include <sound/sof/stream.h>
1453e0c72dSLiam Girdwood 
1553e0c72dSLiam Girdwood /*
1653e0c72dSLiam Girdwood  * Firmware boot and version
1753e0c72dSLiam Girdwood  */
1853e0c72dSLiam Girdwood 
1953e0c72dSLiam Girdwood #define SOF_IPC_MAX_ELEMS	16
2053e0c72dSLiam Girdwood 
21347d1c4bSSlawomir Blauciak /*
22347d1c4bSSlawomir Blauciak  * Firmware boot info flag bits (64-bit)
23347d1c4bSSlawomir Blauciak  */
24347d1c4bSSlawomir Blauciak #define SOF_IPC_INFO_BUILD		BIT(0)
25347d1c4bSSlawomir Blauciak #define SOF_IPC_INFO_LOCKS		BIT(1)
26347d1c4bSSlawomir Blauciak #define SOF_IPC_INFO_LOCKSV		BIT(2)
27347d1c4bSSlawomir Blauciak #define SOF_IPC_INFO_GDB		BIT(3)
281dafede3SKeyon Jie #define SOF_IPC_INFO_D3_PERSISTENT	BIT(4)
29347d1c4bSSlawomir Blauciak 
3053e0c72dSLiam Girdwood /* extended data types that can be appended onto end of sof_ipc_fw_ready */
3153e0c72dSLiam Girdwood enum sof_ipc_ext_data {
32a6096f88SKarol Trzcinski 	SOF_IPC_EXT_UNUSED		= 0,
334ea25785SKarol Trzcinski 	SOF_IPC_EXT_WINDOW		= 1,
344ea25785SKarol Trzcinski 	SOF_IPC_EXT_CC_INFO		= 2,
35786d6516SPan Xiuli 	SOF_IPC_EXT_PROBE_INFO		= 3,
362014185eSPan Xiuli 	SOF_IPC_EXT_USER_ABI_INFO	= 4,
3753e0c72dSLiam Girdwood };
3853e0c72dSLiam Girdwood 
39003b786bSKai Vehmanen /* Build u32 number in format MMmmmppp */
40003b786bSKai Vehmanen #define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
41003b786bSKai Vehmanen 	((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))
42003b786bSKai Vehmanen 
4353e0c72dSLiam Girdwood /* FW version - SOF_IPC_GLB_VERSION */
4453e0c72dSLiam Girdwood struct sof_ipc_fw_version {
4553e0c72dSLiam Girdwood 	struct sof_ipc_hdr hdr;
4653e0c72dSLiam Girdwood 	uint16_t major;
4753e0c72dSLiam Girdwood 	uint16_t minor;
4853e0c72dSLiam Girdwood 	uint16_t micro;
4953e0c72dSLiam Girdwood 	uint16_t build;
5053e0c72dSLiam Girdwood 	uint8_t date[12];
5153e0c72dSLiam Girdwood 	uint8_t time[10];
5253e0c72dSLiam Girdwood 	uint8_t tag[6];
5353e0c72dSLiam Girdwood 	uint32_t abi_version;
546eab7714SKarol Trzcinski 	/* used to check FW and ldc file compatibility, reproducible value */
556eab7714SKarol Trzcinski 	uint32_t src_hash;
5653e0c72dSLiam Girdwood 
5753e0c72dSLiam Girdwood 	/* reserved for future use */
586eab7714SKarol Trzcinski 	uint32_t reserved[3];
5953e0c72dSLiam Girdwood } __packed;
6053e0c72dSLiam Girdwood 
6153e0c72dSLiam Girdwood /* FW ready Message - sent by firmware when boot has completed */
6253e0c72dSLiam Girdwood struct sof_ipc_fw_ready {
6353e0c72dSLiam Girdwood 	struct sof_ipc_cmd_hdr hdr;
6453e0c72dSLiam Girdwood 	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
6553e0c72dSLiam Girdwood 	uint32_t hostbox_offset; /* host initiated IPC mailbox */
6653e0c72dSLiam Girdwood 	uint32_t dspbox_size;
6753e0c72dSLiam Girdwood 	uint32_t hostbox_size;
6853e0c72dSLiam Girdwood 	struct sof_ipc_fw_version version;
6953e0c72dSLiam Girdwood 
70347d1c4bSSlawomir Blauciak 	/* Miscellaneous flags */
71347d1c4bSSlawomir Blauciak 	uint64_t flags;
7253e0c72dSLiam Girdwood 
7353e0c72dSLiam Girdwood 	/* reserved for future use */
7453e0c72dSLiam Girdwood 	uint32_t reserved[4];
7553e0c72dSLiam Girdwood } __packed;
7653e0c72dSLiam Girdwood 
7753e0c72dSLiam Girdwood /*
7853e0c72dSLiam Girdwood  * Extended Firmware data. All optional, depends on platform/arch.
7953e0c72dSLiam Girdwood  */
8053e0c72dSLiam Girdwood enum sof_ipc_region {
8153e0c72dSLiam Girdwood 	SOF_IPC_REGION_DOWNBOX	= 0,
8253e0c72dSLiam Girdwood 	SOF_IPC_REGION_UPBOX,
8353e0c72dSLiam Girdwood 	SOF_IPC_REGION_TRACE,
8453e0c72dSLiam Girdwood 	SOF_IPC_REGION_DEBUG,
8553e0c72dSLiam Girdwood 	SOF_IPC_REGION_STREAM,
8653e0c72dSLiam Girdwood 	SOF_IPC_REGION_REGS,
8753e0c72dSLiam Girdwood 	SOF_IPC_REGION_EXCEPTION,
8853e0c72dSLiam Girdwood };
8953e0c72dSLiam Girdwood 
9053e0c72dSLiam Girdwood struct sof_ipc_ext_data_hdr {
9153e0c72dSLiam Girdwood 	struct sof_ipc_cmd_hdr hdr;
9253e0c72dSLiam Girdwood 	uint32_t type;		/**< SOF_IPC_EXT_ */
9353e0c72dSLiam Girdwood } __packed;
9453e0c72dSLiam Girdwood 
9553e0c72dSLiam Girdwood struct sof_ipc_window_elem {
9653e0c72dSLiam Girdwood 	struct sof_ipc_hdr hdr;
9753e0c72dSLiam Girdwood 	uint32_t type;		/**< SOF_IPC_REGION_ */
9853e0c72dSLiam Girdwood 	uint32_t id;		/**< platform specific - used to map to host memory */
9953e0c72dSLiam Girdwood 	uint32_t flags;		/**< R, W, RW, etc - to define */
10053e0c72dSLiam Girdwood 	uint32_t size;		/**< size of region in bytes */
10153e0c72dSLiam Girdwood 	/* offset in window region as windows can be partitioned */
10253e0c72dSLiam Girdwood 	uint32_t offset;
10353e0c72dSLiam Girdwood } __packed;
10453e0c72dSLiam Girdwood 
10553e0c72dSLiam Girdwood /* extended data memory windows for IPC, trace and debug */
10653e0c72dSLiam Girdwood struct sof_ipc_window {
10753e0c72dSLiam Girdwood 	struct sof_ipc_ext_data_hdr ext_hdr;
10853e0c72dSLiam Girdwood 	uint32_t num_windows;
10976ab546cSKarol Trzcinski 	struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
11053e0c72dSLiam Girdwood }  __packed;
11153e0c72dSLiam Girdwood 
112e8b7cab8SKarol Trzcinski struct sof_ipc_cc_version {
113e8b7cab8SKarol Trzcinski 	struct sof_ipc_ext_data_hdr ext_hdr;
114e8b7cab8SKarol Trzcinski 	uint32_t major;
115e8b7cab8SKarol Trzcinski 	uint32_t minor;
116e8b7cab8SKarol Trzcinski 	uint32_t micro;
117e8b7cab8SKarol Trzcinski 
118e8b7cab8SKarol Trzcinski 	/* reserved for future use */
119e8b7cab8SKarol Trzcinski 	uint32_t reserved[4];
120e8b7cab8SKarol Trzcinski 
121e6224484SPan Xiuli 	uint8_t name[16]; /* null terminated compiler name */
122e6224484SPan Xiuli 	uint8_t optim[4]; /* null terminated compiler -O flag value */
123a9a9cbf0SPan Xiuli 	uint8_t desc[32]; /* null terminated compiler description */
124e8b7cab8SKarol Trzcinski } __packed;
125e8b7cab8SKarol Trzcinski 
126786d6516SPan Xiuli /* extended data: Probe setup */
127786d6516SPan Xiuli struct sof_ipc_probe_support {
128786d6516SPan Xiuli 	struct sof_ipc_ext_data_hdr ext_hdr;
129786d6516SPan Xiuli 
130786d6516SPan Xiuli 	uint32_t probe_points_max;
131786d6516SPan Xiuli 	uint32_t injection_dmas_max;
132786d6516SPan Xiuli 
133786d6516SPan Xiuli 	/* reserved for future use */
134786d6516SPan Xiuli 	uint32_t reserved[2];
135786d6516SPan Xiuli } __packed;
136786d6516SPan Xiuli 
1372014185eSPan Xiuli /* extended data: user abi version(s) */
1382014185eSPan Xiuli struct sof_ipc_user_abi_version {
1392014185eSPan Xiuli 	struct sof_ipc_ext_data_hdr ext_hdr;
1402014185eSPan Xiuli 
1412014185eSPan Xiuli 	uint32_t abi_dbg_version;
1422014185eSPan Xiuli }  __packed;
1432014185eSPan Xiuli 
14453e0c72dSLiam Girdwood #endif
145