Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
0002 /*
0003  * This file is provided under a dual BSD/GPLv2 license.  When using or
0004  * redistributing this file, you may do so under either license.
0005  *
0006  * Copyright(c) 2018 Intel Corporation. All rights reserved.
0007  */
0008 
0009 #ifndef __INCLUDE_SOUND_SOF_INFO_H__
0010 #define __INCLUDE_SOUND_SOF_INFO_H__
0011 
0012 #include <sound/sof/header.h>
0013 #include <sound/sof/stream.h>
0014 
0015 /*
0016  * Firmware boot and version
0017  */
0018 
0019 #define SOF_IPC_MAX_ELEMS   16
0020 
0021 /*
0022  * Firmware boot info flag bits (64-bit)
0023  */
0024 #define SOF_IPC_INFO_BUILD      BIT(0)
0025 #define SOF_IPC_INFO_LOCKS      BIT(1)
0026 #define SOF_IPC_INFO_LOCKSV     BIT(2)
0027 #define SOF_IPC_INFO_GDB        BIT(3)
0028 #define SOF_IPC_INFO_D3_PERSISTENT  BIT(4)
0029 
0030 /* extended data types that can be appended onto end of sof_ipc_fw_ready */
0031 enum sof_ipc_ext_data {
0032     SOF_IPC_EXT_UNUSED      = 0,
0033     SOF_IPC_EXT_WINDOW      = 1,
0034     SOF_IPC_EXT_CC_INFO     = 2,
0035     SOF_IPC_EXT_PROBE_INFO      = 3,
0036     SOF_IPC_EXT_USER_ABI_INFO   = 4,
0037 };
0038 
0039 /* FW version - SOF_IPC_GLB_VERSION */
0040 struct sof_ipc_fw_version {
0041     struct sof_ipc_hdr hdr;
0042     uint16_t major;
0043     uint16_t minor;
0044     uint16_t micro;
0045     uint16_t build;
0046     uint8_t date[12];
0047     uint8_t time[10];
0048     uint8_t tag[6];
0049     uint32_t abi_version;
0050     /* used to check FW and ldc file compatibility, reproducible value */
0051     uint32_t src_hash;
0052 
0053     /* reserved for future use */
0054     uint32_t reserved[3];
0055 } __packed;
0056 
0057 /* FW ready Message - sent by firmware when boot has completed */
0058 struct sof_ipc_fw_ready {
0059     struct sof_ipc_cmd_hdr hdr;
0060     uint32_t dspbox_offset;  /* dsp initiated IPC mailbox */
0061     uint32_t hostbox_offset; /* host initiated IPC mailbox */
0062     uint32_t dspbox_size;
0063     uint32_t hostbox_size;
0064     struct sof_ipc_fw_version version;
0065 
0066     /* Miscellaneous flags */
0067     uint64_t flags;
0068 
0069     /* reserved for future use */
0070     uint32_t reserved[4];
0071 } __packed;
0072 
0073 /*
0074  * Extended Firmware data. All optional, depends on platform/arch.
0075  */
0076 enum sof_ipc_region {
0077     SOF_IPC_REGION_DOWNBOX  = 0,
0078     SOF_IPC_REGION_UPBOX,
0079     SOF_IPC_REGION_TRACE,
0080     SOF_IPC_REGION_DEBUG,
0081     SOF_IPC_REGION_STREAM,
0082     SOF_IPC_REGION_REGS,
0083     SOF_IPC_REGION_EXCEPTION,
0084 };
0085 
0086 struct sof_ipc_ext_data_hdr {
0087     struct sof_ipc_cmd_hdr hdr;
0088     uint32_t type;      /**< SOF_IPC_EXT_ */
0089 } __packed;
0090 
0091 struct sof_ipc_window_elem {
0092     struct sof_ipc_hdr hdr;
0093     uint32_t type;      /**< SOF_IPC_REGION_ */
0094     uint32_t id;        /**< platform specific - used to map to host memory */
0095     uint32_t flags;     /**< R, W, RW, etc - to define */
0096     uint32_t size;      /**< size of region in bytes */
0097     /* offset in window region as windows can be partitioned */
0098     uint32_t offset;
0099 } __packed;
0100 
0101 /* extended data memory windows for IPC, trace and debug */
0102 struct sof_ipc_window {
0103     struct sof_ipc_ext_data_hdr ext_hdr;
0104     uint32_t num_windows;
0105     struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
0106 }  __packed;
0107 
0108 struct sof_ipc_cc_version {
0109     struct sof_ipc_ext_data_hdr ext_hdr;
0110     uint32_t major;
0111     uint32_t minor;
0112     uint32_t micro;
0113 
0114     /* reserved for future use */
0115     uint32_t reserved[4];
0116 
0117     uint8_t name[16]; /* null terminated compiler name */
0118     uint8_t optim[4]; /* null terminated compiler -O flag value */
0119     uint8_t desc[32]; /* null terminated compiler description */
0120 } __packed;
0121 
0122 /* extended data: Probe setup */
0123 struct sof_ipc_probe_support {
0124     struct sof_ipc_ext_data_hdr ext_hdr;
0125 
0126     uint32_t probe_points_max;
0127     uint32_t injection_dmas_max;
0128 
0129     /* reserved for future use */
0130     uint32_t reserved[2];
0131 } __packed;
0132 
0133 /* extended data: user abi version(s) */
0134 struct sof_ipc_user_abi_version {
0135     struct sof_ipc_ext_data_hdr ext_hdr;
0136 
0137     uint32_t abi_dbg_version;
0138 }  __packed;
0139 
0140 #endif