| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Skylake SST DSP 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_SST_DSP_H__ |
|---|
| .. | .. |
|---|
| 23 | 15 | #include "skl-sst-cldma.h" |
|---|
| 24 | 16 | |
|---|
| 25 | 17 | struct sst_dsp; |
|---|
| 26 | | -struct skl_sst; |
|---|
| 27 | 18 | struct sst_dsp_device; |
|---|
| 28 | 19 | struct skl_lib_info; |
|---|
| 20 | +struct skl_dev; |
|---|
| 29 | 21 | |
|---|
| 30 | 22 | /* Intel HD Audio General DSP Registers */ |
|---|
| 31 | 23 | #define SKL_ADSP_GEN_BASE 0x0 |
|---|
| .. | .. |
|---|
| 75 | 67 | |
|---|
| 76 | 68 | #define SKL_FW_INIT 0x1 |
|---|
| 77 | 69 | #define SKL_FW_RFW_START 0xf |
|---|
| 70 | +#define BXT_FW_ROM_INIT_RETRY 3 |
|---|
| 71 | +#define BXT_INIT_TIMEOUT 300 |
|---|
| 78 | 72 | |
|---|
| 79 | 73 | #define SKL_ADSPIC_IPC 1 |
|---|
| 80 | 74 | #define SKL_ADSPIS_IPC 1 |
|---|
| .. | .. |
|---|
| 177 | 171 | #define MAX_INSTANCE_BUFF 2 |
|---|
| 178 | 172 | |
|---|
| 179 | 173 | struct uuid_module { |
|---|
| 180 | | - uuid_le uuid; |
|---|
| 174 | + guid_t uuid; |
|---|
| 181 | 175 | int id; |
|---|
| 182 | 176 | int is_loadable; |
|---|
| 183 | 177 | int max_instance; |
|---|
| .. | .. |
|---|
| 230 | 224 | int skl_dsp_boot(struct sst_dsp *ctx); |
|---|
| 231 | 225 | int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, |
|---|
| 232 | 226 | const char *fw_name, struct skl_dsp_loader_ops dsp_ops, |
|---|
| 233 | | - struct skl_sst **dsp); |
|---|
| 227 | + struct skl_dev **dsp); |
|---|
| 234 | 228 | int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, |
|---|
| 235 | 229 | 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); |
|---|
| 241 | 235 | |
|---|
| 242 | 236 | int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, |
|---|
| 243 | 237 | 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, |
|---|
| 247 | 241 | 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); |
|---|
| 249 | 243 | |
|---|
| 250 | 244 | int skl_dsp_strip_extended_manifest(struct firmware *fw); |
|---|
| 251 | | -void skl_dsp_enable_notification(struct skl_sst *ctx, bool enable); |
|---|
| 252 | 245 | |
|---|
| 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); |
|---|
| 254 | 247 | |
|---|
| 255 | 248 | 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, |
|---|
| 257 | 250 | 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, |
|---|
| 259 | 252 | struct firmware *stripped_fw, |
|---|
| 260 | 253 | unsigned int hdr_offset, int index); |
|---|
| 261 | 254 | void skl_release_library(struct skl_lib_info *linfo, int lib_count); |
|---|