rimage: Use fw.h instead of duplicating the code

This is very useful when updating one of the types in UAPI
because with the current implementation one needs to be careful
to also update file_format.h

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This commit is contained in:
Daniel Baluta 2019-01-28 14:06:14 +02:00 committed by Liam Girdwood
parent 663fe669a9
commit f4900e7dcd
1 changed files with 1 additions and 51 deletions

View File

@ -64,61 +64,11 @@
#define __INCLUDE_UAPI_SOF_FW_H__
#include <uapi/ipc/info.h>
#define SND_SOF_FW_SIG_SIZE 4
#define SND_SOF_FW_ABI 1
#define SND_SOF_FW_SIG "Reef"
#include <uapi/user/fw.h>
#define SND_SOF_LOGS_SIG_SIZE 4
#define SND_SOF_LOGS_SIG "Logs"
/*
* Firmware module is made up of 1 . N blocks of different types. The
* Block header is used to determine where and how block is to be copied in the
* DSP/host memory space.
*/
enum snd_sof_fw_blk_type {
SOF_BLK_IMAGE = 0, /* whole image - parsed by ROMs */
SOF_BLK_TEXT = 1,
SOF_BLK_DATA = 2,
SOF_BLK_CACHE = 3,
SOF_BLK_REGS = 4,
SOF_BLK_SIG = 5,
SOF_BLK_ROM = 6,
/* add new block types here */
};
struct snd_sof_blk_hdr {
enum snd_sof_fw_blk_type type;
uint32_t size; /* bytes minus this header */
uint32_t offset; /* offset from base */
} __attribute__((packed));
/*
* Firmware file is made up of 1 .. N different modules types. The module
* type is used to determine how to load and parse the module.
*/
enum snd_sof_fw_mod_type {
SOF_FW_BASE = 0, /* base firmware image */
SOF_FW_MODULE = 1, /* firmware module */
};
struct snd_sof_mod_hdr {
enum snd_sof_fw_mod_type type;
uint32_t size; /* bytes minus this header */
uint32_t num_blocks; /* number of blocks */
} __attribute__((packed));
/*
* Firmware file header.
*/
struct snd_sof_fw_header {
unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */
uint32_t file_size; /* size of file minus this header */
uint32_t num_modules; /* number of modules */
uint32_t abi; /* version of header format */
} __attribute__((packed));
/*
* Logs dictionary file header.
*/