12879516fSCezary Rojewski /* SPDX-License-Identifier: GPL-2.0-only */ 22879516fSCezary Rojewski /* 32879516fSCezary Rojewski * Copyright(c) 2021-2022 Intel Corporation. All rights reserved. 42879516fSCezary Rojewski * 52879516fSCezary Rojewski * Authors: Cezary Rojewski <cezary.rojewski@intel.com> 62879516fSCezary Rojewski * Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com> 72879516fSCezary Rojewski */ 82879516fSCezary Rojewski 92879516fSCezary Rojewski #ifndef __SOUND_SOC_INTEL_AVS_MSGS_H 102879516fSCezary Rojewski #define __SOUND_SOC_INTEL_AVS_MSGS_H 112879516fSCezary Rojewski 122879516fSCezary Rojewski struct avs_dev; 132879516fSCezary Rojewski 142879516fSCezary Rojewski #define AVS_MAILBOX_SIZE 4096 152879516fSCezary Rojewski 162879516fSCezary Rojewski enum avs_msg_target { 172879516fSCezary Rojewski AVS_FW_GEN_MSG = 0, 182879516fSCezary Rojewski AVS_MOD_MSG = 1 192879516fSCezary Rojewski }; 202879516fSCezary Rojewski 212879516fSCezary Rojewski enum avs_msg_direction { 222879516fSCezary Rojewski AVS_MSG_REQUEST = 0, 232879516fSCezary Rojewski AVS_MSG_REPLY = 1 242879516fSCezary Rojewski }; 252879516fSCezary Rojewski 262879516fSCezary Rojewski enum avs_global_msg_type { 2725f414fcSCezary Rojewski AVS_GLB_ROM_CONTROL = 1, 28cb1eb6b5SCezary Rojewski AVS_GLB_LOAD_MULTIPLE_MODULES = 15, 29cb1eb6b5SCezary Rojewski AVS_GLB_UNLOAD_MULTIPLE_MODULES = 16, 30b956b27bSCezary Rojewski AVS_GLB_CREATE_PIPELINE = 17, 31b956b27bSCezary Rojewski AVS_GLB_DELETE_PIPELINE = 18, 32b956b27bSCezary Rojewski AVS_GLB_SET_PIPELINE_STATE = 19, 33b956b27bSCezary Rojewski AVS_GLB_GET_PIPELINE_STATE = 20, 34cb1eb6b5SCezary Rojewski AVS_GLB_LOAD_LIBRARY = 24, 352879516fSCezary Rojewski AVS_GLB_NOTIFICATION = 27, 362879516fSCezary Rojewski }; 372879516fSCezary Rojewski 382879516fSCezary Rojewski union avs_global_msg { 392879516fSCezary Rojewski u64 val; 402879516fSCezary Rojewski struct { 412879516fSCezary Rojewski union { 422879516fSCezary Rojewski u32 primary; 432879516fSCezary Rojewski struct { 442879516fSCezary Rojewski u32 rsvd:24; 452879516fSCezary Rojewski u32 global_msg_type:5; 462879516fSCezary Rojewski u32 msg_direction:1; 472879516fSCezary Rojewski u32 msg_target:1; 482879516fSCezary Rojewski }; 4925f414fcSCezary Rojewski /* set boot config */ 5025f414fcSCezary Rojewski struct { 5125f414fcSCezary Rojewski u32 rom_ctrl_msg_type:9; 5225f414fcSCezary Rojewski u32 dma_id:5; 5325f414fcSCezary Rojewski u32 purge_request:1; 5425f414fcSCezary Rojewski } boot_cfg; 55cb1eb6b5SCezary Rojewski /* module loading */ 56cb1eb6b5SCezary Rojewski struct { 57cb1eb6b5SCezary Rojewski u32 mod_cnt:8; 58cb1eb6b5SCezary Rojewski } load_multi_mods; 59b956b27bSCezary Rojewski /* pipeline management */ 60b956b27bSCezary Rojewski struct { 61b956b27bSCezary Rojewski u32 ppl_mem_size:11; 62b956b27bSCezary Rojewski u32 ppl_priority:5; 63b956b27bSCezary Rojewski u32 instance_id:8; 64b956b27bSCezary Rojewski } create_ppl; 65b956b27bSCezary Rojewski struct { 66b956b27bSCezary Rojewski u32 rsvd:16; 67b956b27bSCezary Rojewski u32 instance_id:8; 68b956b27bSCezary Rojewski } ppl; /* generic ppl request */ 69b956b27bSCezary Rojewski struct { 70b956b27bSCezary Rojewski u32 state:16; 71b956b27bSCezary Rojewski u32 ppl_id:8; 72b956b27bSCezary Rojewski } set_ppl_state; 73b956b27bSCezary Rojewski struct { 74b956b27bSCezary Rojewski u32 ppl_id:8; 75b956b27bSCezary Rojewski } get_ppl_state; 76cb1eb6b5SCezary Rojewski /* library loading */ 77cb1eb6b5SCezary Rojewski struct { 78cb1eb6b5SCezary Rojewski u32 dma_id:5; 79cb1eb6b5SCezary Rojewski u32 rsvd:11; 80cb1eb6b5SCezary Rojewski u32 lib_id:4; 81cb1eb6b5SCezary Rojewski } load_lib; 822879516fSCezary Rojewski }; 832879516fSCezary Rojewski union { 842879516fSCezary Rojewski u32 val; 85b956b27bSCezary Rojewski /* pipeline management */ 86b956b27bSCezary Rojewski struct { 87b956b27bSCezary Rojewski u32 lp:1; /* low power flag */ 88b956b27bSCezary Rojewski u32 rsvd:3; 89b956b27bSCezary Rojewski u32 attributes:16; /* additional scheduling flags */ 90b956b27bSCezary Rojewski } create_ppl; 912879516fSCezary Rojewski } ext; 922879516fSCezary Rojewski }; 932879516fSCezary Rojewski } __packed; 942879516fSCezary Rojewski 952879516fSCezary Rojewski struct avs_tlv { 962879516fSCezary Rojewski u32 type; 972879516fSCezary Rojewski u32 length; 982879516fSCezary Rojewski u32 value[]; 992879516fSCezary Rojewski } __packed; 1002879516fSCezary Rojewski 101f14a1c5aSCezary Rojewski enum avs_module_msg_type { 102f14a1c5aSCezary Rojewski AVS_MOD_INIT_INSTANCE = 0, 103f14a1c5aSCezary Rojewski AVS_MOD_LARGE_CONFIG_GET = 3, 104f14a1c5aSCezary Rojewski AVS_MOD_LARGE_CONFIG_SET = 4, 105f14a1c5aSCezary Rojewski AVS_MOD_BIND = 5, 106f14a1c5aSCezary Rojewski AVS_MOD_UNBIND = 6, 107469e87caSCezary Rojewski AVS_MOD_SET_DX = 7, 108469e87caSCezary Rojewski AVS_MOD_SET_D0IX = 8, 109f14a1c5aSCezary Rojewski AVS_MOD_DELETE_INSTANCE = 11, 110f14a1c5aSCezary Rojewski }; 111f14a1c5aSCezary Rojewski 1122879516fSCezary Rojewski union avs_module_msg { 1132879516fSCezary Rojewski u64 val; 1142879516fSCezary Rojewski struct { 1152879516fSCezary Rojewski union { 1162879516fSCezary Rojewski u32 primary; 1172879516fSCezary Rojewski struct { 1182879516fSCezary Rojewski u32 module_id:16; 1192879516fSCezary Rojewski u32 instance_id:8; 1202879516fSCezary Rojewski u32 module_msg_type:5; 1212879516fSCezary Rojewski u32 msg_direction:1; 1222879516fSCezary Rojewski u32 msg_target:1; 1232879516fSCezary Rojewski }; 1242879516fSCezary Rojewski }; 1252879516fSCezary Rojewski union { 1262879516fSCezary Rojewski u32 val; 127f14a1c5aSCezary Rojewski struct { 128f14a1c5aSCezary Rojewski u32 param_block_size:16; 129f14a1c5aSCezary Rojewski u32 ppl_instance_id:8; 130f14a1c5aSCezary Rojewski u32 core_id:4; 131f14a1c5aSCezary Rojewski u32 proc_domain:1; 132f14a1c5aSCezary Rojewski } init_instance; 133f14a1c5aSCezary Rojewski struct { 134f14a1c5aSCezary Rojewski u32 data_off_size:20; 135f14a1c5aSCezary Rojewski u32 large_param_id:8; 136f14a1c5aSCezary Rojewski u32 final_block:1; 137f14a1c5aSCezary Rojewski u32 init_block:1; 138f14a1c5aSCezary Rojewski } large_config; 139f14a1c5aSCezary Rojewski struct { 140f14a1c5aSCezary Rojewski u32 dst_module_id:16; 141f14a1c5aSCezary Rojewski u32 dst_instance_id:8; 142f14a1c5aSCezary Rojewski u32 dst_queue:3; 143f14a1c5aSCezary Rojewski u32 src_queue:3; 144f14a1c5aSCezary Rojewski } bind_unbind; 145469e87caSCezary Rojewski struct { 146469e87caSCezary Rojewski u32 wake:1; 147469e87caSCezary Rojewski u32 streaming:1; 148469e87caSCezary Rojewski } set_d0ix; 1492879516fSCezary Rojewski } ext; 1502879516fSCezary Rojewski }; 1512879516fSCezary Rojewski } __packed; 1522879516fSCezary Rojewski 1532879516fSCezary Rojewski union avs_reply_msg { 1542879516fSCezary Rojewski u64 val; 1552879516fSCezary Rojewski struct { 1562879516fSCezary Rojewski union { 1572879516fSCezary Rojewski u32 primary; 1582879516fSCezary Rojewski struct { 1592879516fSCezary Rojewski u32 status:24; 1602879516fSCezary Rojewski u32 global_msg_type:5; 1612879516fSCezary Rojewski u32 msg_direction:1; 1622879516fSCezary Rojewski u32 msg_target:1; 1632879516fSCezary Rojewski }; 1642879516fSCezary Rojewski }; 1652879516fSCezary Rojewski union { 1662879516fSCezary Rojewski u32 val; 167cb1eb6b5SCezary Rojewski /* module loading */ 168cb1eb6b5SCezary Rojewski struct { 169cb1eb6b5SCezary Rojewski u32 err_mod_id:16; 170cb1eb6b5SCezary Rojewski } load_multi_mods; 171b956b27bSCezary Rojewski /* pipeline management */ 172b956b27bSCezary Rojewski struct { 173b956b27bSCezary Rojewski u32 state:5; 174b956b27bSCezary Rojewski } get_ppl_state; 175f14a1c5aSCezary Rojewski /* module management */ 176f14a1c5aSCezary Rojewski struct { 177f14a1c5aSCezary Rojewski u32 data_off_size:20; 178f14a1c5aSCezary Rojewski u32 large_param_id:8; 179f14a1c5aSCezary Rojewski u32 final_block:1; 180f14a1c5aSCezary Rojewski u32 init_block:1; 181f14a1c5aSCezary Rojewski } large_config; 1822879516fSCezary Rojewski } ext; 1832879516fSCezary Rojewski }; 1842879516fSCezary Rojewski } __packed; 1852879516fSCezary Rojewski 1862879516fSCezary Rojewski enum avs_notify_msg_type { 1872879516fSCezary Rojewski AVS_NOTIFY_PHRASE_DETECTED = 4, 1882879516fSCezary Rojewski AVS_NOTIFY_RESOURCE_EVENT = 5, 1894b86115cSCezary Rojewski AVS_NOTIFY_LOG_BUFFER_STATUS = 6, 1902879516fSCezary Rojewski AVS_NOTIFY_FW_READY = 8, 1912f1f570cSCezary Rojewski AVS_NOTIFY_EXCEPTION_CAUGHT = 10, 1922879516fSCezary Rojewski AVS_NOTIFY_MODULE_EVENT = 12, 1932879516fSCezary Rojewski }; 1942879516fSCezary Rojewski 1952879516fSCezary Rojewski union avs_notify_msg { 1962879516fSCezary Rojewski u64 val; 1972879516fSCezary Rojewski struct { 1982879516fSCezary Rojewski union { 1992879516fSCezary Rojewski u32 primary; 2002879516fSCezary Rojewski struct { 2012879516fSCezary Rojewski u32 rsvd:16; 2022879516fSCezary Rojewski u32 notify_msg_type:8; 2032879516fSCezary Rojewski u32 global_msg_type:5; 2042879516fSCezary Rojewski u32 msg_direction:1; 2052879516fSCezary Rojewski u32 msg_target:1; 2062879516fSCezary Rojewski }; 2074b86115cSCezary Rojewski struct { 2084b86115cSCezary Rojewski u16 rsvd:12; 2094b86115cSCezary Rojewski u16 core:4; 2104b86115cSCezary Rojewski } log; 2112879516fSCezary Rojewski }; 2122879516fSCezary Rojewski union { 2132879516fSCezary Rojewski u32 val; 2142f1f570cSCezary Rojewski struct { 2152f1f570cSCezary Rojewski u32 core_id:2; 2162f1f570cSCezary Rojewski u32 stack_dump_size:16; 2172f1f570cSCezary Rojewski } coredump; 2182879516fSCezary Rojewski } ext; 2192879516fSCezary Rojewski }; 2202879516fSCezary Rojewski } __packed; 2212879516fSCezary Rojewski 2222879516fSCezary Rojewski #define AVS_MSG(hdr) { .val = hdr } 2232879516fSCezary Rojewski 2242879516fSCezary Rojewski #define AVS_GLOBAL_REQUEST(msg_type) \ 2252879516fSCezary Rojewski { \ 2262879516fSCezary Rojewski .global_msg_type = AVS_GLB_##msg_type, \ 2272879516fSCezary Rojewski .msg_direction = AVS_MSG_REQUEST, \ 2282879516fSCezary Rojewski .msg_target = AVS_FW_GEN_MSG, \ 2292879516fSCezary Rojewski } 2302879516fSCezary Rojewski 2312879516fSCezary Rojewski #define AVS_MODULE_REQUEST(msg_type) \ 2322879516fSCezary Rojewski { \ 2332879516fSCezary Rojewski .module_msg_type = AVS_MOD_##msg_type, \ 2342879516fSCezary Rojewski .msg_direction = AVS_MSG_REQUEST, \ 2352879516fSCezary Rojewski .msg_target = AVS_MOD_MSG, \ 2362879516fSCezary Rojewski } 2372879516fSCezary Rojewski 2382879516fSCezary Rojewski #define AVS_NOTIFICATION(msg_type) \ 2392879516fSCezary Rojewski { \ 2402879516fSCezary Rojewski .notify_msg_type = AVS_NOTIFY_##msg_type,\ 2412879516fSCezary Rojewski .global_msg_type = AVS_GLB_NOTIFICATION,\ 2422879516fSCezary Rojewski .msg_direction = AVS_MSG_REPLY, \ 2432879516fSCezary Rojewski .msg_target = AVS_FW_GEN_MSG, \ 2442879516fSCezary Rojewski } 2452879516fSCezary Rojewski 2462879516fSCezary Rojewski #define avs_msg_is_reply(hdr) \ 2472879516fSCezary Rojewski ({ \ 2482879516fSCezary Rojewski union avs_reply_msg __msg = AVS_MSG(hdr); \ 2492879516fSCezary Rojewski __msg.msg_direction == AVS_MSG_REPLY && \ 2502879516fSCezary Rojewski __msg.global_msg_type != AVS_GLB_NOTIFICATION; \ 2512879516fSCezary Rojewski }) 2522879516fSCezary Rojewski 2532879516fSCezary Rojewski /* Notification types */ 2542879516fSCezary Rojewski 2552879516fSCezary Rojewski struct avs_notify_voice_data { 2562879516fSCezary Rojewski u16 kpd_score; 2572879516fSCezary Rojewski u16 reserved; 2582879516fSCezary Rojewski } __packed; 2592879516fSCezary Rojewski 2602879516fSCezary Rojewski struct avs_notify_res_data { 2612879516fSCezary Rojewski u32 resource_type; 2622879516fSCezary Rojewski u32 resource_id; 2632879516fSCezary Rojewski u32 event_type; 2642879516fSCezary Rojewski u32 reserved; 2652879516fSCezary Rojewski u32 data[6]; 2662879516fSCezary Rojewski } __packed; 2672879516fSCezary Rojewski 2682879516fSCezary Rojewski struct avs_notify_mod_data { 2692879516fSCezary Rojewski u32 module_instance_id; 2702879516fSCezary Rojewski u32 event_id; 2712879516fSCezary Rojewski u32 data_size; 2722879516fSCezary Rojewski u32 data[]; 2732879516fSCezary Rojewski } __packed; 2742879516fSCezary Rojewski 27525f414fcSCezary Rojewski /* ROM messages */ 27625f414fcSCezary Rojewski enum avs_rom_control_msg_type { 27725f414fcSCezary Rojewski AVS_ROM_SET_BOOT_CONFIG = 0, 27825f414fcSCezary Rojewski }; 27925f414fcSCezary Rojewski 28025f414fcSCezary Rojewski int avs_ipc_set_boot_config(struct avs_dev *adev, u32 dma_id, u32 purge); 28125f414fcSCezary Rojewski 282cb1eb6b5SCezary Rojewski /* Code loading messages */ 283cb1eb6b5SCezary Rojewski int avs_ipc_load_modules(struct avs_dev *adev, u16 *mod_ids, u32 num_mod_ids); 284cb1eb6b5SCezary Rojewski int avs_ipc_unload_modules(struct avs_dev *adev, u16 *mod_ids, u32 num_mod_ids); 285cb1eb6b5SCezary Rojewski int avs_ipc_load_library(struct avs_dev *adev, u32 dma_id, u32 lib_id); 286cb1eb6b5SCezary Rojewski 287b956b27bSCezary Rojewski /* Pipeline management messages */ 288b956b27bSCezary Rojewski enum avs_pipeline_state { 289b956b27bSCezary Rojewski AVS_PPL_STATE_INVALID, 290b956b27bSCezary Rojewski AVS_PPL_STATE_UNINITIALIZED, 291b956b27bSCezary Rojewski AVS_PPL_STATE_RESET, 292b956b27bSCezary Rojewski AVS_PPL_STATE_PAUSED, 293b956b27bSCezary Rojewski AVS_PPL_STATE_RUNNING, 294b956b27bSCezary Rojewski }; 295b956b27bSCezary Rojewski 296b956b27bSCezary Rojewski int avs_ipc_create_pipeline(struct avs_dev *adev, u16 req_size, u8 priority, 297b956b27bSCezary Rojewski u8 instance_id, bool lp, u16 attributes); 298b956b27bSCezary Rojewski int avs_ipc_delete_pipeline(struct avs_dev *adev, u8 instance_id); 299b956b27bSCezary Rojewski int avs_ipc_set_pipeline_state(struct avs_dev *adev, u8 instance_id, 300b956b27bSCezary Rojewski enum avs_pipeline_state state); 301b956b27bSCezary Rojewski int avs_ipc_get_pipeline_state(struct avs_dev *adev, u8 instance_id, 302b956b27bSCezary Rojewski enum avs_pipeline_state *state); 303b956b27bSCezary Rojewski 304f14a1c5aSCezary Rojewski /* Module management messages */ 305f14a1c5aSCezary Rojewski int avs_ipc_init_instance(struct avs_dev *adev, u16 module_id, u8 instance_id, 306f14a1c5aSCezary Rojewski u8 ppl_id, u8 core_id, u8 domain, 307f14a1c5aSCezary Rojewski void *param, u32 param_size); 308f14a1c5aSCezary Rojewski int avs_ipc_delete_instance(struct avs_dev *adev, u16 module_id, u8 instance_id); 309f14a1c5aSCezary Rojewski int avs_ipc_bind(struct avs_dev *adev, u16 module_id, u8 instance_id, 310f14a1c5aSCezary Rojewski u16 dst_module_id, u8 dst_instance_id, 311f14a1c5aSCezary Rojewski u8 dst_queue, u8 src_queue); 312f14a1c5aSCezary Rojewski int avs_ipc_unbind(struct avs_dev *adev, u16 module_id, u8 instance_id, 313f14a1c5aSCezary Rojewski u16 dst_module_id, u8 dst_instance_id, 314f14a1c5aSCezary Rojewski u8 dst_queue, u8 src_queue); 315f14a1c5aSCezary Rojewski int avs_ipc_set_large_config(struct avs_dev *adev, u16 module_id, 316f14a1c5aSCezary Rojewski u8 instance_id, u8 param_id, 317f14a1c5aSCezary Rojewski u8 *request, size_t request_size); 318f14a1c5aSCezary Rojewski int avs_ipc_get_large_config(struct avs_dev *adev, u16 module_id, u8 instance_id, 319f14a1c5aSCezary Rojewski u8 param_id, u8 *request_data, size_t request_size, 320f14a1c5aSCezary Rojewski u8 **reply_data, size_t *reply_size); 321f14a1c5aSCezary Rojewski 322469e87caSCezary Rojewski /* DSP cores and domains power management messages */ 323469e87caSCezary Rojewski struct avs_dxstate_info { 324469e87caSCezary Rojewski u32 core_mask; /* which cores are subject for power transition */ 325469e87caSCezary Rojewski u32 dx_mask; /* bit[n]=1 core n goes to D0, bit[n]=0 it goes to D3 */ 326469e87caSCezary Rojewski } __packed; 327469e87caSCezary Rojewski 328469e87caSCezary Rojewski int avs_ipc_set_dx(struct avs_dev *adev, u32 core_mask, bool powerup); 329469e87caSCezary Rojewski int avs_ipc_set_d0ix(struct avs_dev *adev, bool enable_pg, bool streaming); 330469e87caSCezary Rojewski 3313322e168SCezary Rojewski /* Base-firmware runtime parameters */ 3323322e168SCezary Rojewski 3333322e168SCezary Rojewski #define AVS_BASEFW_MOD_ID 0 3343322e168SCezary Rojewski #define AVS_BASEFW_INST_ID 0 3353322e168SCezary Rojewski 3363322e168SCezary Rojewski enum avs_basefw_runtime_param { 3374b86115cSCezary Rojewski AVS_BASEFW_ENABLE_LOGS = 6, 3383322e168SCezary Rojewski AVS_BASEFW_FIRMWARE_CONFIG = 7, 3393322e168SCezary Rojewski AVS_BASEFW_HARDWARE_CONFIG = 8, 3403322e168SCezary Rojewski AVS_BASEFW_MODULES_INFO = 9, 3413322e168SCezary Rojewski AVS_BASEFW_LIBRARIES_INFO = 16, 3424b86115cSCezary Rojewski AVS_BASEFW_SYSTEM_TIME = 20, 3433322e168SCezary Rojewski }; 3443322e168SCezary Rojewski 3454b86115cSCezary Rojewski enum avs_log_enable { 3464b86115cSCezary Rojewski AVS_LOG_DISABLE = 0, 3474b86115cSCezary Rojewski AVS_LOG_ENABLE = 1 3484b86115cSCezary Rojewski }; 3494b86115cSCezary Rojewski 350b3e29075SCezary Rojewski enum avs_skl_log_priority { 351b3e29075SCezary Rojewski AVS_SKL_LOG_CRITICAL = 1, 352b3e29075SCezary Rojewski AVS_SKL_LOG_HIGH, 353b3e29075SCezary Rojewski AVS_SKL_LOG_MEDIUM, 354b3e29075SCezary Rojewski AVS_SKL_LOG_LOW, 355b3e29075SCezary Rojewski AVS_SKL_LOG_VERBOSE, 356b3e29075SCezary Rojewski }; 357b3e29075SCezary Rojewski 358b3e29075SCezary Rojewski struct skl_log_state { 359b3e29075SCezary Rojewski u32 enable; 360b3e29075SCezary Rojewski u32 min_priority; 361b3e29075SCezary Rojewski } __packed; 362b3e29075SCezary Rojewski 363b3e29075SCezary Rojewski struct skl_log_state_info { 364b3e29075SCezary Rojewski u32 core_mask; 365b3e29075SCezary Rojewski struct skl_log_state logs_core[]; 366b3e29075SCezary Rojewski } __packed; 367b3e29075SCezary Rojewski 368*c8c960c1SCezary Rojewski struct apl_log_state_info { 369*c8c960c1SCezary Rojewski u32 aging_timer_period; 370*c8c960c1SCezary Rojewski u32 fifo_full_timer_period; 371*c8c960c1SCezary Rojewski u32 core_mask; 372*c8c960c1SCezary Rojewski struct skl_log_state logs_core[]; 373*c8c960c1SCezary Rojewski } __packed; 374*c8c960c1SCezary Rojewski 3754b86115cSCezary Rojewski int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size); 3764b86115cSCezary Rojewski 3773322e168SCezary Rojewski struct avs_fw_version { 3783322e168SCezary Rojewski u16 major; 3793322e168SCezary Rojewski u16 minor; 3803322e168SCezary Rojewski u16 hotfix; 3813322e168SCezary Rojewski u16 build; 3823322e168SCezary Rojewski }; 3833322e168SCezary Rojewski 3843322e168SCezary Rojewski enum avs_fw_cfg_params { 3853322e168SCezary Rojewski AVS_FW_CFG_FW_VERSION = 0, 3863322e168SCezary Rojewski AVS_FW_CFG_MEMORY_RECLAIMED, 3873322e168SCezary Rojewski AVS_FW_CFG_SLOW_CLOCK_FREQ_HZ, 3883322e168SCezary Rojewski AVS_FW_CFG_FAST_CLOCK_FREQ_HZ, 3893322e168SCezary Rojewski AVS_FW_CFG_DMA_BUFFER_CONFIG, 3903322e168SCezary Rojewski AVS_FW_CFG_ALH_SUPPORT_LEVEL, 3913322e168SCezary Rojewski AVS_FW_CFG_IPC_DL_MAILBOX_BYTES, 3923322e168SCezary Rojewski AVS_FW_CFG_IPC_UL_MAILBOX_BYTES, 3933322e168SCezary Rojewski AVS_FW_CFG_TRACE_LOG_BYTES, 3943322e168SCezary Rojewski AVS_FW_CFG_MAX_PPL_COUNT, 3953322e168SCezary Rojewski AVS_FW_CFG_MAX_ASTATE_COUNT, 3963322e168SCezary Rojewski AVS_FW_CFG_MAX_MODULE_PIN_COUNT, 3973322e168SCezary Rojewski AVS_FW_CFG_MODULES_COUNT, 3983322e168SCezary Rojewski AVS_FW_CFG_MAX_MOD_INST_COUNT, 3993322e168SCezary Rojewski AVS_FW_CFG_MAX_LL_TASKS_PER_PRI_COUNT, 4003322e168SCezary Rojewski AVS_FW_CFG_LL_PRI_COUNT, 4013322e168SCezary Rojewski AVS_FW_CFG_MAX_DP_TASKS_COUNT, 4023322e168SCezary Rojewski AVS_FW_CFG_MAX_LIBS_COUNT, 4033322e168SCezary Rojewski AVS_FW_CFG_SCHEDULER_CONFIG, 4043322e168SCezary Rojewski AVS_FW_CFG_XTAL_FREQ_HZ, 4053322e168SCezary Rojewski AVS_FW_CFG_CLOCKS_CONFIG, 4063322e168SCezary Rojewski AVS_FW_CFG_RESERVED, 4073322e168SCezary Rojewski AVS_FW_CFG_POWER_GATING_POLICY, 4083322e168SCezary Rojewski AVS_FW_CFG_ASSERT_MODE, 4093322e168SCezary Rojewski }; 4103322e168SCezary Rojewski 4113322e168SCezary Rojewski struct avs_fw_cfg { 4123322e168SCezary Rojewski struct avs_fw_version fw_version; 4133322e168SCezary Rojewski u32 memory_reclaimed; 4143322e168SCezary Rojewski u32 slow_clock_freq_hz; 4153322e168SCezary Rojewski u32 fast_clock_freq_hz; 4163322e168SCezary Rojewski u32 alh_support; 4173322e168SCezary Rojewski u32 ipc_dl_mailbox_bytes; 4183322e168SCezary Rojewski u32 ipc_ul_mailbox_bytes; 4193322e168SCezary Rojewski u32 trace_log_bytes; 4203322e168SCezary Rojewski u32 max_ppl_count; 4213322e168SCezary Rojewski u32 max_astate_count; 4223322e168SCezary Rojewski u32 max_module_pin_count; 4233322e168SCezary Rojewski u32 modules_count; 4243322e168SCezary Rojewski u32 max_mod_inst_count; 4253322e168SCezary Rojewski u32 max_ll_tasks_per_pri_count; 4263322e168SCezary Rojewski u32 ll_pri_count; 4273322e168SCezary Rojewski u32 max_dp_tasks_count; 4283322e168SCezary Rojewski u32 max_libs_count; 4293322e168SCezary Rojewski u32 xtal_freq_hz; 4303322e168SCezary Rojewski u32 power_gating_policy; 4313322e168SCezary Rojewski }; 4323322e168SCezary Rojewski 4333322e168SCezary Rojewski int avs_ipc_get_fw_config(struct avs_dev *adev, struct avs_fw_cfg *cfg); 4343322e168SCezary Rojewski 4353322e168SCezary Rojewski enum avs_hw_cfg_params { 4363322e168SCezary Rojewski AVS_HW_CFG_AVS_VER, 4373322e168SCezary Rojewski AVS_HW_CFG_DSP_CORES, 4383322e168SCezary Rojewski AVS_HW_CFG_MEM_PAGE_BYTES, 4393322e168SCezary Rojewski AVS_HW_CFG_TOTAL_PHYS_MEM_PAGES, 4403322e168SCezary Rojewski AVS_HW_CFG_I2S_CAPS, 4413322e168SCezary Rojewski AVS_HW_CFG_GPDMA_CAPS, 4423322e168SCezary Rojewski AVS_HW_CFG_GATEWAY_COUNT, 4433322e168SCezary Rojewski AVS_HW_CFG_HP_EBB_COUNT, 4443322e168SCezary Rojewski AVS_HW_CFG_LP_EBB_COUNT, 4453322e168SCezary Rojewski AVS_HW_CFG_EBB_SIZE_BYTES, 4463322e168SCezary Rojewski }; 4473322e168SCezary Rojewski 4483322e168SCezary Rojewski enum avs_iface_version { 4493322e168SCezary Rojewski AVS_AVS_VER_1_5 = 0x10005, 4503322e168SCezary Rojewski AVS_AVS_VER_1_8 = 0x10008, 4513322e168SCezary Rojewski }; 4523322e168SCezary Rojewski 4533322e168SCezary Rojewski enum avs_i2s_version { 4543322e168SCezary Rojewski AVS_I2S_VER_15_SKYLAKE = 0x00000, 4553322e168SCezary Rojewski AVS_I2S_VER_15_BROXTON = 0x10000, 4563322e168SCezary Rojewski AVS_I2S_VER_15_BROXTON_P = 0x20000, 4573322e168SCezary Rojewski AVS_I2S_VER_18_KBL_CNL = 0x30000, 4583322e168SCezary Rojewski }; 4593322e168SCezary Rojewski 4603322e168SCezary Rojewski struct avs_i2s_caps { 4613322e168SCezary Rojewski u32 i2s_version; 4623322e168SCezary Rojewski u32 ctrl_count; 4633322e168SCezary Rojewski u32 *ctrl_base_addr; 4643322e168SCezary Rojewski }; 4653322e168SCezary Rojewski 4663322e168SCezary Rojewski struct avs_hw_cfg { 4673322e168SCezary Rojewski u32 avs_version; 4683322e168SCezary Rojewski u32 dsp_cores; 4693322e168SCezary Rojewski u32 mem_page_bytes; 4703322e168SCezary Rojewski u32 total_phys_mem_pages; 4713322e168SCezary Rojewski struct avs_i2s_caps i2s_caps; 4723322e168SCezary Rojewski u32 gateway_count; 4733322e168SCezary Rojewski u32 hp_ebb_count; 4743322e168SCezary Rojewski u32 lp_ebb_count; 4753322e168SCezary Rojewski u32 ebb_size_bytes; 4763322e168SCezary Rojewski }; 4773322e168SCezary Rojewski 4783322e168SCezary Rojewski int avs_ipc_get_hw_config(struct avs_dev *adev, struct avs_hw_cfg *cfg); 4793322e168SCezary Rojewski 4803322e168SCezary Rojewski #define AVS_MODULE_LOAD_TYPE_BUILTIN 0 4813322e168SCezary Rojewski #define AVS_MODULE_LOAD_TYPE_LOADABLE 1 4823322e168SCezary Rojewski #define AVS_MODULE_STATE_LOADED BIT(0) 4833322e168SCezary Rojewski 4843322e168SCezary Rojewski struct avs_module_type { 4853322e168SCezary Rojewski u32 load_type:4; 4863322e168SCezary Rojewski u32 auto_start:1; 4873322e168SCezary Rojewski u32 domain_ll:1; 4883322e168SCezary Rojewski u32 domain_dp:1; 4893322e168SCezary Rojewski u32 lib_code:1; 4903322e168SCezary Rojewski u32 rsvd:24; 4913322e168SCezary Rojewski } __packed; 4923322e168SCezary Rojewski 4933322e168SCezary Rojewski union avs_segment_flags { 4943322e168SCezary Rojewski u32 ul; 4953322e168SCezary Rojewski struct { 4963322e168SCezary Rojewski u32 contents:1; 4973322e168SCezary Rojewski u32 alloc:1; 4983322e168SCezary Rojewski u32 load:1; 4993322e168SCezary Rojewski u32 readonly:1; 5003322e168SCezary Rojewski u32 code:1; 5013322e168SCezary Rojewski u32 data:1; 5023322e168SCezary Rojewski u32 rsvd_1:2; 5033322e168SCezary Rojewski u32 type:4; 5043322e168SCezary Rojewski u32 rsvd_2:4; 5053322e168SCezary Rojewski u32 length:16; 5063322e168SCezary Rojewski }; 5073322e168SCezary Rojewski } __packed; 5083322e168SCezary Rojewski 5093322e168SCezary Rojewski struct avs_segment_desc { 5103322e168SCezary Rojewski union avs_segment_flags flags; 5113322e168SCezary Rojewski u32 v_base_addr; 5123322e168SCezary Rojewski u32 file_offset; 5133322e168SCezary Rojewski } __packed; 5143322e168SCezary Rojewski 5153322e168SCezary Rojewski struct avs_module_entry { 5163322e168SCezary Rojewski u16 module_id; 5173322e168SCezary Rojewski u16 state_flags; 5183322e168SCezary Rojewski u8 name[8]; 5193322e168SCezary Rojewski guid_t uuid; 5203322e168SCezary Rojewski struct avs_module_type type; 5213322e168SCezary Rojewski u8 hash[32]; 5223322e168SCezary Rojewski u32 entry_point; 5233322e168SCezary Rojewski u16 cfg_offset; 5243322e168SCezary Rojewski u16 cfg_count; 5253322e168SCezary Rojewski u32 affinity_mask; 5263322e168SCezary Rojewski u16 instance_max_count; 5273322e168SCezary Rojewski u16 instance_bss_size; 5283322e168SCezary Rojewski struct avs_segment_desc segments[3]; 5293322e168SCezary Rojewski } __packed; 5303322e168SCezary Rojewski 5313322e168SCezary Rojewski struct avs_mods_info { 5323322e168SCezary Rojewski u32 count; 5333322e168SCezary Rojewski struct avs_module_entry entries[]; 5343322e168SCezary Rojewski } __packed; 5353322e168SCezary Rojewski 5363322e168SCezary Rojewski static inline bool avs_module_entry_is_loaded(struct avs_module_entry *mentry) 5373322e168SCezary Rojewski { 5383322e168SCezary Rojewski return mentry->type.load_type == AVS_MODULE_LOAD_TYPE_BUILTIN || 5393322e168SCezary Rojewski mentry->state_flags & AVS_MODULE_STATE_LOADED; 5403322e168SCezary Rojewski } 5413322e168SCezary Rojewski 5423322e168SCezary Rojewski int avs_ipc_get_modules_info(struct avs_dev *adev, struct avs_mods_info **info); 5433322e168SCezary Rojewski 5444b86115cSCezary Rojewski struct avs_sys_time { 5454b86115cSCezary Rojewski u32 val_l; 5464b86115cSCezary Rojewski u32 val_u; 5474b86115cSCezary Rojewski } __packed; 5484b86115cSCezary Rojewski 5494b86115cSCezary Rojewski int avs_ipc_set_system_time(struct avs_dev *adev); 5504b86115cSCezary Rojewski 551580a5912SCezary Rojewski /* Module configuration */ 552580a5912SCezary Rojewski 553580a5912SCezary Rojewski #define AVS_MIXIN_MOD_UUID \ 554580a5912SCezary Rojewski GUID_INIT(0x39656EB2, 0x3B71, 0x4049, 0x8D, 0x3F, 0xF9, 0x2C, 0xD5, 0xC4, 0x3C, 0x09) 555580a5912SCezary Rojewski 556580a5912SCezary Rojewski #define AVS_MIXOUT_MOD_UUID \ 557580a5912SCezary Rojewski GUID_INIT(0x3C56505A, 0x24D7, 0x418F, 0xBD, 0xDC, 0xC1, 0xF5, 0xA3, 0xAC, 0x2A, 0xE0) 558580a5912SCezary Rojewski 559580a5912SCezary Rojewski #define AVS_COPIER_MOD_UUID \ 560580a5912SCezary Rojewski GUID_INIT(0x9BA00C83, 0xCA12, 0x4A83, 0x94, 0x3C, 0x1F, 0xA2, 0xE8, 0x2F, 0x9D, 0xDA) 561580a5912SCezary Rojewski 562580a5912SCezary Rojewski #define AVS_KPBUFF_MOD_UUID \ 563580a5912SCezary Rojewski GUID_INIT(0xA8A0CB32, 0x4A77, 0x4DB1, 0x85, 0xC7, 0x53, 0xD7, 0xEE, 0x07, 0xBC, 0xE6) 564580a5912SCezary Rojewski 565580a5912SCezary Rojewski #define AVS_MICSEL_MOD_UUID \ 566580a5912SCezary Rojewski GUID_INIT(0x32FE92C1, 0x1E17, 0x4FC2, 0x97, 0x58, 0xC7, 0xF3, 0x54, 0x2E, 0x98, 0x0A) 567580a5912SCezary Rojewski 568580a5912SCezary Rojewski #define AVS_MUX_MOD_UUID \ 569580a5912SCezary Rojewski GUID_INIT(0x64CE6E35, 0x857A, 0x4878, 0xAC, 0xE8, 0xE2, 0xA2, 0xF4, 0x2e, 0x30, 0x69) 570580a5912SCezary Rojewski 571580a5912SCezary Rojewski #define AVS_UPDWMIX_MOD_UUID \ 572580a5912SCezary Rojewski GUID_INIT(0x42F8060C, 0x832F, 0x4DBF, 0xB2, 0x47, 0x51, 0xE9, 0x61, 0x99, 0x7b, 0x35) 573580a5912SCezary Rojewski 574580a5912SCezary Rojewski #define AVS_SRCINTC_MOD_UUID \ 575580a5912SCezary Rojewski GUID_INIT(0xE61BB28D, 0x149A, 0x4C1F, 0xB7, 0x09, 0x46, 0x82, 0x3E, 0xF5, 0xF5, 0xAE) 576580a5912SCezary Rojewski 577580a5912SCezary Rojewski #define AVS_PROBE_MOD_UUID \ 578580a5912SCezary Rojewski GUID_INIT(0x7CAD0808, 0xAB10, 0xCD23, 0xEF, 0x45, 0x12, 0xAB, 0x34, 0xCD, 0x56, 0xEF) 579580a5912SCezary Rojewski 580580a5912SCezary Rojewski #define AVS_AEC_MOD_UUID \ 581580a5912SCezary Rojewski GUID_INIT(0x46CB87FB, 0xD2C9, 0x4970, 0x96, 0xD2, 0x6D, 0x7E, 0x61, 0x4B, 0xB6, 0x05) 582580a5912SCezary Rojewski 583580a5912SCezary Rojewski #define AVS_ASRC_MOD_UUID \ 584580a5912SCezary Rojewski GUID_INIT(0x66B4402D, 0xB468, 0x42F2, 0x81, 0xA7, 0xB3, 0x71, 0x21, 0x86, 0x3D, 0xD4) 585580a5912SCezary Rojewski 586580a5912SCezary Rojewski #define AVS_INTELWOV_MOD_UUID \ 587580a5912SCezary Rojewski GUID_INIT(0xEC774FA9, 0x28D3, 0x424A, 0x90, 0xE4, 0x69, 0xF9, 0x84, 0xF1, 0xEE, 0xB7) 588580a5912SCezary Rojewski 589580a5912SCezary Rojewski /* channel map */ 590580a5912SCezary Rojewski enum avs_channel_index { 591580a5912SCezary Rojewski AVS_CHANNEL_LEFT = 0, 592580a5912SCezary Rojewski AVS_CHANNEL_RIGHT = 1, 593580a5912SCezary Rojewski AVS_CHANNEL_CENTER = 2, 594580a5912SCezary Rojewski AVS_CHANNEL_LEFT_SURROUND = 3, 595580a5912SCezary Rojewski AVS_CHANNEL_CENTER_SURROUND = 3, 596580a5912SCezary Rojewski AVS_CHANNEL_RIGHT_SURROUND = 4, 597580a5912SCezary Rojewski AVS_CHANNEL_LFE = 7, 598580a5912SCezary Rojewski AVS_CHANNEL_INVALID = 0xF, 599580a5912SCezary Rojewski }; 600580a5912SCezary Rojewski 601580a5912SCezary Rojewski enum avs_channel_config { 602580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_MONO = 0, 603580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_STEREO = 1, 604580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_2_1 = 2, 605580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_3_0 = 3, 606580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_3_1 = 4, 607580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_QUATRO = 5, 608580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_4_0 = 6, 609580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_5_0 = 7, 610580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_5_1 = 8, 611580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_DUAL_MONO = 9, 612580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_I2S_DUAL_STEREO_0 = 10, 613580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_I2S_DUAL_STEREO_1 = 11, 614580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_4_CHANNEL = 12, 615580a5912SCezary Rojewski AVS_CHANNEL_CONFIG_INVALID 616580a5912SCezary Rojewski }; 617580a5912SCezary Rojewski 618580a5912SCezary Rojewski enum avs_interleaving { 619580a5912SCezary Rojewski AVS_INTERLEAVING_PER_CHANNEL = 0, 620580a5912SCezary Rojewski AVS_INTERLEAVING_PER_SAMPLE = 1, 621580a5912SCezary Rojewski }; 622580a5912SCezary Rojewski 623580a5912SCezary Rojewski enum avs_sample_type { 624580a5912SCezary Rojewski AVS_SAMPLE_TYPE_INT_MSB = 0, 625580a5912SCezary Rojewski AVS_SAMPLE_TYPE_INT_LSB = 1, 626580a5912SCezary Rojewski AVS_SAMPLE_TYPE_INT_SIGNED = 2, 627580a5912SCezary Rojewski AVS_SAMPLE_TYPE_INT_UNSIGNED = 3, 628580a5912SCezary Rojewski AVS_SAMPLE_TYPE_FLOAT = 4, 629580a5912SCezary Rojewski }; 630580a5912SCezary Rojewski 631580a5912SCezary Rojewski #define AVS_CHANNELS_MAX 8 632580a5912SCezary Rojewski #define AVS_ALL_CHANNELS_MASK UINT_MAX 633580a5912SCezary Rojewski 634580a5912SCezary Rojewski struct avs_audio_format { 635580a5912SCezary Rojewski u32 sampling_freq; 636580a5912SCezary Rojewski u32 bit_depth; 637580a5912SCezary Rojewski u32 channel_map; 638580a5912SCezary Rojewski u32 channel_config; 639580a5912SCezary Rojewski u32 interleaving; 640580a5912SCezary Rojewski u32 num_channels:8; 641580a5912SCezary Rojewski u32 valid_bit_depth:8; 642580a5912SCezary Rojewski u32 sample_type:8; 643580a5912SCezary Rojewski u32 reserved:8; 644580a5912SCezary Rojewski } __packed; 645580a5912SCezary Rojewski 646580a5912SCezary Rojewski struct avs_modcfg_base { 647580a5912SCezary Rojewski u32 cpc; 648580a5912SCezary Rojewski u32 ibs; 649580a5912SCezary Rojewski u32 obs; 650580a5912SCezary Rojewski u32 is_pages; 651580a5912SCezary Rojewski struct avs_audio_format audio_fmt; 652580a5912SCezary Rojewski } __packed; 653580a5912SCezary Rojewski 654580a5912SCezary Rojewski struct avs_pin_format { 655580a5912SCezary Rojewski u32 pin_index; 656580a5912SCezary Rojewski u32 iobs; 657580a5912SCezary Rojewski struct avs_audio_format audio_fmt; 658580a5912SCezary Rojewski } __packed; 659580a5912SCezary Rojewski 660580a5912SCezary Rojewski struct avs_modcfg_ext { 661580a5912SCezary Rojewski struct avs_modcfg_base base; 662580a5912SCezary Rojewski u16 num_input_pins; 663580a5912SCezary Rojewski u16 num_output_pins; 664580a5912SCezary Rojewski u8 reserved[12]; 665580a5912SCezary Rojewski /* input pin formats followed by output ones */ 666580a5912SCezary Rojewski struct avs_pin_format pin_fmts[]; 667580a5912SCezary Rojewski } __packed; 668580a5912SCezary Rojewski 669580a5912SCezary Rojewski enum avs_dma_type { 670580a5912SCezary Rojewski AVS_DMA_HDA_HOST_OUTPUT = 0, 671580a5912SCezary Rojewski AVS_DMA_HDA_HOST_INPUT = 1, 672580a5912SCezary Rojewski AVS_DMA_HDA_LINK_OUTPUT = 8, 673580a5912SCezary Rojewski AVS_DMA_HDA_LINK_INPUT = 9, 674580a5912SCezary Rojewski AVS_DMA_DMIC_LINK_INPUT = 11, 675580a5912SCezary Rojewski AVS_DMA_I2S_LINK_OUTPUT = 12, 676580a5912SCezary Rojewski AVS_DMA_I2S_LINK_INPUT = 13, 677580a5912SCezary Rojewski }; 678580a5912SCezary Rojewski 679580a5912SCezary Rojewski union avs_virtual_index { 680580a5912SCezary Rojewski u8 val; 681580a5912SCezary Rojewski struct { 682580a5912SCezary Rojewski u8 time_slot:4; 683580a5912SCezary Rojewski u8 instance:4; 684580a5912SCezary Rojewski } i2s; 685580a5912SCezary Rojewski struct { 686580a5912SCezary Rojewski u8 queue_id:3; 687580a5912SCezary Rojewski u8 time_slot:2; 688580a5912SCezary Rojewski u8 instance:3; 689580a5912SCezary Rojewski } dmic; 690580a5912SCezary Rojewski } __packed; 691580a5912SCezary Rojewski 692580a5912SCezary Rojewski union avs_connector_node_id { 693580a5912SCezary Rojewski u32 val; 694580a5912SCezary Rojewski struct { 695580a5912SCezary Rojewski u32 vindex:8; 696580a5912SCezary Rojewski u32 dma_type:5; 697580a5912SCezary Rojewski u32 rsvd:19; 698580a5912SCezary Rojewski }; 699580a5912SCezary Rojewski } __packed; 700580a5912SCezary Rojewski 701580a5912SCezary Rojewski #define INVALID_PIPELINE_ID 0xFF 702580a5912SCezary Rojewski #define INVALID_NODE_ID \ 703580a5912SCezary Rojewski ((union avs_connector_node_id) { UINT_MAX }) 704580a5912SCezary Rojewski 705580a5912SCezary Rojewski union avs_gtw_attributes { 706580a5912SCezary Rojewski u32 val; 707580a5912SCezary Rojewski struct { 708580a5912SCezary Rojewski u32 lp_buffer_alloc:1; 709580a5912SCezary Rojewski u32 rsvd:31; 710580a5912SCezary Rojewski }; 711580a5912SCezary Rojewski } __packed; 712580a5912SCezary Rojewski 713580a5912SCezary Rojewski struct avs_copier_gtw_cfg { 714580a5912SCezary Rojewski union avs_connector_node_id node_id; 715580a5912SCezary Rojewski u32 dma_buffer_size; 716580a5912SCezary Rojewski u32 config_length; 717580a5912SCezary Rojewski struct { 718580a5912SCezary Rojewski union avs_gtw_attributes attrs; 719580a5912SCezary Rojewski u32 blob[]; 720580a5912SCezary Rojewski } config; 721580a5912SCezary Rojewski } __packed; 722580a5912SCezary Rojewski 723580a5912SCezary Rojewski struct avs_copier_cfg { 724580a5912SCezary Rojewski struct avs_modcfg_base base; 725580a5912SCezary Rojewski struct avs_audio_format out_fmt; 726580a5912SCezary Rojewski u32 feature_mask; 727580a5912SCezary Rojewski struct avs_copier_gtw_cfg gtw_cfg; 728580a5912SCezary Rojewski } __packed; 729580a5912SCezary Rojewski 730580a5912SCezary Rojewski struct avs_micsel_cfg { 731580a5912SCezary Rojewski struct avs_modcfg_base base; 732580a5912SCezary Rojewski struct avs_audio_format out_fmt; 733580a5912SCezary Rojewski } __packed; 734580a5912SCezary Rojewski 735580a5912SCezary Rojewski struct avs_mux_cfg { 736580a5912SCezary Rojewski struct avs_modcfg_base base; 737580a5912SCezary Rojewski struct avs_audio_format ref_fmt; 738580a5912SCezary Rojewski struct avs_audio_format out_fmt; 739580a5912SCezary Rojewski } __packed; 740580a5912SCezary Rojewski 741580a5912SCezary Rojewski struct avs_updown_mixer_cfg { 742580a5912SCezary Rojewski struct avs_modcfg_base base; 743580a5912SCezary Rojewski u32 out_channel_config; 744580a5912SCezary Rojewski u32 coefficients_select; 745580a5912SCezary Rojewski s32 coefficients[AVS_CHANNELS_MAX]; 746580a5912SCezary Rojewski u32 channel_map; 747580a5912SCezary Rojewski } __packed; 748580a5912SCezary Rojewski 749580a5912SCezary Rojewski struct avs_src_cfg { 750580a5912SCezary Rojewski struct avs_modcfg_base base; 751580a5912SCezary Rojewski u32 out_freq; 752580a5912SCezary Rojewski } __packed; 753580a5912SCezary Rojewski 754580a5912SCezary Rojewski struct avs_probe_gtw_cfg { 755580a5912SCezary Rojewski union avs_connector_node_id node_id; 756580a5912SCezary Rojewski u32 dma_buffer_size; 757580a5912SCezary Rojewski } __packed; 758580a5912SCezary Rojewski 759580a5912SCezary Rojewski struct avs_probe_cfg { 760580a5912SCezary Rojewski struct avs_modcfg_base base; 761580a5912SCezary Rojewski struct avs_probe_gtw_cfg gtw_cfg; 762580a5912SCezary Rojewski } __packed; 763580a5912SCezary Rojewski 764580a5912SCezary Rojewski struct avs_aec_cfg { 765580a5912SCezary Rojewski struct avs_modcfg_base base; 766580a5912SCezary Rojewski struct avs_audio_format ref_fmt; 767580a5912SCezary Rojewski struct avs_audio_format out_fmt; 768580a5912SCezary Rojewski u32 cpc_lp_mode; 769580a5912SCezary Rojewski } __packed; 770580a5912SCezary Rojewski 771580a5912SCezary Rojewski struct avs_asrc_cfg { 772580a5912SCezary Rojewski struct avs_modcfg_base base; 773580a5912SCezary Rojewski u32 out_freq; 774580a5912SCezary Rojewski u32 rsvd0:1; 775580a5912SCezary Rojewski u32 mode:1; 776580a5912SCezary Rojewski u32 rsvd2:2; 777580a5912SCezary Rojewski u32 disable_jitter_buffer:1; 778580a5912SCezary Rojewski u32 rsvd3:27; 779580a5912SCezary Rojewski } __packed; 780580a5912SCezary Rojewski 781580a5912SCezary Rojewski struct avs_wov_cfg { 782580a5912SCezary Rojewski struct avs_modcfg_base base; 783580a5912SCezary Rojewski u32 cpc_lp_mode; 784580a5912SCezary Rojewski } __packed; 785580a5912SCezary Rojewski 786580a5912SCezary Rojewski /* Module runtime parameters */ 787580a5912SCezary Rojewski 788580a5912SCezary Rojewski enum avs_copier_runtime_param { 789580a5912SCezary Rojewski AVS_COPIER_SET_SINK_FORMAT = 2, 790580a5912SCezary Rojewski }; 791580a5912SCezary Rojewski 792580a5912SCezary Rojewski struct avs_copier_sink_format { 793580a5912SCezary Rojewski u32 sink_id; 794580a5912SCezary Rojewski struct avs_audio_format src_fmt; 795580a5912SCezary Rojewski struct avs_audio_format sink_fmt; 796580a5912SCezary Rojewski } __packed; 797580a5912SCezary Rojewski 798580a5912SCezary Rojewski int avs_ipc_copier_set_sink_format(struct avs_dev *adev, u16 module_id, 799580a5912SCezary Rojewski u8 instance_id, u32 sink_id, 800580a5912SCezary Rojewski const struct avs_audio_format *src_fmt, 801580a5912SCezary Rojewski const struct avs_audio_format *sink_fmt); 802580a5912SCezary Rojewski 8032879516fSCezary Rojewski #endif /* __SOUND_SOC_INTEL_AVS_MSGS_H */ 804