| 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) 2022 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_MANIFEST4_H__
|
| 17 | #define __SOF_FIRMWARE_EXT_MANIFEST4_H__
|
| 18 |
|
| 19 | #include <linux/uuid.h>
|
| 20 |
|
| 21 |
|
| 22 | #define SOF_EXT_MAN4_MAGIC_NUMBER 0x31454124
|
| 23 |
|
| 24 | #define MAX_MODULE_NAME_LEN 8
|
| 25 | #define MAX_FW_BINARY_NAME 8
|
| 26 | #define DEFAULT_HASH_SHA256_LEN 32
|
| 27 | #define SOF_MAN4_FW_HDR_OFFSET 0x2000
|
| 28 | #define SOF_MAN4_FW_HDR_OFFSET_CAVS_1_5 0x284
|
| 29 |
|
| 30 | |
| 31 | * extended manifest (struct sof_ext_manifest4_hdr)
|
| 32 | *-------------------
|
| 33 | * css_manifest hdr
|
| 34 | *-------------------
|
| 35 | * offset reserved for future
|
| 36 | *-------------------
|
| 37 | * fw_hdr (struct sof_man4_fw_binary_header)
|
| 38 | *-------------------
|
| 39 | * module_entry[0] (struct sof_man4_module)
|
| 40 | *-------------------
|
| 41 | * module_entry[1]
|
| 42 | *-------------------
|
| 43 | * ...
|
| 44 | *-------------------
|
| 45 | * module_entry[n]
|
| 46 | *-------------------
|
| 47 | * module_config[0] (struct sof_man4_module_config)
|
| 48 | *-------------------
|
| 49 | * module_config[1]
|
| 50 | *-------------------
|
| 51 | * ...
|
| 52 | *-------------------
|
| 53 | * module_config[m]
|
| 54 | *-------------------
|
| 55 | * FW content
|
| 56 | *-------------------
|
| 57 | ********************************************************************
|
| 58 |
|
| 59 | struct sof_ext_manifest4_hdr {
|
| 60 | uint32_t id;
|
| 61 | uint32_t len;
|
| 62 | uint16_t version_major;
|
| 63 | uint16_t version_minor;
|
| 64 | uint32_t num_module_entries;
|
| 65 | } __packed;
|
| 66 |
|
| 67 | struct sof_man4_fw_binary_header {
|
| 68 |
|
| 69 | uint32_t id;
|
| 70 | uint32_t len;
|
| 71 | uint8_t name[MAX_FW_BINARY_NAME];
|
| 72 | uint32_t preload_page_count;
|
| 73 | uint32_t fw_image_flags;
|
| 74 | uint32_t feature_mask;
|
| 75 | uint16_t major_version;
|
| 76 | uint16_t minor_version;
|
| 77 | uint16_t hotfix_version;
|
| 78 | uint16_t build_version;
|
| 79 | uint32_t num_module_entries;
|
| 80 |
|
| 81 |
|
| 82 | uint32_t hw_buf_base_addr;
|
| 83 | uint32_t hw_buf_length;
|
| 84 | uint32_t load_offset;
|
| 85 | } __packed;
|
| 86 |
|
| 87 | struct sof_man4_segment_desc {
|
| 88 | uint32_t flags;
|
| 89 | uint32_t v_base_addr;
|
| 90 | uint32_t file_offset;
|
| 91 | } __packed;
|
| 92 |
|
| 93 | struct sof_man4_module {
|
| 94 | uint32_t id;
|
| 95 | uint8_t name[MAX_MODULE_NAME_LEN];
|
| 96 | guid_t uuid;
|
| 97 | uint32_t type;
|
| 98 | uint8_t hash[DEFAULT_HASH_SHA256_LEN];
|
| 99 | uint32_t entry_point;
|
| 100 | uint16_t cfg_offset;
|
| 101 | uint16_t cfg_count;
|
| 102 | uint32_t affinity_mask;
|
| 103 | uint16_t instance_max_count;
|
| 104 | uint16_t instance_stack_size;
|
| 105 | struct sof_man4_segment_desc segments[3];
|
| 106 | } __packed;
|
| 107 |
|
| 108 | struct sof_man4_module_config {
|
| 109 | uint32_t par[4];
|
| 110 | uint32_t is_bytes;
|
| 111 | uint32_t cps;
|
| 112 | uint32_t ibs;
|
| 113 | uint32_t obs;
|
| 114 | uint32_t module_flags;
|
| 115 | uint32_t cpc;
|
| 116 | uint32_t obls;
|
| 117 | } __packed;
|
| 118 |
|
| 119 | #endif
|