ext_manifest.h: inline rimage/ext_manifest.sh and reduce rimage dependency

Inline rimage/src/include/rimage/sof/kernel/ext_manifest.h version
9716e10a3e into sof/src/include/kernel/ext_manifest.h instead
of #including it.

This makes it possible to build zephyr.elf without rimage and unblocks
SOF uprev https://github.com/zephyrproject-rtos/zephyr/pull/37250

See also similar copy in https://github.com/zephyrproject-rtos/sof/pull/7

The duplication is OK because it is part of a versioned ABI and is
already duplicated in the Linux kernel tree anyway.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2021-08-25 17:51:00 +02:00 committed by Daniel Baluta
parent 73803adec9
commit 39d5365fc7
1 changed files with 57 additions and 1 deletions

View File

@ -5,6 +5,12 @@
* Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
*/
/*
* Parts of this file are copied to ext_manifest.h in Linux kernel tree
* and to the rimage tree. This duplication is OK because it is part of
* a versioned ABI.
*/
/*
* Extended manifest is a place to store metadata about firmware, known during
* compilation time - for example firmware version or used compiler.
@ -29,11 +35,61 @@
#include <ipc/info.h>
#include <sof/compiler_attributes.h>
#include <rimage/sof/kernel/ext_manifest.h>
#include <stdint.h>
/* Top-level headers shared with rimage */
#ifndef __packed
#define __packed __attribute__((packed))
#endif
/* In ASCII `XMan` */
#define EXT_MAN_MAGIC_NUMBER 0x6e614d58
/* Build u32 number in format MMmmmppp */
#define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \
((uint32_t)(MAJOR) << 24) | \
((uint32_t)(MINOR) << 12) | \
(uint32_t)(PATH))
/* check extended manifest version consistency */
#define EXT_MAN_VERSION_INCOMPATIBLE(host_ver, cli_ver) ( \
((host_ver) & GENMASK(31, 24)) != \
((cli_ver) & GENMASK(31, 24)))
/* used extended manifest header version */
#define EXT_MAN_VERSION EXT_MAN_BUILD_VERSION(1, 0, 0)
/* struct size alignment for ext_man elements */
#define EXT_MAN_ALIGN 16
/* extended manifest header, deleting any field breaks backward compatibility */
struct ext_man_header {
uint32_t magic; /**< identification number, */
/**< EXT_MAN_MAGIC_NUMBER */
uint32_t full_size; /**< [bytes] full size of ext_man, */
/**< (header + content + padding) */
uint32_t header_size; /**< [bytes] makes header extensionable, */
/**< after append new field to ext_man header */
/**< then backward compatible won't be lost */
uint32_t header_version; /**< value of EXT_MAN_VERSION */
/**< not related with following content */
/* just after this header should be list of ext_man_elem_* elements */
} __packed;
/* Now define extended manifest elements */
/* extended manifest element header */
struct ext_man_elem_header {
uint32_t type; /**< EXT_MAN_ELEM_* */
uint32_t elem_size; /**< in bytes, including header size */
/* just after this header should be type dependent content */
} __packed;
/* End of the top-level headers shared with rimage */
/* Extended manifest elements identificators */
enum ext_man_elem_type {
EXT_MAN_ELEM_FW_VERSION = 0,