ext_manifest4.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
  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. * Extended manifest is a place to store metadata about firmware, known during
  10. * compilation time - for example firmware version or used compiler.
  11. * Given information are read on host side before firmware startup.
  12. * This part of output binary is not signed.
  13. */
  14. #ifndef __SOF_FIRMWARE_EXT_MANIFEST4_H__
  15. #define __SOF_FIRMWARE_EXT_MANIFEST4_H__
  16. #include <linux/uuid.h>
  17. /* In ASCII $AE1 */
  18. #define SOF_EXT_MAN4_MAGIC_NUMBER 0x31454124
  19. #define MAX_MODULE_NAME_LEN 8
  20. #define MAX_FW_BINARY_NAME 8
  21. #define DEFAULT_HASH_SHA256_LEN 32
  22. #define SOF_MAN4_FW_HDR_OFFSET 0x2000
  23. #define SOF_MAN4_FW_HDR_OFFSET_CAVS_1_5 0x284
  24. /*********************************************************************
  25. * extended manifest (struct sof_ext_manifest4_hdr)
  26. *-------------------
  27. * css_manifest hdr
  28. *-------------------
  29. * offset reserved for future
  30. *-------------------
  31. * fw_hdr (struct sof_man4_fw_binary_header)
  32. *-------------------
  33. * module_entry[0] (struct sof_man4_module)
  34. *-------------------
  35. * module_entry[1]
  36. *-------------------
  37. * ...
  38. *-------------------
  39. * module_entry[n]
  40. *-------------------
  41. * module_config[0] (struct sof_man4_module_config)
  42. *-------------------
  43. * module_config[1]
  44. *-------------------
  45. * ...
  46. *-------------------
  47. * module_config[m]
  48. *-------------------
  49. * FW content
  50. *-------------------
  51. *********************************************************************/
  52. struct sof_ext_manifest4_hdr {
  53. uint32_t id;
  54. uint32_t len; /* length of extension manifest */
  55. uint16_t version_major; /* header version */
  56. uint16_t version_minor;
  57. uint32_t num_module_entries;
  58. } __packed;
  59. struct sof_man4_fw_binary_header {
  60. /* This part must be unchanged to be backward compatible with SPT-LP ROM */
  61. uint32_t id;
  62. uint32_t len; /* sizeof(sof_man4_fw_binary_header) in bytes */
  63. uint8_t name[MAX_FW_BINARY_NAME];
  64. uint32_t preload_page_count; /* number of pages of preloaded image */
  65. uint32_t fw_image_flags;
  66. uint32_t feature_mask;
  67. uint16_t major_version; /* Firmware version */
  68. uint16_t minor_version;
  69. uint16_t hotfix_version;
  70. uint16_t build_version;
  71. uint32_t num_module_entries;
  72. /* This part may change to contain any additional data for BaseFw that is skipped by ROM */
  73. uint32_t hw_buf_base_addr;
  74. uint32_t hw_buf_length;
  75. uint32_t load_offset; /* This value is used by ROM */
  76. } __packed;
  77. struct sof_man4_segment_desc {
  78. uint32_t flags;
  79. uint32_t v_base_addr;
  80. uint32_t file_offset;
  81. } __packed;
  82. struct sof_man4_module {
  83. uint32_t id;
  84. uint8_t name[MAX_MODULE_NAME_LEN];
  85. guid_t uuid;
  86. uint32_t type;
  87. uint8_t hash[DEFAULT_HASH_SHA256_LEN];
  88. uint32_t entry_point;
  89. uint16_t cfg_offset;
  90. uint16_t cfg_count;
  91. uint32_t affinity_mask;
  92. uint16_t instance_max_count;
  93. uint16_t instance_stack_size;
  94. struct sof_man4_segment_desc segments[3];
  95. } __packed;
  96. struct sof_man4_module_config {
  97. uint32_t par[4]; /* module parameters */
  98. uint32_t is_bytes; /* actual size of instance .bss (bytes) */
  99. uint32_t cps; /* cycles per second */
  100. uint32_t ibs; /* input buffer size (bytes) */
  101. uint32_t obs; /* output buffer size (bytes) */
  102. uint32_t module_flags; /* flags, reserved for future use */
  103. uint32_t cpc; /* cycles per single run */
  104. uint32_t obls; /* output block size, reserved for future use */
  105. } __packed;
  106. #endif /* __SOF_FIRMWARE_EXT_MANIFEST4_H__ */