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