forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/intel/skylake/skl-sst-dsp.h
....@@ -1,16 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Skylake SST DSP Support
34 *
45 * 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.
146 */
157
168 #ifndef __SKL_SST_DSP_H__
....@@ -23,9 +15,9 @@
2315 #include "skl-sst-cldma.h"
2416
2517 struct sst_dsp;
26
-struct skl_sst;
2718 struct sst_dsp_device;
2819 struct skl_lib_info;
20
+struct skl_dev;
2921
3022 /* Intel HD Audio General DSP Registers */
3123 #define SKL_ADSP_GEN_BASE 0x0
....@@ -75,6 +67,8 @@
7567
7668 #define SKL_FW_INIT 0x1
7769 #define SKL_FW_RFW_START 0xf
70
+#define BXT_FW_ROM_INIT_RETRY 3
71
+#define BXT_INIT_TIMEOUT 300
7872
7973 #define SKL_ADSPIC_IPC 1
8074 #define SKL_ADSPIS_IPC 1
....@@ -177,7 +171,7 @@
177171 #define MAX_INSTANCE_BUFF 2
178172
179173 struct uuid_module {
180
- uuid_le uuid;
174
+ guid_t uuid;
181175 int id;
182176 int is_loadable;
183177 int max_instance;
....@@ -230,32 +224,31 @@
230224 int skl_dsp_boot(struct sst_dsp *ctx);
231225 int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
232226 const char *fw_name, struct skl_dsp_loader_ops dsp_ops,
233
- struct skl_sst **dsp);
227
+ struct skl_dev **dsp);
234228 int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
235229 const char *fw_name, struct skl_dsp_loader_ops dsp_ops,
236
- struct skl_sst **dsp);
237
-int skl_sst_init_fw(struct device *dev, struct skl_sst *ctx);
238
-int bxt_sst_init_fw(struct device *dev, struct skl_sst *ctx);
239
-void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
240
-void bxt_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx);
230
+ struct skl_dev **dsp);
231
+int skl_sst_init_fw(struct device *dev, struct skl_dev *skl);
232
+int bxt_sst_init_fw(struct device *dev, struct skl_dev *skl);
233
+void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl);
234
+void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl);
241235
242236 int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
243237 unsigned int offset, int index);
244
-int skl_get_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int instance_id);
245
-int skl_put_pvt_id(struct skl_sst *ctx, uuid_le *uuid_mod, int *pvt_id);
246
-int skl_get_pvt_instance_id_map(struct skl_sst *ctx,
238
+int skl_get_pvt_id(struct skl_dev *skl, guid_t *uuid_mod, int instance_id);
239
+int skl_put_pvt_id(struct skl_dev *skl, guid_t *uuid_mod, int *pvt_id);
240
+int skl_get_pvt_instance_id_map(struct skl_dev *skl,
247241 int module_id, int instance_id);
248
-void skl_freeup_uuid_list(struct skl_sst *ctx);
242
+void skl_freeup_uuid_list(struct skl_dev *skl);
249243
250244 int skl_dsp_strip_extended_manifest(struct firmware *fw);
251
-void skl_dsp_enable_notification(struct skl_sst *ctx, bool enable);
252245
253
-void skl_dsp_set_astate_cfg(struct skl_sst *ctx, u32 cnt, void *data);
246
+void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data);
254247
255248 int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name,
256
- struct skl_dsp_loader_ops dsp_ops, struct skl_sst **dsp,
249
+ struct skl_dsp_loader_ops dsp_ops, struct skl_dev **dsp,
257250 struct sst_dsp_device *skl_dev);
258
-int skl_prepare_lib_load(struct skl_sst *skl, struct skl_lib_info *linfo,
251
+int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo,
259252 struct firmware *stripped_fw,
260253 unsigned int hdr_offset, int index);
261254 void skl_release_library(struct skl_lib_info *linfo, int lib_count);