snd_sst_tokens.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * snd_sst_tokens.h - Intel SST tokens definition
  4. *
  5. * Copyright (C) 2016 Intel Corp
  6. * Author: Shreyas NC <shreyas.nc@intel.com>
  7. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #ifndef __SND_SST_TOKENS_H__
  19. #define __SND_SST_TOKENS_H__
  20. /**
  21. * %SKL_TKN_UUID: Module UUID
  22. *
  23. * %SKL_TKN_U8_BLOCK_TYPE: Type of the private data block.Can be:
  24. * tuples, bytes, short and words
  25. *
  26. * %SKL_TKN_U8_IN_PIN_TYPE: Input pin type,
  27. * homogenous=0, heterogenous=1
  28. *
  29. * %SKL_TKN_U8_OUT_PIN_TYPE: Output pin type,
  30. * homogenous=0, heterogenous=1
  31. * %SKL_TKN_U8_DYN_IN_PIN: Configure Input pin dynamically
  32. * if true
  33. *
  34. * %SKL_TKN_U8_DYN_OUT_PIN: Configure Output pin dynamically
  35. * if true
  36. *
  37. * %SKL_TKN_U8_IN_QUEUE_COUNT: Store the number of Input pins
  38. *
  39. * %SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
  40. *
  41. * %SKL_TKN_U8_TIME_SLOT: TDM slot number
  42. *
  43. * %SKL_TKN_U8_CORE_ID: Stores module affinity value.Can take
  44. * the values:
  45. * SKL_AFFINITY_CORE_0 = 0,
  46. * SKL_AFFINITY_CORE_1,
  47. * SKL_AFFINITY_CORE_MAX
  48. *
  49. * %SKL_TKN_U8_MOD_TYPE: Module type value.
  50. *
  51. * %SKL_TKN_U8_CONN_TYPE: Module connection type can be a FE,
  52. * BE or NONE as defined :
  53. * SKL_PIPE_CONN_TYPE_NONE = 0,
  54. * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA)
  55. * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA)
  56. *
  57. * %SKL_TKN_U8_DEV_TYPE: Type of device to which the module is
  58. * connected
  59. * Can take the values:
  60. * SKL_DEVICE_BT = 0x0,
  61. * SKL_DEVICE_DMIC = 0x1,
  62. * SKL_DEVICE_I2S = 0x2,
  63. * SKL_DEVICE_SLIMBUS = 0x3,
  64. * SKL_DEVICE_HDALINK = 0x4,
  65. * SKL_DEVICE_HDAHOST = 0x5,
  66. * SKL_DEVICE_NONE
  67. *
  68. * %SKL_TKN_U8_HW_CONN_TYPE: Connection type of the HW to which the
  69. * module is connected
  70. * SKL_CONN_NONE = 0,
  71. * SKL_CONN_SOURCE = 1,
  72. * SKL_CONN_SINK = 2
  73. *
  74. * %SKL_TKN_U16_PIN_INST_ID: Stores the pin instance id
  75. *
  76. * %SKL_TKN_U16_MOD_INST_ID: Stores the mdule instance id
  77. *
  78. * %SKL_TKN_U32_MAX_MCPS: Module max mcps value
  79. *
  80. * %SKL_TKN_U32_MEM_PAGES: Module resource pages
  81. *
  82. * %SKL_TKN_U32_OBS: Stores Output Buffer size
  83. *
  84. * %SKL_TKN_U32_IBS: Stores input buffer size
  85. *
  86. * %SKL_TKN_U32_VBUS_ID: Module VBUS_ID. PDM=0, SSP0=0,
  87. * SSP1=1,SSP2=2,
  88. * SSP3=3, SSP4=4,
  89. * SSP5=5, SSP6=6,INVALID
  90. *
  91. * %SKL_TKN_U32_PARAMS_FIXUP: Module Params fixup mask
  92. * %SKL_TKN_U32_CONVERTER: Module params converter mask
  93. * %SKL_TKN_U32_PIPE_ID: Stores the pipe id
  94. *
  95. * %SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
  96. * connected to. It can be
  97. * SKL_PIPE_CONN_TYPE_NONE = 0,
  98. * SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA),
  99. * SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA),
  100. *
  101. * %SKL_TKN_U32_PIPE_PRIORITY: Pipe priority value
  102. * %SKL_TKN_U32_PIPE_MEM_PGS: Pipe resource pages
  103. *
  104. * %SKL_TKN_U32_DIR_PIN_COUNT: Value for the direction to set input/output
  105. * formats and the pin count.
  106. * The first 4 bits have the direction
  107. * value and the next 4 have
  108. * the pin count value.
  109. * SKL_DIR_IN = 0, SKL_DIR_OUT = 1.
  110. * The input and output formats
  111. * share the same set of tokens
  112. * with the distinction between input
  113. * and output made by reading direction
  114. * token.
  115. *
  116. * %SKL_TKN_U32_FMT_CH: Supported channel count
  117. *
  118. * %SKL_TKN_U32_FMT_FREQ: Supported frequency/sample rate
  119. *
  120. * %SKL_TKN_U32_FMT_BIT_DEPTH: Supported container size
  121. *
  122. * %SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
  123. *
  124. * %SKL_TKN_U32_FMT_CH_CONFIG: Supported channel configurations for the
  125. * input/output.
  126. *
  127. * %SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
  128. * channel or per sample. The values can be :
  129. * SKL_INTERLEAVING_PER_CHANNEL = 0,
  130. * SKL_INTERLEAVING_PER_SAMPLE = 1,
  131. *
  132. * %SKL_TKN_U32_FMT_SAMPLE_TYPE:
  133. * Specifies the sample type. Can take the
  134. * values: SKL_SAMPLE_TYPE_INT_MSB = 0,
  135. * SKL_SAMPLE_TYPE_INT_LSB = 1,
  136. * SKL_SAMPLE_TYPE_INT_SIGNED = 2,
  137. * SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
  138. * SKL_SAMPLE_TYPE_FLOAT = 4
  139. *
  140. * %SKL_TKN_U32_CH_MAP: Channel map values
  141. * %SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
  142. * SKL_PARAM_DEFAULT, SKL_PARAM_INIT,
  143. * SKL_PARAM_SET, SKL_PARAM_BIND
  144. *
  145. * %SKL_TKN_U32_MOD_PARAM_ID: ID of the module params
  146. *
  147. * %SKL_TKN_U32_CAPS_SET_PARAMS:
  148. * Set params value
  149. *
  150. * %SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
  151. *
  152. * %SKL_TKN_U32_CAPS_SIZE: Caps size
  153. *
  154. * %SKL_TKN_U32_PROC_DOMAIN: Specify processing domain
  155. *
  156. * %SKL_TKN_U32_LIB_COUNT: Specifies the number of libraries
  157. *
  158. * %SKL_TKN_STR_LIB_NAME: Specifies the library name
  159. *
  160. * %SKL_TKN_U32_PMODE: Specifies the power mode for pipe
  161. *
  162. * %SKL_TKL_U32_D0I3_CAPS: Specifies the D0i3 capability for module
  163. *
  164. * %SKL_TKN_U32_DMA_BUF_SIZE: DMA buffer size in millisec
  165. *
  166. * %SKL_TKN_U32_PIPE_DIR: Specifies pipe direction. Can be
  167. * playback/capture.
  168. *
  169. * %SKL_TKN_U32_NUM_CONFIGS: Number of pipe configs
  170. *
  171. * %SKL_TKN_U32_PATH_MEM_PGS: Size of memory (in pages) required for pipeline
  172. * and its data
  173. *
  174. * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
  175. * and PCM params supported by that pipe
  176. * config. This is used as index to fill
  177. * up the pipe config and module config
  178. * structure.
  179. *
  180. * %SKL_TKN_U32_CFG_FREQ:
  181. * %SKL_TKN_U8_CFG_CHAN:
  182. * %SKL_TKN_U8_CFG_BPS: PCM params (freq, channels, bits per sample)
  183. * supported for each of the pipe configs.
  184. *
  185. * %SKL_TKN_CFG_MOD_RES_ID: Module's resource index for each of the
  186. * pipe config
  187. *
  188. * %SKL_TKN_CFG_MOD_FMT_ID: Module's interface index for each of the
  189. * pipe config
  190. *
  191. * %SKL_TKN_U8_NUM_MOD: Number of modules in the manifest
  192. *
  193. * %SKL_TKN_MM_U8_MOD_IDX: Current index of the module in the manifest
  194. *
  195. * %SKL_TKN_MM_U8_NUM_RES: Number of resources for the module
  196. *
  197. * %SKL_TKN_MM_U8_NUM_INTF: Number of interfaces for the module
  198. *
  199. * %SKL_TKN_MM_U32_RES_ID: Resource index for the resource info to
  200. * be filled into.
  201. * A module can support multiple resource
  202. * configuration and is represnted as a
  203. * resource table. This index is used to
  204. * fill information into appropriate index.
  205. *
  206. * %SKL_TKN_MM_U32_CPS: DSP cycles per second
  207. *
  208. * %SKL_TKN_MM_U32_DMA_SIZE: Allocated buffer size for gateway DMA
  209. *
  210. * %SKL_TKN_MM_U32_CPC: DSP cycles allocated per frame
  211. *
  212. * %SKL_TKN_MM_U32_RES_PIN_ID: Resource pin index in the module
  213. *
  214. * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
  215. *
  216. * %SKL_TKN_MM_U32_PIN_BUF: Buffer size of the module pin
  217. *
  218. * %SKL_TKN_MM_U32_FMT_ID: Format index for each of the interface/
  219. * format information to be filled into.
  220. *
  221. * %SKL_TKN_MM_U32_NUM_IN_FMT: Number of input formats
  222. * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
  223. *
  224. * %SKL_TKN_U32_ASTATE_IDX: Table Index for the A-State entry to be filled
  225. * with kcps and clock source
  226. *
  227. * %SKL_TKN_U32_ASTATE_COUNT: Number of valid entries in A-State table
  228. *
  229. * %SKL_TKN_U32_ASTATE_KCPS: Specifies the core load threshold (in kilo
  230. * cycles per second) below which DSP is clocked
  231. * from source specified by clock source.
  232. *
  233. * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
  234. *
  235. * module_id and loadable flags dont have tokens as these values will be
  236. * read from the DSP FW manifest
  237. *
  238. * Tokens defined can be used either in the manifest or widget private data.
  239. *
  240. * SKL_TKN_MM is used as a suffix for all tokens that represent
  241. * module data in the manifest.
  242. */
  243. enum SKL_TKNS {
  244. SKL_TKN_UUID = 1,
  245. SKL_TKN_U8_NUM_BLOCKS,
  246. SKL_TKN_U8_BLOCK_TYPE,
  247. SKL_TKN_U8_IN_PIN_TYPE,
  248. SKL_TKN_U8_OUT_PIN_TYPE,
  249. SKL_TKN_U8_DYN_IN_PIN,
  250. SKL_TKN_U8_DYN_OUT_PIN,
  251. SKL_TKN_U8_IN_QUEUE_COUNT,
  252. SKL_TKN_U8_OUT_QUEUE_COUNT,
  253. SKL_TKN_U8_TIME_SLOT,
  254. SKL_TKN_U8_CORE_ID,
  255. SKL_TKN_U8_MOD_TYPE,
  256. SKL_TKN_U8_CONN_TYPE,
  257. SKL_TKN_U8_DEV_TYPE,
  258. SKL_TKN_U8_HW_CONN_TYPE,
  259. SKL_TKN_U16_MOD_INST_ID,
  260. SKL_TKN_U16_BLOCK_SIZE,
  261. SKL_TKN_U32_MAX_MCPS,
  262. SKL_TKN_U32_MEM_PAGES,
  263. SKL_TKN_U32_OBS,
  264. SKL_TKN_U32_IBS,
  265. SKL_TKN_U32_VBUS_ID,
  266. SKL_TKN_U32_PARAMS_FIXUP,
  267. SKL_TKN_U32_CONVERTER,
  268. SKL_TKN_U32_PIPE_ID,
  269. SKL_TKN_U32_PIPE_CONN_TYPE,
  270. SKL_TKN_U32_PIPE_PRIORITY,
  271. SKL_TKN_U32_PIPE_MEM_PGS,
  272. SKL_TKN_U32_DIR_PIN_COUNT,
  273. SKL_TKN_U32_FMT_CH,
  274. SKL_TKN_U32_FMT_FREQ,
  275. SKL_TKN_U32_FMT_BIT_DEPTH,
  276. SKL_TKN_U32_FMT_SAMPLE_SIZE,
  277. SKL_TKN_U32_FMT_CH_CONFIG,
  278. SKL_TKN_U32_FMT_INTERLEAVE,
  279. SKL_TKN_U32_FMT_SAMPLE_TYPE,
  280. SKL_TKN_U32_FMT_CH_MAP,
  281. SKL_TKN_U32_PIN_MOD_ID,
  282. SKL_TKN_U32_PIN_INST_ID,
  283. SKL_TKN_U32_MOD_SET_PARAMS,
  284. SKL_TKN_U32_MOD_PARAM_ID,
  285. SKL_TKN_U32_CAPS_SET_PARAMS,
  286. SKL_TKN_U32_CAPS_PARAMS_ID,
  287. SKL_TKN_U32_CAPS_SIZE,
  288. SKL_TKN_U32_PROC_DOMAIN,
  289. SKL_TKN_U32_LIB_COUNT,
  290. SKL_TKN_STR_LIB_NAME,
  291. SKL_TKN_U32_PMODE,
  292. SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
  293. SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
  294. SKL_TKN_U32_DMA_BUF_SIZE,
  295. SKL_TKN_U32_PIPE_DIRECTION,
  296. SKL_TKN_U32_PIPE_CONFIG_ID,
  297. SKL_TKN_U32_NUM_CONFIGS,
  298. SKL_TKN_U32_PATH_MEM_PGS,
  299. SKL_TKN_U32_CFG_FREQ,
  300. SKL_TKN_U8_CFG_CHAN,
  301. SKL_TKN_U8_CFG_BPS,
  302. SKL_TKN_CFG_MOD_RES_ID,
  303. SKL_TKN_CFG_MOD_FMT_ID,
  304. SKL_TKN_U8_NUM_MOD,
  305. SKL_TKN_MM_U8_MOD_IDX,
  306. SKL_TKN_MM_U8_NUM_RES,
  307. SKL_TKN_MM_U8_NUM_INTF,
  308. SKL_TKN_MM_U32_RES_ID,
  309. SKL_TKN_MM_U32_CPS,
  310. SKL_TKN_MM_U32_DMA_SIZE,
  311. SKL_TKN_MM_U32_CPC,
  312. SKL_TKN_MM_U32_RES_PIN_ID,
  313. SKL_TKN_MM_U32_INTF_PIN_ID,
  314. SKL_TKN_MM_U32_PIN_BUF,
  315. SKL_TKN_MM_U32_FMT_ID,
  316. SKL_TKN_MM_U32_NUM_IN_FMT,
  317. SKL_TKN_MM_U32_NUM_OUT_FMT,
  318. SKL_TKN_U32_ASTATE_IDX,
  319. SKL_TKN_U32_ASTATE_COUNT,
  320. SKL_TKN_U32_ASTATE_KCPS,
  321. SKL_TKN_U32_ASTATE_CLK_SRC,
  322. SKL_TKN_MAX = SKL_TKN_U32_ASTATE_CLK_SRC,
  323. };
  324. #endif