fw.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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) 2018 Intel Corporation. All rights reserved.
  7. */
  8. /*
  9. * Firmware file format .
  10. */
  11. #ifndef __INCLUDE_UAPI_SOF_FW_H__
  12. #define __INCLUDE_UAPI_SOF_FW_H__
  13. #include <linux/types.h>
  14. #define SND_SOF_FW_SIG_SIZE 4
  15. #define SND_SOF_FW_ABI 1
  16. #define SND_SOF_FW_SIG "Reef"
  17. /*
  18. * Firmware module is made up of 1 . N blocks of different types. The
  19. * Block header is used to determine where and how block is to be copied in the
  20. * DSP/host memory space.
  21. */
  22. enum snd_sof_fw_blk_type {
  23. SOF_FW_BLK_TYPE_INVALID = -1,
  24. SOF_FW_BLK_TYPE_START = 0,
  25. SOF_FW_BLK_TYPE_RSRVD0 = SOF_FW_BLK_TYPE_START,
  26. SOF_FW_BLK_TYPE_IRAM = 1, /* local instruction RAM */
  27. SOF_FW_BLK_TYPE_DRAM = 2, /* local data RAM */
  28. SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */
  29. SOF_FW_BLK_TYPE_ROM = 4,
  30. SOF_FW_BLK_TYPE_IMR = 5,
  31. SOF_FW_BLK_TYPE_RSRVD6 = 6,
  32. SOF_FW_BLK_TYPE_RSRVD7 = 7,
  33. SOF_FW_BLK_TYPE_RSRVD8 = 8,
  34. SOF_FW_BLK_TYPE_RSRVD9 = 9,
  35. SOF_FW_BLK_TYPE_RSRVD10 = 10,
  36. SOF_FW_BLK_TYPE_RSRVD11 = 11,
  37. SOF_FW_BLK_TYPE_RSRVD12 = 12,
  38. SOF_FW_BLK_TYPE_RSRVD13 = 13,
  39. SOF_FW_BLK_TYPE_RSRVD14 = 14,
  40. /* use SOF_FW_BLK_TYPE_RSVRDX for new block types */
  41. SOF_FW_BLK_TYPE_NUM
  42. };
  43. struct snd_sof_blk_hdr {
  44. enum snd_sof_fw_blk_type type;
  45. __u32 size; /* bytes minus this header */
  46. __u32 offset; /* offset from base */
  47. } __attribute__((packed));
  48. /*
  49. * Firmware file is made up of 1 .. N different modules types. The module
  50. * type is used to determine how to load and parse the module.
  51. */
  52. enum snd_sof_fw_mod_type {
  53. SOF_FW_BASE = 0, /* base firmware image */
  54. SOF_FW_MODULE = 1, /* firmware module */
  55. };
  56. struct snd_sof_mod_hdr {
  57. enum snd_sof_fw_mod_type type;
  58. __u32 size; /* bytes minus this header */
  59. __u32 num_blocks; /* number of blocks */
  60. } __attribute__((packed));
  61. /*
  62. * Firmware file header.
  63. */
  64. struct snd_sof_fw_header {
  65. unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */
  66. __u32 file_size; /* size of file minus this header */
  67. __u32 num_modules; /* number of modules */
  68. __u32 abi; /* version of header format */
  69. } __attribute__((packed));
  70. #endif