| 1 |
|
| 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) 2020 Intel Corporation
|
| 7 |
|
| 8 |
|
| 9 | |
| 10 | * Extended manifest is a place to store metadata about firmware, known during
|
| 11 | * compilation time - for example firmware version or used compiler.
|
| 12 | * Given information are read on host side before firmware startup.
|
| 13 | * This part of output binary is not signed.
|
| 14 |
|
| 15 |
|
| 16 | #ifndef __SOF_FIRMWARE_EXT_MANIFEST_H__
|
| 17 | #define __SOF_FIRMWARE_EXT_MANIFEST_H__
|
| 18 |
|
| 19 | #include <linux/bits.h>
|
| 20 | #include <linux/compiler.h>
|
| 21 | #include <linux/types.h>
|
| 22 | #include <sound/sof/info.h>
|
| 23 |
|
| 24 |
|
| 25 | #define SOF_EXT_MAN_MAGIC_NUMBER 0x6e614d58
|
| 26 |
|
| 27 |
|
| 28 | #define SOF_EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ((uint32_t)( \
|
| 29 | ((MAJOR) << 24) | \
|
| 30 | ((MINOR) << 12) | \
|
| 31 | (PATH)))
|
| 32 |
|
| 33 |
|
| 34 | #define SOF_EXT_MAN_VERSION_INCOMPATIBLE(host_ver, cli_ver) ( \
|
| 35 | ((host_ver) & GENMASK(31, 24)) != \
|
| 36 | ((cli_ver) & GENMASK(31, 24)))
|
| 37 |
|
| 38 |
|
| 39 | #define SOF_EXT_MAN_VERSION SOF_EXT_MAN_BUILD_VERSION(1, 0, 0)
|
| 40 |
|
| 41 |
|
| 42 | struct sof_ext_man_header {
|
| 43 | uint32_t magic;
|
| 44 |
|
| 45 | uint32_t full_size;
|
| 46 |
|
| 47 | uint32_t header_size;
|
| 48 |
|
| 49 |
|
| 50 | uint32_t header_version;
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 | } __packed;
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 | enum sof_ext_man_elem_type {
|
| 60 | SOF_EXT_MAN_ELEM_FW_VERSION = 0,
|
| 61 | SOF_EXT_MAN_ELEM_WINDOW = 1,
|
| 62 | SOF_EXT_MAN_ELEM_CC_VERSION = 2,
|
| 63 | SOF_EXT_MAN_ELEM_PROBE_INFO = 3,
|
| 64 | SOF_EXT_MAN_ELEM_DBG_ABI = 4,
|
| 65 | SOF_EXT_MAN_ELEM_CONFIG_DATA = 5,
|
| 66 | SOF_EXT_MAN_ELEM_PLATFORM_CONFIG_DATA = 6,
|
| 67 | };
|
| 68 |
|
| 69 |
|
| 70 | struct sof_ext_man_elem_header {
|
| 71 | uint32_t type;
|
| 72 | uint32_t size;
|
| 73 |
|
| 74 |
|
| 75 | } __packed;
|
| 76 |
|
| 77 |
|
| 78 | struct sof_ext_man_fw_version {
|
| 79 | struct sof_ext_man_elem_header hdr;
|
| 80 |
|
| 81 | struct sof_ipc_fw_version version;
|
| 82 | uint32_t flags;
|
| 83 | } __packed;
|
| 84 |
|
| 85 |
|
| 86 | struct sof_ext_man_window {
|
| 87 | struct sof_ext_man_elem_header hdr;
|
| 88 |
|
| 89 | struct sof_ipc_window ipc_window;
|
| 90 | } __packed;
|
| 91 |
|
| 92 |
|
| 93 | struct sof_ext_man_cc_version {
|
| 94 | struct sof_ext_man_elem_header hdr;
|
| 95 |
|
| 96 | struct sof_ipc_cc_version cc_version;
|
| 97 | } __packed;
|
| 98 |
|
| 99 | struct ext_man_dbg_abi {
|
| 100 | struct sof_ext_man_elem_header hdr;
|
| 101 |
|
| 102 | struct sof_ipc_user_abi_version dbg_abi;
|
| 103 | } __packed;
|
| 104 |
|
| 105 |
|
| 106 | enum config_elem_type {
|
| 107 | SOF_EXT_MAN_CONFIG_EMPTY = 0,
|
| 108 | SOF_EXT_MAN_CONFIG_IPC_MSG_SIZE = 1,
|
| 109 | SOF_EXT_MAN_CONFIG_MEMORY_USAGE_SCAN = 2,
|
| 110 | };
|
| 111 |
|
| 112 | struct sof_config_elem {
|
| 113 | uint32_t token;
|
| 114 | uint32_t value;
|
| 115 | } __packed;
|
| 116 |
|
| 117 |
|
| 118 | struct sof_ext_man_config_data {
|
| 119 | struct sof_ext_man_elem_header hdr;
|
| 120 |
|
| 121 | struct sof_config_elem elems[];
|
| 122 | } __packed;
|
| 123 |
|
| 124 | #endif
|