Linux Audio

Check our new training course

Loading...
v6.2
  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#define SOF_IPC_INFO_D3_PERSISTENT	BIT(4)
 29
 30/* extended data types that can be appended onto end of sof_ipc_fw_ready */
 31enum sof_ipc_ext_data {
 32	SOF_IPC_EXT_UNUSED		= 0,
 33	SOF_IPC_EXT_WINDOW		= 1,
 34	SOF_IPC_EXT_CC_INFO		= 2,
 35	SOF_IPC_EXT_PROBE_INFO		= 3,
 36	SOF_IPC_EXT_USER_ABI_INFO	= 4,
 37};
 38
 39/* Build u32 number in format MMmmmppp */
 40#define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
 41	((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))
 42
 43/* FW version - SOF_IPC_GLB_VERSION */
 44struct sof_ipc_fw_version {
 45	struct sof_ipc_hdr hdr;
 46	uint16_t major;
 47	uint16_t minor;
 48	uint16_t micro;
 49	uint16_t build;
 50	uint8_t date[12];
 51	uint8_t time[10];
 52	uint8_t tag[6];
 53	uint32_t abi_version;
 54	/* used to check FW and ldc file compatibility, reproducible value */
 55	uint32_t src_hash;
 56
 57	/* reserved for future use */
 58	uint32_t reserved[3];
 59} __packed;
 60
 61/* FW ready Message - sent by firmware when boot has completed */
 62struct sof_ipc_fw_ready {
 63	struct sof_ipc_cmd_hdr hdr;
 64	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
 65	uint32_t hostbox_offset; /* host initiated IPC mailbox */
 66	uint32_t dspbox_size;
 67	uint32_t hostbox_size;
 68	struct sof_ipc_fw_version version;
 69
 70	/* Miscellaneous flags */
 71	uint64_t flags;
 72
 73	/* reserved for future use */
 74	uint32_t reserved[4];
 75} __packed;
 76
 77/*
 78 * Extended Firmware data. All optional, depends on platform/arch.
 79 */
 80enum sof_ipc_region {
 81	SOF_IPC_REGION_DOWNBOX	= 0,
 82	SOF_IPC_REGION_UPBOX,
 83	SOF_IPC_REGION_TRACE,
 84	SOF_IPC_REGION_DEBUG,
 85	SOF_IPC_REGION_STREAM,
 86	SOF_IPC_REGION_REGS,
 87	SOF_IPC_REGION_EXCEPTION,
 88};
 89
 90struct sof_ipc_ext_data_hdr {
 91	struct sof_ipc_cmd_hdr hdr;
 92	uint32_t type;		/**< SOF_IPC_EXT_ */
 93} __packed;
 94
 95struct sof_ipc_window_elem {
 96	struct sof_ipc_hdr hdr;
 97	uint32_t type;		/**< SOF_IPC_REGION_ */
 98	uint32_t id;		/**< platform specific - used to map to host memory */
 99	uint32_t flags;		/**< R, W, RW, etc - to define */
100	uint32_t size;		/**< size of region in bytes */
101	/* offset in window region as windows can be partitioned */
102	uint32_t offset;
103} __packed;
104
105/* extended data memory windows for IPC, trace and debug */
106struct sof_ipc_window {
107	struct sof_ipc_ext_data_hdr ext_hdr;
108	uint32_t num_windows;
109	struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
110}  __packed;
111
112struct sof_ipc_cc_version {
113	struct sof_ipc_ext_data_hdr ext_hdr;
114	uint32_t major;
115	uint32_t minor;
116	uint32_t micro;
117
118	/* reserved for future use */
119	uint32_t reserved[4];
120
121	uint8_t name[16]; /* null terminated compiler name */
122	uint8_t optim[4]; /* null terminated compiler -O flag value */
123	uint8_t desc[32]; /* null terminated compiler description */
124} __packed;
125
126/* extended data: Probe setup */
127struct sof_ipc_probe_support {
128	struct sof_ipc_ext_data_hdr ext_hdr;
129
130	uint32_t probe_points_max;
131	uint32_t injection_dmas_max;
132
133	/* reserved for future use */
134	uint32_t reserved[2];
135} __packed;
136
137/* extended data: user abi version(s) */
138struct sof_ipc_user_abi_version {
139	struct sof_ipc_ext_data_hdr ext_hdr;
140
141	uint32_t abi_dbg_version;
142}  __packed;
143
144#endif
v5.14.15
  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 */
 30enum 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 */
 39struct 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	/* used to check FW and ldc file compatibility, reproducible value */
 50	uint32_t src_hash;
 51
 52	/* reserved for future use */
 53	uint32_t reserved[3];
 54} __packed;
 55
 56/* FW ready Message - sent by firmware when boot has completed */
 57struct sof_ipc_fw_ready {
 58	struct sof_ipc_cmd_hdr hdr;
 59	uint32_t dspbox_offset;	 /* dsp initiated IPC mailbox */
 60	uint32_t hostbox_offset; /* host initiated IPC mailbox */
 61	uint32_t dspbox_size;
 62	uint32_t hostbox_size;
 63	struct sof_ipc_fw_version version;
 64
 65	/* Miscellaneous flags */
 66	uint64_t flags;
 67
 68	/* reserved for future use */
 69	uint32_t reserved[4];
 70} __packed;
 71
 72/*
 73 * Extended Firmware data. All optional, depends on platform/arch.
 74 */
 75enum sof_ipc_region {
 76	SOF_IPC_REGION_DOWNBOX	= 0,
 77	SOF_IPC_REGION_UPBOX,
 78	SOF_IPC_REGION_TRACE,
 79	SOF_IPC_REGION_DEBUG,
 80	SOF_IPC_REGION_STREAM,
 81	SOF_IPC_REGION_REGS,
 82	SOF_IPC_REGION_EXCEPTION,
 83};
 84
 85struct sof_ipc_ext_data_hdr {
 86	struct sof_ipc_cmd_hdr hdr;
 87	uint32_t type;		/**< SOF_IPC_EXT_ */
 88} __packed;
 89
 90struct sof_ipc_window_elem {
 91	struct sof_ipc_hdr hdr;
 92	uint32_t type;		/**< SOF_IPC_REGION_ */
 93	uint32_t id;		/**< platform specific - used to map to host memory */
 94	uint32_t flags;		/**< R, W, RW, etc - to define */
 95	uint32_t size;		/**< size of region in bytes */
 96	/* offset in window region as windows can be partitioned */
 97	uint32_t offset;
 98} __packed;
 99
100/* extended data memory windows for IPC, trace and debug */
101struct sof_ipc_window {
102	struct sof_ipc_ext_data_hdr ext_hdr;
103	uint32_t num_windows;
104	struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
105}  __packed;
106
107struct sof_ipc_cc_version {
108	struct sof_ipc_ext_data_hdr ext_hdr;
109	uint32_t major;
110	uint32_t minor;
111	uint32_t micro;
112
113	/* reserved for future use */
114	uint32_t reserved[4];
115
116	uint8_t name[16]; /* null terminated compiler name */
117	uint8_t optim[4]; /* null terminated compiler -O flag value */
118	uint8_t desc[32]; /* null terminated compiler description */
119} __packed;
120
121/* extended data: Probe setup */
122struct sof_ipc_probe_support {
123	struct sof_ipc_ext_data_hdr ext_hdr;
124
125	uint32_t probe_points_max;
126	uint32_t injection_dmas_max;
127
128	/* reserved for future use */
129	uint32_t reserved[2];
130} __packed;
131
132/* extended data: user abi version(s) */
133struct sof_ipc_user_abi_version {
134	struct sof_ipc_ext_data_hdr ext_hdr;
135
136	uint32_t abi_dbg_version;
137}  __packed;
138
139#endif