Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * snd_sst_tokens.h - Intel SST tokens definition
0004  *
0005  * Copyright (C) 2016 Intel Corp
0006  * Author: Shreyas NC <shreyas.nc@intel.com>
0007  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License as version 2, as
0011  * published by the Free Software Foundation.
0012  *
0013  * This program is distributed in the hope that it will be useful, but
0014  * WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * General Public License for more details.
0017  */
0018 #ifndef __SND_SST_TOKENS_H__
0019 #define __SND_SST_TOKENS_H__
0020 
0021 /**
0022  * %SKL_TKN_UUID:               Module UUID
0023  *
0024  * %SKL_TKN_U8_BLOCK_TYPE:      Type of the private data block.Can be:
0025  *                              tuples, bytes, short and words
0026  *
0027  * %SKL_TKN_U8_IN_PIN_TYPE:     Input pin type,
0028  *                              homogenous=0, heterogenous=1
0029  *
0030  * %SKL_TKN_U8_OUT_PIN_TYPE:    Output pin type,
0031  *                              homogenous=0, heterogenous=1
0032  * %SKL_TKN_U8_DYN_IN_PIN:      Configure Input pin dynamically
0033  *                              if true
0034  *
0035  * %SKL_TKN_U8_DYN_OUT_PIN:     Configure Output pin dynamically
0036  *                              if true
0037  *
0038  * %SKL_TKN_U8_IN_QUEUE_COUNT:  Store the number of Input pins
0039  *
0040  * %SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
0041  *
0042  * %SKL_TKN_U8_TIME_SLOT:       TDM slot number
0043  *
0044  * %SKL_TKN_U8_CORE_ID:         Stores module affinity value.Can take
0045  *                              the values:
0046  *                              SKL_AFFINITY_CORE_0 = 0,
0047  *                              SKL_AFFINITY_CORE_1,
0048  *                              SKL_AFFINITY_CORE_MAX
0049  *
0050  * %SKL_TKN_U8_MOD_TYPE:        Module type value.
0051  *
0052  * %SKL_TKN_U8_CONN_TYPE:       Module connection type can be a FE,
0053  *                              BE or NONE as defined :
0054  *                              SKL_PIPE_CONN_TYPE_NONE = 0,
0055  *                              SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA)
0056  *                              SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA)
0057  *
0058  * %SKL_TKN_U8_DEV_TYPE:        Type of device to which the module is
0059  *                              connected
0060  *                              Can take the values:
0061  *                              SKL_DEVICE_BT = 0x0,
0062  *                              SKL_DEVICE_DMIC = 0x1,
0063  *                              SKL_DEVICE_I2S = 0x2,
0064  *                              SKL_DEVICE_SLIMBUS = 0x3,
0065  *                              SKL_DEVICE_HDALINK = 0x4,
0066  *                              SKL_DEVICE_HDAHOST = 0x5,
0067  *                              SKL_DEVICE_NONE
0068  *
0069  * %SKL_TKN_U8_HW_CONN_TYPE:    Connection type of the HW to which the
0070  *                              module is connected
0071  *                              SKL_CONN_NONE = 0,
0072  *                              SKL_CONN_SOURCE = 1,
0073  *                              SKL_CONN_SINK = 2
0074  *
0075  * %SKL_TKN_U16_PIN_INST_ID:    Stores the pin instance id
0076  *
0077  * %SKL_TKN_U16_MOD_INST_ID:    Stores the mdule instance id
0078  *
0079  * %SKL_TKN_U32_MAX_MCPS:       Module max mcps value
0080  *
0081  * %SKL_TKN_U32_MEM_PAGES:      Module resource pages
0082  *
0083  * %SKL_TKN_U32_OBS:            Stores Output Buffer size
0084  *
0085  * %SKL_TKN_U32_IBS:            Stores input buffer size
0086  *
0087  * %SKL_TKN_U32_VBUS_ID:        Module VBUS_ID. PDM=0, SSP0=0,
0088  *                              SSP1=1,SSP2=2,
0089  *                              SSP3=3, SSP4=4,
0090  *                              SSP5=5, SSP6=6,INVALID
0091  *
0092  * %SKL_TKN_U32_PARAMS_FIXUP:   Module Params fixup mask
0093  * %SKL_TKN_U32_CONVERTER:      Module params converter mask
0094  * %SKL_TKN_U32_PIPE_ID:        Stores the pipe id
0095  *
0096  * %SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
0097  *                              connected to. It can be
0098  *                              SKL_PIPE_CONN_TYPE_NONE = 0,
0099  *                              SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA),
0100  *                              SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA),
0101  *
0102  * %SKL_TKN_U32_PIPE_PRIORITY:  Pipe priority value
0103  * %SKL_TKN_U32_PIPE_MEM_PGS:   Pipe resource pages
0104  *
0105  * %SKL_TKN_U32_DIR_PIN_COUNT:  Value for the direction to set input/output
0106  *                              formats and the pin count.
0107  *                              The first 4 bits have the direction
0108  *                              value and the next 4 have
0109  *                              the pin count value.
0110  *                              SKL_DIR_IN = 0, SKL_DIR_OUT = 1.
0111  *                              The input and output formats
0112  *                              share the same set of tokens
0113  *                              with the distinction between input
0114  *                              and output made by reading direction
0115  *                              token.
0116  *
0117  * %SKL_TKN_U32_FMT_CH:         Supported channel count
0118  *
0119  * %SKL_TKN_U32_FMT_FREQ:       Supported frequency/sample rate
0120  *
0121  * %SKL_TKN_U32_FMT_BIT_DEPTH:  Supported container size
0122  *
0123  * %SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
0124  *
0125  * %SKL_TKN_U32_FMT_CH_CONFIG:  Supported channel configurations for the
0126  *                              input/output.
0127  *
0128  * %SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
0129  *                              channel or per sample. The values can be :
0130  *                              SKL_INTERLEAVING_PER_CHANNEL = 0,
0131  *                              SKL_INTERLEAVING_PER_SAMPLE = 1,
0132  *
0133  * %SKL_TKN_U32_FMT_SAMPLE_TYPE:
0134  *                              Specifies the sample type. Can take the
0135  *                              values: SKL_SAMPLE_TYPE_INT_MSB = 0,
0136  *                              SKL_SAMPLE_TYPE_INT_LSB = 1,
0137  *                              SKL_SAMPLE_TYPE_INT_SIGNED = 2,
0138  *                              SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
0139  *                              SKL_SAMPLE_TYPE_FLOAT = 4
0140  *
0141  * %SKL_TKN_U32_CH_MAP:         Channel map values
0142  * %SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
0143  *                              SKL_PARAM_DEFAULT, SKL_PARAM_INIT,
0144  *                              SKL_PARAM_SET, SKL_PARAM_BIND
0145  *
0146  * %SKL_TKN_U32_MOD_PARAM_ID:   ID of the module params
0147  *
0148  * %SKL_TKN_U32_CAPS_SET_PARAMS:
0149  *                              Set params value
0150  *
0151  * %SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
0152  *
0153  * %SKL_TKN_U32_CAPS_SIZE:      Caps size
0154  *
0155  * %SKL_TKN_U32_PROC_DOMAIN:    Specify processing domain
0156  *
0157  * %SKL_TKN_U32_LIB_COUNT:      Specifies the number of libraries
0158  *
0159  * %SKL_TKN_STR_LIB_NAME:       Specifies the library name
0160  *
0161  * %SKL_TKN_U32_PMODE:      Specifies the power mode for pipe
0162  *
0163  * %SKL_TKL_U32_D0I3_CAPS:  Specifies the D0i3 capability for module
0164  *
0165  * %SKL_TKN_U32_DMA_BUF_SIZE:   DMA buffer size in millisec
0166  *
0167  * %SKL_TKN_U32_PIPE_DIR:       Specifies pipe direction. Can be
0168  *                              playback/capture.
0169  *
0170  * %SKL_TKN_U32_NUM_CONFIGS:    Number of pipe configs
0171  *
0172  * %SKL_TKN_U32_PATH_MEM_PGS:   Size of memory (in pages) required for pipeline
0173  *                              and its data
0174  *
0175  * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
0176  *                              and PCM params supported by that pipe
0177  *                              config. This is used as index to fill
0178  *                              up the pipe config and module config
0179  *                              structure.
0180  *
0181  * %SKL_TKN_U32_CFG_FREQ:
0182  * %SKL_TKN_U8_CFG_CHAN:
0183  * %SKL_TKN_U8_CFG_BPS:         PCM params (freq, channels, bits per sample)
0184  *                              supported for each of the pipe configs.
0185  *
0186  * %SKL_TKN_CFG_MOD_RES_ID:     Module's resource index for each of the
0187  *                              pipe config
0188  *
0189  * %SKL_TKN_CFG_MOD_FMT_ID:     Module's interface index for each of the
0190  *                              pipe config
0191  *
0192  * %SKL_TKN_U8_NUM_MOD:         Number of modules in the manifest
0193  *
0194  * %SKL_TKN_MM_U8_MOD_IDX:      Current index of the module in the manifest
0195  *
0196  * %SKL_TKN_MM_U8_NUM_RES:      Number of resources for the module
0197  *
0198  * %SKL_TKN_MM_U8_NUM_INTF:     Number of interfaces for the module
0199  *
0200  * %SKL_TKN_MM_U32_RES_ID:      Resource index for the resource info to
0201  *                              be filled into.
0202  *                              A module can support multiple resource
0203  *                              configuration and is represnted as a
0204  *                              resource table. This index is used to
0205  *                              fill information into appropriate index.
0206  *
0207  * %SKL_TKN_MM_U32_CPS:         DSP cycles per second
0208  *
0209  * %SKL_TKN_MM_U32_DMA_SIZE:    Allocated buffer size for gateway DMA
0210  *
0211  * %SKL_TKN_MM_U32_CPC:         DSP cycles allocated per frame
0212  *
0213  * %SKL_TKN_MM_U32_RES_PIN_ID:  Resource pin index in the module
0214  *
0215  * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
0216  *
0217  * %SKL_TKN_MM_U32_PIN_BUF:     Buffer size of the module pin
0218  *
0219  * %SKL_TKN_MM_U32_FMT_ID:      Format index for each of the interface/
0220  *                              format information to be filled into.
0221  *
0222  * %SKL_TKN_MM_U32_NUM_IN_FMT:  Number of input formats
0223  * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
0224  *
0225  * %SKL_TKN_U32_ASTATE_IDX:     Table Index for the A-State entry to be filled
0226  *                              with kcps and clock source
0227  *
0228  * %SKL_TKN_U32_ASTATE_COUNT:   Number of valid entries in A-State table
0229  *
0230  * %SKL_TKN_U32_ASTATE_KCPS:    Specifies the core load threshold (in kilo
0231  *                              cycles per second) below which DSP is clocked
0232  *                              from source specified by clock source.
0233  *
0234  * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
0235  *
0236  * %SKL_TKN_U32_FMT_CFG_IDX:    Format config index
0237  *
0238  * module_id and loadable flags dont have tokens as these values will be
0239  * read from the DSP FW manifest
0240  *
0241  * Tokens defined can be used either in the manifest or widget private data.
0242  *
0243  * SKL_TKN_MM is used as a suffix for all tokens that represent
0244  * module data in the manifest.
0245  */
0246 enum SKL_TKNS {
0247     SKL_TKN_UUID = 1,
0248     SKL_TKN_U8_NUM_BLOCKS,
0249     SKL_TKN_U8_BLOCK_TYPE,
0250     SKL_TKN_U8_IN_PIN_TYPE,
0251     SKL_TKN_U8_OUT_PIN_TYPE,
0252     SKL_TKN_U8_DYN_IN_PIN,
0253     SKL_TKN_U8_DYN_OUT_PIN,
0254     SKL_TKN_U8_IN_QUEUE_COUNT,
0255     SKL_TKN_U8_OUT_QUEUE_COUNT,
0256     SKL_TKN_U8_TIME_SLOT,
0257     SKL_TKN_U8_CORE_ID,
0258     SKL_TKN_U8_MOD_TYPE,
0259     SKL_TKN_U8_CONN_TYPE,
0260     SKL_TKN_U8_DEV_TYPE,
0261     SKL_TKN_U8_HW_CONN_TYPE,
0262     SKL_TKN_U16_MOD_INST_ID,
0263     SKL_TKN_U16_BLOCK_SIZE,
0264     SKL_TKN_U32_MAX_MCPS,
0265     SKL_TKN_U32_MEM_PAGES,
0266     SKL_TKN_U32_OBS,
0267     SKL_TKN_U32_IBS,
0268     SKL_TKN_U32_VBUS_ID,
0269     SKL_TKN_U32_PARAMS_FIXUP,
0270     SKL_TKN_U32_CONVERTER,
0271     SKL_TKN_U32_PIPE_ID,
0272     SKL_TKN_U32_PIPE_CONN_TYPE,
0273     SKL_TKN_U32_PIPE_PRIORITY,
0274     SKL_TKN_U32_PIPE_MEM_PGS,
0275     SKL_TKN_U32_DIR_PIN_COUNT,
0276     SKL_TKN_U32_FMT_CH,
0277     SKL_TKN_U32_FMT_FREQ,
0278     SKL_TKN_U32_FMT_BIT_DEPTH,
0279     SKL_TKN_U32_FMT_SAMPLE_SIZE,
0280     SKL_TKN_U32_FMT_CH_CONFIG,
0281     SKL_TKN_U32_FMT_INTERLEAVE,
0282     SKL_TKN_U32_FMT_SAMPLE_TYPE,
0283     SKL_TKN_U32_FMT_CH_MAP,
0284     SKL_TKN_U32_PIN_MOD_ID,
0285     SKL_TKN_U32_PIN_INST_ID,
0286     SKL_TKN_U32_MOD_SET_PARAMS,
0287     SKL_TKN_U32_MOD_PARAM_ID,
0288     SKL_TKN_U32_CAPS_SET_PARAMS,
0289     SKL_TKN_U32_CAPS_PARAMS_ID,
0290     SKL_TKN_U32_CAPS_SIZE,
0291     SKL_TKN_U32_PROC_DOMAIN,
0292     SKL_TKN_U32_LIB_COUNT,
0293     SKL_TKN_STR_LIB_NAME,
0294     SKL_TKN_U32_PMODE,
0295     SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
0296     SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
0297     SKL_TKN_U32_DMA_BUF_SIZE,
0298 
0299     SKL_TKN_U32_PIPE_DIRECTION,
0300     SKL_TKN_U32_PIPE_CONFIG_ID,
0301     SKL_TKN_U32_NUM_CONFIGS,
0302     SKL_TKN_U32_PATH_MEM_PGS,
0303 
0304     SKL_TKN_U32_CFG_FREQ,
0305     SKL_TKN_U8_CFG_CHAN,
0306     SKL_TKN_U8_CFG_BPS,
0307     SKL_TKN_CFG_MOD_RES_ID,
0308     SKL_TKN_CFG_MOD_FMT_ID,
0309     SKL_TKN_U8_NUM_MOD,
0310 
0311     SKL_TKN_MM_U8_MOD_IDX,
0312     SKL_TKN_MM_U8_NUM_RES,
0313     SKL_TKN_MM_U8_NUM_INTF,
0314     SKL_TKN_MM_U32_RES_ID,
0315     SKL_TKN_MM_U32_CPS,
0316     SKL_TKN_MM_U32_DMA_SIZE,
0317     SKL_TKN_MM_U32_CPC,
0318     SKL_TKN_MM_U32_RES_PIN_ID,
0319     SKL_TKN_MM_U32_INTF_PIN_ID,
0320     SKL_TKN_MM_U32_PIN_BUF,
0321     SKL_TKN_MM_U32_FMT_ID,
0322     SKL_TKN_MM_U32_NUM_IN_FMT,
0323     SKL_TKN_MM_U32_NUM_OUT_FMT,
0324 
0325     SKL_TKN_U32_ASTATE_IDX,
0326     SKL_TKN_U32_ASTATE_COUNT,
0327     SKL_TKN_U32_ASTATE_KCPS,
0328     SKL_TKN_U32_ASTATE_CLK_SRC,
0329 
0330     SKL_TKN_U32_FMT_CFG_IDX = 96,
0331     SKL_TKN_MAX = SKL_TKN_U32_FMT_CFG_IDX,
0332 };
0333 
0334 #endif