xref: /kernel/linux/linux-6.6/include/sound/sof/info.h (revision 62306a36)
162306a36Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
462306a36Sopenharmony_ci * redistributing this file, you may do so under either license.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright(c) 2018 Intel Corporation. All rights reserved.
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __INCLUDE_SOUND_SOF_INFO_H__
1062306a36Sopenharmony_ci#define __INCLUDE_SOUND_SOF_INFO_H__
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <sound/sof/header.h>
1362306a36Sopenharmony_ci#include <sound/sof/stream.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/*
1662306a36Sopenharmony_ci * Firmware boot and version
1762306a36Sopenharmony_ci */
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define SOF_IPC_MAX_ELEMS	16
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/*
2262306a36Sopenharmony_ci * Firmware boot info flag bits (64-bit)
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci#define SOF_IPC_INFO_BUILD		BIT(0)
2562306a36Sopenharmony_ci#define SOF_IPC_INFO_LOCKS		BIT(1)
2662306a36Sopenharmony_ci#define SOF_IPC_INFO_LOCKSV		BIT(2)
2762306a36Sopenharmony_ci#define SOF_IPC_INFO_GDB		BIT(3)
2862306a36Sopenharmony_ci#define SOF_IPC_INFO_D3_PERSISTENT	BIT(4)
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/* extended data types that can be appended onto end of sof_ipc_fw_ready */
3162306a36Sopenharmony_cienum sof_ipc_ext_data {
3262306a36Sopenharmony_ci	SOF_IPC_EXT_UNUSED		= 0,
3362306a36Sopenharmony_ci	SOF_IPC_EXT_WINDOW		= 1,
3462306a36Sopenharmony_ci	SOF_IPC_EXT_CC_INFO		= 2,
3562306a36Sopenharmony_ci	SOF_IPC_EXT_PROBE_INFO		= 3,
3662306a36Sopenharmony_ci	SOF_IPC_EXT_USER_ABI_INFO	= 4,
3762306a36Sopenharmony_ci};
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* Build u32 number in format MMmmmppp */
4062306a36Sopenharmony_ci#define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
4162306a36Sopenharmony_ci	((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/* FW version - SOF_IPC_GLB_VERSION */
4462306a36Sopenharmony_cistruct sof_ipc_fw_version {
4562306a36Sopenharmony_ci	struct sof_ipc_hdr hdr;
4662306a36Sopenharmony_ci	uint16_t major;
4762306a36Sopenharmony_ci	uint16_t minor;
4862306a36Sopenharmony_ci	uint16_t micro;
4962306a36Sopenharmony_ci	uint16_t build;
5062306a36Sopenharmony_ci	uint8_t date[12];
5162306a36Sopenharmony_ci	uint8_t time[10];
5262306a36Sopenharmony_ci	uint8_t tag[6];
5362306a36Sopenharmony_ci	uint32_t abi_version;
5462306a36Sopenharmony_ci	/* used to check FW and ldc file compatibility, reproducible value */
5562306a36Sopenharmony_ci	uint32_t src_hash;
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	/* reserved for future use */
5862306a36Sopenharmony_ci	uint32_t reserved[3];
5962306a36Sopenharmony_ci} __packed;
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci/* FW ready Message - sent by firmware when boot has completed */
6262306a36Sopenharmony_cistruct sof_ipc_fw_ready {
6362306a36Sopenharmony_ci	struct sof_ipc_cmd_hdr hdr;
6462306a36Sopenharmony_ci	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
6562306a36Sopenharmony_ci	uint32_t hostbox_offset; /* host initiated IPC mailbox */
6662306a36Sopenharmony_ci	uint32_t dspbox_size;
6762306a36Sopenharmony_ci	uint32_t hostbox_size;
6862306a36Sopenharmony_ci	struct sof_ipc_fw_version version;
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci	/* Miscellaneous flags */
7162306a36Sopenharmony_ci	uint64_t flags;
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci	/* reserved for future use */
7462306a36Sopenharmony_ci	uint32_t reserved[4];
7562306a36Sopenharmony_ci} __packed;
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci/*
7862306a36Sopenharmony_ci * Extended Firmware data. All optional, depends on platform/arch.
7962306a36Sopenharmony_ci */
8062306a36Sopenharmony_cienum sof_ipc_region {
8162306a36Sopenharmony_ci	SOF_IPC_REGION_DOWNBOX	= 0,
8262306a36Sopenharmony_ci	SOF_IPC_REGION_UPBOX,
8362306a36Sopenharmony_ci	SOF_IPC_REGION_TRACE,
8462306a36Sopenharmony_ci	SOF_IPC_REGION_DEBUG,
8562306a36Sopenharmony_ci	SOF_IPC_REGION_STREAM,
8662306a36Sopenharmony_ci	SOF_IPC_REGION_REGS,
8762306a36Sopenharmony_ci	SOF_IPC_REGION_EXCEPTION,
8862306a36Sopenharmony_ci};
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_cistruct sof_ipc_ext_data_hdr {
9162306a36Sopenharmony_ci	struct sof_ipc_cmd_hdr hdr;
9262306a36Sopenharmony_ci	uint32_t type;		/**< SOF_IPC_EXT_ */
9362306a36Sopenharmony_ci} __packed;
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_cistruct sof_ipc_window_elem {
9662306a36Sopenharmony_ci	struct sof_ipc_hdr hdr;
9762306a36Sopenharmony_ci	uint32_t type;		/**< SOF_IPC_REGION_ */
9862306a36Sopenharmony_ci	uint32_t id;		/**< platform specific - used to map to host memory */
9962306a36Sopenharmony_ci	uint32_t flags;		/**< R, W, RW, etc - to define */
10062306a36Sopenharmony_ci	uint32_t size;		/**< size of region in bytes */
10162306a36Sopenharmony_ci	/* offset in window region as windows can be partitioned */
10262306a36Sopenharmony_ci	uint32_t offset;
10362306a36Sopenharmony_ci} __packed;
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci/* extended data memory windows for IPC, trace and debug */
10662306a36Sopenharmony_cistruct sof_ipc_window {
10762306a36Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
10862306a36Sopenharmony_ci	uint32_t num_windows;
10962306a36Sopenharmony_ci	struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
11062306a36Sopenharmony_ci}  __packed;
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_cistruct sof_ipc_cc_version {
11362306a36Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
11462306a36Sopenharmony_ci	uint32_t major;
11562306a36Sopenharmony_ci	uint32_t minor;
11662306a36Sopenharmony_ci	uint32_t micro;
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci	/* reserved for future use */
11962306a36Sopenharmony_ci	uint32_t reserved[4];
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci	uint8_t name[16]; /* null terminated compiler name */
12262306a36Sopenharmony_ci	uint8_t optim[4]; /* null terminated compiler -O flag value */
12362306a36Sopenharmony_ci	uint8_t desc[32]; /* null terminated compiler description */
12462306a36Sopenharmony_ci} __packed;
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci/* extended data: Probe setup */
12762306a36Sopenharmony_cistruct sof_ipc_probe_support {
12862306a36Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci	uint32_t probe_points_max;
13162306a36Sopenharmony_ci	uint32_t injection_dmas_max;
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci	/* reserved for future use */
13462306a36Sopenharmony_ci	uint32_t reserved[2];
13562306a36Sopenharmony_ci} __packed;
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci/* extended data: user abi version(s) */
13862306a36Sopenharmony_cistruct sof_ipc_user_abi_version {
13962306a36Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci	uint32_t abi_dbg_version;
14262306a36Sopenharmony_ci}  __packed;
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci#endif
145