/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */1/*2* This file is provided under a dual BSD/GPLv2 license. When using or3* redistributing this file, you may do so under either license.4*5* Copyright(c) 2018 Intel Corporation6*/78/*9* Firmware file format .10*/1112#ifndef __INCLUDE_UAPI_SOF_FW_H__13#define __INCLUDE_UAPI_SOF_FW_H__1415#include <linux/types.h>1617#define SND_SOF_FW_SIG_SIZE 418#define SND_SOF_FW_ABI 119#define SND_SOF_FW_SIG "Reef"2021/*22* Firmware module is made up of 1 . N blocks of different types. The23* Block header is used to determine where and how block is to be copied in the24* DSP/host memory space.25*/26enum snd_sof_fw_blk_type {27SOF_FW_BLK_TYPE_INVALID = -1,28SOF_FW_BLK_TYPE_START = 0,29SOF_FW_BLK_TYPE_RSRVD0 = SOF_FW_BLK_TYPE_START,30SOF_FW_BLK_TYPE_IRAM = 1, /* local instruction RAM */31SOF_FW_BLK_TYPE_DRAM = 2, /* local data RAM */32SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */33SOF_FW_BLK_TYPE_ROM = 4,34SOF_FW_BLK_TYPE_IMR = 5,35SOF_FW_BLK_TYPE_RSRVD6 = 6,36SOF_FW_BLK_TYPE_RSRVD7 = 7,37SOF_FW_BLK_TYPE_RSRVD8 = 8,38SOF_FW_BLK_TYPE_RSRVD9 = 9,39SOF_FW_BLK_TYPE_RSRVD10 = 10,40SOF_FW_BLK_TYPE_RSRVD11 = 11,41SOF_FW_BLK_TYPE_RSRVD12 = 12,42SOF_FW_BLK_TYPE_RSRVD13 = 13,43SOF_FW_BLK_TYPE_RSRVD14 = 14,44/* use SOF_FW_BLK_TYPE_RSVRDX for new block types */45SOF_FW_BLK_TYPE_NUM46};4748struct snd_sof_blk_hdr {49enum snd_sof_fw_blk_type type;50__u32 size; /* bytes minus this header */51__u32 offset; /* offset from base */52} __packed;5354/*55* Firmware file is made up of 1 .. N different modules types. The module56* type is used to determine how to load and parse the module.57*/58enum snd_sof_fw_mod_type {59SOF_FW_BASE = 0, /* base firmware image */60SOF_FW_MODULE = 1, /* firmware module */61};6263struct snd_sof_mod_hdr {64enum snd_sof_fw_mod_type type;65__u32 size; /* bytes minus this header */66__u32 num_blocks; /* number of blocks */67} __packed;6869/*70* Firmware file header.71*/72struct snd_sof_fw_header {73unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */74__u32 file_size; /* size of file minus this header */75__u32 num_modules; /* number of modules */76__u32 abi; /* version of header format */77} __packed;7879#endif808182