Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
0002 /*
0003  * This file is provided under a dual BSD/GPLv2 license.  When using or
0004  * redistributing this file, you may do so under either license.
0005  *
0006  * Copyright(c) 2018 Intel Corporation. All rights reserved.
0007  */
0008 
0009 /*
0010  * Firmware file format .
0011  */
0012 
0013 #ifndef __INCLUDE_UAPI_SOF_FW_H__
0014 #define __INCLUDE_UAPI_SOF_FW_H__
0015 
0016 #include <linux/types.h>
0017 
0018 #define SND_SOF_FW_SIG_SIZE 4
0019 #define SND_SOF_FW_ABI      1
0020 #define SND_SOF_FW_SIG      "Reef"
0021 
0022 /*
0023  * Firmware module is made up of 1 . N blocks of different types. The
0024  * Block header is used to determine where and how block is to be copied in the
0025  * DSP/host memory space.
0026  */
0027 enum snd_sof_fw_blk_type {
0028     SOF_FW_BLK_TYPE_INVALID = -1,
0029     SOF_FW_BLK_TYPE_START   = 0,
0030     SOF_FW_BLK_TYPE_RSRVD0  = SOF_FW_BLK_TYPE_START,
0031     SOF_FW_BLK_TYPE_IRAM    = 1,    /* local instruction RAM */
0032     SOF_FW_BLK_TYPE_DRAM    = 2,    /* local data RAM */
0033     SOF_FW_BLK_TYPE_SRAM    = 3,    /* system RAM */
0034     SOF_FW_BLK_TYPE_ROM = 4,
0035     SOF_FW_BLK_TYPE_IMR = 5,
0036     SOF_FW_BLK_TYPE_RSRVD6  = 6,
0037     SOF_FW_BLK_TYPE_RSRVD7  = 7,
0038     SOF_FW_BLK_TYPE_RSRVD8  = 8,
0039     SOF_FW_BLK_TYPE_RSRVD9  = 9,
0040     SOF_FW_BLK_TYPE_RSRVD10 = 10,
0041     SOF_FW_BLK_TYPE_RSRVD11 = 11,
0042     SOF_FW_BLK_TYPE_RSRVD12 = 12,
0043     SOF_FW_BLK_TYPE_RSRVD13 = 13,
0044     SOF_FW_BLK_TYPE_RSRVD14 = 14,
0045     /* use SOF_FW_BLK_TYPE_RSVRDX for new block types */
0046     SOF_FW_BLK_TYPE_NUM
0047 };
0048 
0049 struct snd_sof_blk_hdr {
0050     enum snd_sof_fw_blk_type type;
0051     __u32 size;     /* bytes minus this header */
0052     __u32 offset;       /* offset from base */
0053 } __packed;
0054 
0055 /*
0056  * Firmware file is made up of 1 .. N different modules types. The module
0057  * type is used to determine how to load and parse the module.
0058  */
0059 enum snd_sof_fw_mod_type {
0060     SOF_FW_BASE = 0,    /* base firmware image */
0061     SOF_FW_MODULE   = 1,    /* firmware module */
0062 };
0063 
0064 struct snd_sof_mod_hdr {
0065     enum snd_sof_fw_mod_type type;
0066     __u32 size;     /* bytes minus this header */
0067     __u32 num_blocks;   /* number of blocks */
0068 } __packed;
0069 
0070 /*
0071  * Firmware file header.
0072  */
0073 struct snd_sof_fw_header {
0074     unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */
0075     __u32 file_size;    /* size of file minus this header */
0076     __u32 num_modules;  /* number of modules */
0077     __u32 abi;      /* version of header format */
0078 } __packed;
0079 
0080 #endif