Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) 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) 2022 Intel Corporation. All rights reserved.
0007  */
0008 
0009 /*
0010  * Extended manifest is a place to store metadata about firmware, known during
0011  * compilation time - for example firmware version or used compiler.
0012  * Given information are read on host side before firmware startup.
0013  * This part of output binary is not signed.
0014  */
0015 
0016 #ifndef __SOF_FIRMWARE_EXT_MANIFEST4_H__
0017 #define __SOF_FIRMWARE_EXT_MANIFEST4_H__
0018 
0019 #include <linux/uuid.h>
0020 
0021 /* In ASCII  $AE1 */
0022 #define SOF_EXT_MAN4_MAGIC_NUMBER   0x31454124
0023 
0024 #define MAX_MODULE_NAME_LEN     8
0025 #define MAX_FW_BINARY_NAME      8
0026 #define DEFAULT_HASH_SHA256_LEN     32
0027 #define SOF_MAN4_FW_HDR_OFFSET      0x2000
0028 #define SOF_MAN4_FW_HDR_OFFSET_CAVS_1_5 0x284
0029 
0030 /*********************************************************************
0031  *  extended manifest       (struct sof_ext_manifest4_hdr)
0032  *-------------------
0033  *  css_manifest hdr
0034  *-------------------
0035  *  offset reserved for future
0036  *-------------------
0037  *  fw_hdr              (struct sof_man4_fw_binary_header)
0038  *-------------------
0039  *  module_entry[0]         (struct sof_man4_module)
0040  *-------------------
0041  *  module_entry[1]
0042  *-------------------
0043  *  ...
0044  *-------------------
0045  *  module_entry[n]
0046  *-------------------
0047  *  module_config[0]        (struct sof_man4_module_config)
0048  *-------------------
0049  *  module_config[1]
0050  *-------------------
0051  *  ...
0052  *-------------------
0053  *  module_config[m]
0054  *-------------------
0055  *  FW content
0056  *-------------------
0057  *********************************************************************/
0058 
0059 struct sof_ext_manifest4_hdr {
0060     uint32_t id;
0061     uint32_t len; /* length of extension manifest */
0062     uint16_t version_major; /* header version */
0063     uint16_t version_minor;
0064     uint32_t num_module_entries;
0065 } __packed;
0066 
0067 struct sof_man4_fw_binary_header {
0068     /* This part must be unchanged to be backward compatible with SPT-LP ROM */
0069     uint32_t id;
0070     uint32_t len; /* sizeof(sof_man4_fw_binary_header) in bytes */
0071     uint8_t name[MAX_FW_BINARY_NAME];
0072     uint32_t preload_page_count; /* number of pages of preloaded image */
0073     uint32_t fw_image_flags;
0074     uint32_t feature_mask;
0075     uint16_t major_version; /* Firmware version */
0076     uint16_t minor_version;
0077     uint16_t hotfix_version;
0078     uint16_t build_version;
0079     uint32_t num_module_entries;
0080 
0081     /* This part may change to contain any additional data for BaseFw that is skipped by ROM */
0082     uint32_t hw_buf_base_addr;
0083     uint32_t hw_buf_length;
0084     uint32_t load_offset; /* This value is used by ROM */
0085 } __packed;
0086 
0087 struct sof_man4_segment_desc {
0088     uint32_t flags;
0089     uint32_t v_base_addr;
0090     uint32_t file_offset;
0091 } __packed;
0092 
0093 struct sof_man4_module {
0094     uint32_t id;
0095     uint8_t name[MAX_MODULE_NAME_LEN];
0096     guid_t uuid;
0097     uint32_t type;
0098     uint8_t hash[DEFAULT_HASH_SHA256_LEN];
0099     uint32_t entry_point;
0100     uint16_t cfg_offset;
0101     uint16_t cfg_count;
0102     uint32_t affinity_mask;
0103     uint16_t instance_max_count;
0104     uint16_t instance_stack_size;
0105     struct sof_man4_segment_desc    segments[3];
0106 } __packed;
0107 
0108 struct sof_man4_module_config {
0109     uint32_t par[4];    /* module parameters */
0110     uint32_t is_bytes;  /* actual size of instance .bss (bytes) */
0111     uint32_t cps;       /* cycles per second */
0112     uint32_t ibs;       /* input buffer size (bytes) */
0113     uint32_t obs;       /* output buffer size (bytes) */
0114     uint32_t module_flags;  /* flags, reserved for future use */
0115     uint32_t cpc;       /* cycles per single run */
0116     uint32_t obls;      /* output block size, reserved for future use */
0117 } __packed;
0118 
0119 #endif /* __SOF_FIRMWARE_EXT_MANIFEST4_H__ */