18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
48c2ecf20Sopenharmony_ci * redistributing this file, you may do so under either license.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright(c) 2018 Intel Corporation. All rights reserved.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __INCLUDE_SOUND_SOF_INFO_H__
108c2ecf20Sopenharmony_ci#define __INCLUDE_SOUND_SOF_INFO_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <sound/sof/header.h>
138c2ecf20Sopenharmony_ci#include <sound/sof/stream.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/*
168c2ecf20Sopenharmony_ci * Firmware boot and version
178c2ecf20Sopenharmony_ci */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define SOF_IPC_MAX_ELEMS	16
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci * Firmware boot info flag bits (64-bit)
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci#define SOF_IPC_INFO_BUILD		BIT(0)
258c2ecf20Sopenharmony_ci#define SOF_IPC_INFO_LOCKS		BIT(1)
268c2ecf20Sopenharmony_ci#define SOF_IPC_INFO_LOCKSV		BIT(2)
278c2ecf20Sopenharmony_ci#define SOF_IPC_INFO_GDB		BIT(3)
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* extended data types that can be appended onto end of sof_ipc_fw_ready */
308c2ecf20Sopenharmony_cienum sof_ipc_ext_data {
318c2ecf20Sopenharmony_ci	SOF_IPC_EXT_UNUSED		= 0,
328c2ecf20Sopenharmony_ci	SOF_IPC_EXT_WINDOW		= 1,
338c2ecf20Sopenharmony_ci	SOF_IPC_EXT_CC_INFO		= 2,
348c2ecf20Sopenharmony_ci	SOF_IPC_EXT_PROBE_INFO		= 3,
358c2ecf20Sopenharmony_ci	SOF_IPC_EXT_USER_ABI_INFO	= 4,
368c2ecf20Sopenharmony_ci};
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/* FW version - SOF_IPC_GLB_VERSION */
398c2ecf20Sopenharmony_cistruct sof_ipc_fw_version {
408c2ecf20Sopenharmony_ci	struct sof_ipc_hdr hdr;
418c2ecf20Sopenharmony_ci	uint16_t major;
428c2ecf20Sopenharmony_ci	uint16_t minor;
438c2ecf20Sopenharmony_ci	uint16_t micro;
448c2ecf20Sopenharmony_ci	uint16_t build;
458c2ecf20Sopenharmony_ci	uint8_t date[12];
468c2ecf20Sopenharmony_ci	uint8_t time[10];
478c2ecf20Sopenharmony_ci	uint8_t tag[6];
488c2ecf20Sopenharmony_ci	uint32_t abi_version;
498c2ecf20Sopenharmony_ci	/* used to check FW and ldc file compatibility, reproducible value */
508c2ecf20Sopenharmony_ci	uint32_t src_hash;
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci	/* reserved for future use */
538c2ecf20Sopenharmony_ci	uint32_t reserved[3];
548c2ecf20Sopenharmony_ci} __packed;
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* FW ready Message - sent by firmware when boot has completed */
578c2ecf20Sopenharmony_cistruct sof_ipc_fw_ready {
588c2ecf20Sopenharmony_ci	struct sof_ipc_cmd_hdr hdr;
598c2ecf20Sopenharmony_ci	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
608c2ecf20Sopenharmony_ci	uint32_t hostbox_offset; /* host initiated IPC mailbox */
618c2ecf20Sopenharmony_ci	uint32_t dspbox_size;
628c2ecf20Sopenharmony_ci	uint32_t hostbox_size;
638c2ecf20Sopenharmony_ci	struct sof_ipc_fw_version version;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	/* Miscellaneous flags */
668c2ecf20Sopenharmony_ci	uint64_t flags;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci	/* reserved for future use */
698c2ecf20Sopenharmony_ci	uint32_t reserved[4];
708c2ecf20Sopenharmony_ci} __packed;
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci/*
738c2ecf20Sopenharmony_ci * Extended Firmware data. All optional, depends on platform/arch.
748c2ecf20Sopenharmony_ci */
758c2ecf20Sopenharmony_cienum sof_ipc_region {
768c2ecf20Sopenharmony_ci	SOF_IPC_REGION_DOWNBOX	= 0,
778c2ecf20Sopenharmony_ci	SOF_IPC_REGION_UPBOX,
788c2ecf20Sopenharmony_ci	SOF_IPC_REGION_TRACE,
798c2ecf20Sopenharmony_ci	SOF_IPC_REGION_DEBUG,
808c2ecf20Sopenharmony_ci	SOF_IPC_REGION_STREAM,
818c2ecf20Sopenharmony_ci	SOF_IPC_REGION_REGS,
828c2ecf20Sopenharmony_ci	SOF_IPC_REGION_EXCEPTION,
838c2ecf20Sopenharmony_ci};
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_cistruct sof_ipc_ext_data_hdr {
868c2ecf20Sopenharmony_ci	struct sof_ipc_cmd_hdr hdr;
878c2ecf20Sopenharmony_ci	uint32_t type;		/**< SOF_IPC_EXT_ */
888c2ecf20Sopenharmony_ci} __packed;
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_cistruct sof_ipc_window_elem {
918c2ecf20Sopenharmony_ci	struct sof_ipc_hdr hdr;
928c2ecf20Sopenharmony_ci	uint32_t type;		/**< SOF_IPC_REGION_ */
938c2ecf20Sopenharmony_ci	uint32_t id;		/**< platform specific - used to map to host memory */
948c2ecf20Sopenharmony_ci	uint32_t flags;		/**< R, W, RW, etc - to define */
958c2ecf20Sopenharmony_ci	uint32_t size;		/**< size of region in bytes */
968c2ecf20Sopenharmony_ci	/* offset in window region as windows can be partitioned */
978c2ecf20Sopenharmony_ci	uint32_t offset;
988c2ecf20Sopenharmony_ci} __packed;
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/* extended data memory windows for IPC, trace and debug */
1018c2ecf20Sopenharmony_cistruct sof_ipc_window {
1028c2ecf20Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
1038c2ecf20Sopenharmony_ci	uint32_t num_windows;
1048c2ecf20Sopenharmony_ci	struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
1058c2ecf20Sopenharmony_ci}  __packed;
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_cistruct sof_ipc_cc_version {
1088c2ecf20Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
1098c2ecf20Sopenharmony_ci	uint32_t major;
1108c2ecf20Sopenharmony_ci	uint32_t minor;
1118c2ecf20Sopenharmony_ci	uint32_t micro;
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	/* reserved for future use */
1148c2ecf20Sopenharmony_ci	uint32_t reserved[4];
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci	uint8_t name[16]; /* null terminated compiler name */
1178c2ecf20Sopenharmony_ci	uint8_t optim[4]; /* null terminated compiler -O flag value */
1188c2ecf20Sopenharmony_ci	uint8_t desc[32]; /* null terminated compiler description */
1198c2ecf20Sopenharmony_ci} __packed;
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/* extended data: Probe setup */
1228c2ecf20Sopenharmony_cistruct sof_ipc_probe_support {
1238c2ecf20Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	uint32_t probe_points_max;
1268c2ecf20Sopenharmony_ci	uint32_t injection_dmas_max;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci	/* reserved for future use */
1298c2ecf20Sopenharmony_ci	uint32_t reserved[2];
1308c2ecf20Sopenharmony_ci} __packed;
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* extended data: user abi version(s) */
1338c2ecf20Sopenharmony_cistruct sof_ipc_user_abi_version {
1348c2ecf20Sopenharmony_ci	struct sof_ipc_ext_data_hdr ext_hdr;
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci	uint32_t abi_dbg_version;
1378c2ecf20Sopenharmony_ci}  __packed;
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#endif
140