| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Intel SKL IPC Support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2014-15, Intel Corporation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as version 2, as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | | - * General Public License for more details. |
|---|
| 14 | 6 | */ |
|---|
| 15 | 7 | |
|---|
| 16 | 8 | #ifndef __SKL_IPC_H |
|---|
| .. | .. |
|---|
| 18 | 10 | |
|---|
| 19 | 11 | #include <linux/irqreturn.h> |
|---|
| 20 | 12 | #include "../common/sst-ipc.h" |
|---|
| 13 | +#include "skl-sst-dsp.h" |
|---|
| 21 | 14 | |
|---|
| 22 | 15 | struct sst_dsp; |
|---|
| 23 | | -struct skl_sst; |
|---|
| 24 | 16 | struct sst_generic_ipc; |
|---|
| 25 | 17 | |
|---|
| 26 | 18 | enum skl_ipc_pipeline_state { |
|---|
| .. | .. |
|---|
| 75 | 67 | const struct firmware *fw; |
|---|
| 76 | 68 | }; |
|---|
| 77 | 69 | |
|---|
| 78 | | -struct skl_sst { |
|---|
| 79 | | - struct device *dev; |
|---|
| 80 | | - struct sst_dsp *dsp; |
|---|
| 81 | | - |
|---|
| 82 | | - /* boot */ |
|---|
| 83 | | - wait_queue_head_t boot_wait; |
|---|
| 84 | | - bool boot_complete; |
|---|
| 85 | | - |
|---|
| 86 | | - /* module load */ |
|---|
| 87 | | - wait_queue_head_t mod_load_wait; |
|---|
| 88 | | - bool mod_load_complete; |
|---|
| 89 | | - bool mod_load_status; |
|---|
| 90 | | - |
|---|
| 91 | | - /* IPC messaging */ |
|---|
| 92 | | - struct sst_generic_ipc ipc; |
|---|
| 93 | | - |
|---|
| 94 | | - /* callback for miscbdge */ |
|---|
| 95 | | - void (*enable_miscbdcge)(struct device *dev, bool enable); |
|---|
| 96 | | - /* Is CGCTL.MISCBDCGE disabled */ |
|---|
| 97 | | - bool miscbdcg_disabled; |
|---|
| 98 | | - |
|---|
| 99 | | - /* Populate module information */ |
|---|
| 100 | | - struct list_head uuid_list; |
|---|
| 101 | | - |
|---|
| 102 | | - /* Is firmware loaded */ |
|---|
| 103 | | - bool fw_loaded; |
|---|
| 104 | | - |
|---|
| 105 | | - /* first boot ? */ |
|---|
| 106 | | - bool is_first_boot; |
|---|
| 107 | | - |
|---|
| 108 | | - /* multi-core */ |
|---|
| 109 | | - struct skl_dsp_cores cores; |
|---|
| 110 | | - |
|---|
| 111 | | - /* library info */ |
|---|
| 112 | | - struct skl_lib_info lib_info[SKL_MAX_LIB]; |
|---|
| 113 | | - int lib_count; |
|---|
| 114 | | - |
|---|
| 115 | | - /* Callback to update D0i3C register */ |
|---|
| 116 | | - void (*update_d0i3c)(struct device *dev, bool enable); |
|---|
| 117 | | - |
|---|
| 118 | | - struct skl_d0i3_data d0i3; |
|---|
| 119 | | - |
|---|
| 120 | | - const struct skl_dsp_ops *dsp_ops; |
|---|
| 121 | | - |
|---|
| 122 | | - /* Callback to update dynamic clock and power gating registers */ |
|---|
| 123 | | - void (*clock_power_gating)(struct device *dev, bool enable); |
|---|
| 124 | | -}; |
|---|
| 125 | | - |
|---|
| 126 | 70 | struct skl_ipc_init_instance_msg { |
|---|
| 127 | 71 | u32 module_id; |
|---|
| 128 | 72 | u32 instance_id; |
|---|
| .. | .. |
|---|
| 163 | 107 | |
|---|
| 164 | 108 | irqreturn_t skl_dsp_irq_thread_handler(int irq, void *context); |
|---|
| 165 | 109 | |
|---|
| 166 | | -int skl_ipc_create_pipeline(struct sst_generic_ipc *sst_ipc, |
|---|
| 110 | +int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc, |
|---|
| 167 | 111 | u16 ppl_mem_size, u8 ppl_type, u8 instance_id, u8 lp_mode); |
|---|
| 168 | 112 | |
|---|
| 169 | | -int skl_ipc_delete_pipeline(struct sst_generic_ipc *sst_ipc, u8 instance_id); |
|---|
| 113 | +int skl_ipc_delete_pipeline(struct sst_generic_ipc *ipc, u8 instance_id); |
|---|
| 170 | 114 | |
|---|
| 171 | | -int skl_ipc_set_pipeline_state(struct sst_generic_ipc *sst_ipc, |
|---|
| 115 | +int skl_ipc_set_pipeline_state(struct sst_generic_ipc *ipc, |
|---|
| 172 | 116 | u8 instance_id, enum skl_ipc_pipeline_state state); |
|---|
| 173 | 117 | |
|---|
| 174 | 118 | int skl_ipc_save_pipeline(struct sst_generic_ipc *ipc, |
|---|
| .. | .. |
|---|
| 176 | 120 | |
|---|
| 177 | 121 | int skl_ipc_restore_pipeline(struct sst_generic_ipc *ipc, u8 instance_id); |
|---|
| 178 | 122 | |
|---|
| 179 | | -int skl_ipc_init_instance(struct sst_generic_ipc *sst_ipc, |
|---|
| 123 | +int skl_ipc_init_instance(struct sst_generic_ipc *ipc, |
|---|
| 180 | 124 | struct skl_ipc_init_instance_msg *msg, void *param_data); |
|---|
| 181 | 125 | |
|---|
| 182 | | -int skl_ipc_bind_unbind(struct sst_generic_ipc *sst_ipc, |
|---|
| 126 | +int skl_ipc_bind_unbind(struct sst_generic_ipc *ipc, |
|---|
| 183 | 127 | struct skl_ipc_bind_unbind_msg *msg); |
|---|
| 184 | 128 | |
|---|
| 185 | 129 | int skl_ipc_load_modules(struct sst_generic_ipc *ipc, |
|---|
| .. | .. |
|---|
| 195 | 139 | struct skl_ipc_large_config_msg *msg, u32 *param); |
|---|
| 196 | 140 | |
|---|
| 197 | 141 | int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, |
|---|
| 198 | | - struct skl_ipc_large_config_msg *msg, u32 *param); |
|---|
| 142 | + struct skl_ipc_large_config_msg *msg, |
|---|
| 143 | + u32 **payload, size_t *bytes); |
|---|
| 199 | 144 | |
|---|
| 200 | 145 | int skl_sst_ipc_load_library(struct sst_generic_ipc *ipc, |
|---|
| 201 | 146 | u8 dma_id, u8 table_id, bool wait); |
|---|
| .. | .. |
|---|
| 205 | 150 | |
|---|
| 206 | 151 | int skl_ipc_check_D0i0(struct sst_dsp *dsp, bool state); |
|---|
| 207 | 152 | |
|---|
| 208 | | -void skl_ipc_int_enable(struct sst_dsp *dsp); |
|---|
| 153 | +void skl_ipc_int_enable(struct sst_dsp *ctx); |
|---|
| 209 | 154 | void skl_ipc_op_int_enable(struct sst_dsp *ctx); |
|---|
| 210 | 155 | void skl_ipc_op_int_disable(struct sst_dsp *ctx); |
|---|
| 211 | | -void skl_ipc_int_disable(struct sst_dsp *dsp); |
|---|
| 156 | +void skl_ipc_int_disable(struct sst_dsp *ctx); |
|---|
| 212 | 157 | |
|---|
| 213 | | -bool skl_ipc_int_status(struct sst_dsp *dsp); |
|---|
| 158 | +bool skl_ipc_int_status(struct sst_dsp *ctx); |
|---|
| 214 | 159 | void skl_ipc_free(struct sst_generic_ipc *ipc); |
|---|
| 215 | | -int skl_ipc_init(struct device *dev, struct skl_sst *skl); |
|---|
| 160 | +int skl_ipc_init(struct device *dev, struct skl_dev *skl); |
|---|
| 216 | 161 | void skl_clear_module_cnt(struct sst_dsp *ctx); |
|---|
| 217 | 162 | |
|---|
| 218 | 163 | void skl_ipc_process_reply(struct sst_generic_ipc *ipc, |
|---|