info.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* SPDX-License-Identifier: (GPL-2.0-only 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
  7. */
  8. #ifndef __INCLUDE_SOUND_SOF_INFO_H__
  9. #define __INCLUDE_SOUND_SOF_INFO_H__
  10. #include <sound/sof/header.h>
  11. #include <sound/sof/stream.h>
  12. /*
  13. * Firmware boot and version
  14. */
  15. #define SOF_IPC_MAX_ELEMS 16
  16. /*
  17. * Firmware boot info flag bits (64-bit)
  18. */
  19. #define SOF_IPC_INFO_BUILD BIT(0)
  20. #define SOF_IPC_INFO_LOCKS BIT(1)
  21. #define SOF_IPC_INFO_LOCKSV BIT(2)
  22. #define SOF_IPC_INFO_GDB BIT(3)
  23. #define SOF_IPC_INFO_D3_PERSISTENT BIT(4)
  24. /* extended data types that can be appended onto end of sof_ipc_fw_ready */
  25. enum sof_ipc_ext_data {
  26. SOF_IPC_EXT_UNUSED = 0,
  27. SOF_IPC_EXT_WINDOW = 1,
  28. SOF_IPC_EXT_CC_INFO = 2,
  29. SOF_IPC_EXT_PROBE_INFO = 3,
  30. SOF_IPC_EXT_USER_ABI_INFO = 4,
  31. };
  32. /* Build u32 number in format MMmmmppp */
  33. #define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
  34. ((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))
  35. /* FW version - SOF_IPC_GLB_VERSION */
  36. struct sof_ipc_fw_version {
  37. struct sof_ipc_hdr hdr;
  38. uint16_t major;
  39. uint16_t minor;
  40. uint16_t micro;
  41. uint16_t build;
  42. uint8_t date[12];
  43. uint8_t time[10];
  44. uint8_t tag[6];
  45. uint32_t abi_version;
  46. /* used to check FW and ldc file compatibility, reproducible value */
  47. uint32_t src_hash;
  48. /* reserved for future use */
  49. uint32_t reserved[3];
  50. } __packed;
  51. /* FW ready Message - sent by firmware when boot has completed */
  52. struct sof_ipc_fw_ready {
  53. struct sof_ipc_cmd_hdr hdr;
  54. uint32_t dspbox_offset; /* dsp initiated IPC mailbox */
  55. uint32_t hostbox_offset; /* host initiated IPC mailbox */
  56. uint32_t dspbox_size;
  57. uint32_t hostbox_size;
  58. struct sof_ipc_fw_version version;
  59. /* Miscellaneous flags */
  60. uint64_t flags;
  61. /* reserved for future use */
  62. uint32_t reserved[4];
  63. } __packed;
  64. /*
  65. * Extended Firmware data. All optional, depends on platform/arch.
  66. */
  67. enum sof_ipc_region {
  68. SOF_IPC_REGION_DOWNBOX = 0,
  69. SOF_IPC_REGION_UPBOX,
  70. SOF_IPC_REGION_TRACE,
  71. SOF_IPC_REGION_DEBUG,
  72. SOF_IPC_REGION_STREAM,
  73. SOF_IPC_REGION_REGS,
  74. SOF_IPC_REGION_EXCEPTION,
  75. };
  76. struct sof_ipc_ext_data_hdr {
  77. struct sof_ipc_cmd_hdr hdr;
  78. uint32_t type; /**< SOF_IPC_EXT_ */
  79. } __packed;
  80. struct sof_ipc_window_elem {
  81. struct sof_ipc_hdr hdr;
  82. uint32_t type; /**< SOF_IPC_REGION_ */
  83. uint32_t id; /**< platform specific - used to map to host memory */
  84. uint32_t flags; /**< R, W, RW, etc - to define */
  85. uint32_t size; /**< size of region in bytes */
  86. /* offset in window region as windows can be partitioned */
  87. uint32_t offset;
  88. } __packed;
  89. /* extended data memory windows for IPC, trace and debug */
  90. struct sof_ipc_window {
  91. struct sof_ipc_ext_data_hdr ext_hdr;
  92. uint32_t num_windows;
  93. struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS];
  94. } __packed;
  95. struct sof_ipc_cc_version {
  96. struct sof_ipc_ext_data_hdr ext_hdr;
  97. uint32_t major;
  98. uint32_t minor;
  99. uint32_t micro;
  100. /* reserved for future use */
  101. uint32_t reserved[4];
  102. uint8_t name[16]; /* null terminated compiler name */
  103. uint8_t optim[4]; /* null terminated compiler -O flag value */
  104. uint8_t desc[32]; /* null terminated compiler description */
  105. } __packed;
  106. /* extended data: Probe setup */
  107. struct sof_ipc_probe_support {
  108. struct sof_ipc_ext_data_hdr ext_hdr;
  109. uint32_t probe_points_max;
  110. uint32_t injection_dmas_max;
  111. /* reserved for future use */
  112. uint32_t reserved[2];
  113. } __packed;
  114. /* extended data: user abi version(s) */
  115. struct sof_ipc_user_abi_version {
  116. struct sof_ipc_ext_data_hdr ext_hdr;
  117. uint32_t abi_dbg_version;
  118. } __packed;
  119. #endif