2020-05-01 22:58:50 +08:00
|
|
|
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
|
2019-04-13 00:08:58 +08:00
|
|
|
//
|
|
|
|
// This file is provided under a dual BSD/GPLv2 license. When using or
|
|
|
|
// redistributing this file, you may do so under either license.
|
|
|
|
//
|
|
|
|
// Copyright(c) 2018 Intel Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
// Authors: Liam Girdwood <liam.r.girdwood@linux.intel.com>
|
|
|
|
// Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
|
|
|
|
// Rander Wang <rander.wang@intel.com>
|
|
|
|
// Keyon Jie <yang.jie@linux.intel.com>
|
|
|
|
//
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Hardware interface for audio DSP on Apollolake and GeminiLake
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../sof-priv.h"
|
|
|
|
#include "hda.h"
|
2019-12-05 05:15:53 +08:00
|
|
|
#include "../sof-audio.h"
|
2019-04-13 00:08:58 +08:00
|
|
|
|
|
|
|
static const struct snd_sof_debugfs_map apl_dsp_debugfs[] = {
|
|
|
|
{"hda", HDA_DSP_HDA_BAR, 0, 0x4000, SOF_DEBUGFS_ACCESS_ALWAYS},
|
|
|
|
{"pp", HDA_DSP_PP_BAR, 0, 0x1000, SOF_DEBUGFS_ACCESS_ALWAYS},
|
|
|
|
{"dsp", HDA_DSP_BAR, 0, 0x10000, SOF_DEBUGFS_ACCESS_ALWAYS},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* apollolake ops */
|
2022-04-15 02:48:11 +08:00
|
|
|
struct snd_sof_dsp_ops sof_apl_ops;
|
|
|
|
EXPORT_SYMBOL_NS(sof_apl_ops, SND_SOC_SOF_INTEL_HDA_COMMON);
|
2019-04-13 00:08:58 +08:00
|
|
|
|
2022-04-15 02:48:11 +08:00
|
|
|
int sof_apl_ops_init(struct snd_sof_dev *sdev)
|
|
|
|
{
|
|
|
|
/* common defaults */
|
|
|
|
memcpy(&sof_apl_ops, &sof_hda_common_ops, sizeof(struct snd_sof_dsp_ops));
|
2019-04-13 00:08:58 +08:00
|
|
|
|
2022-04-15 02:48:11 +08:00
|
|
|
/* probe/remove/shutdown */
|
|
|
|
sof_apl_ops.shutdown = hda_dsp_shutdown;
|
2021-10-04 23:21:44 +08:00
|
|
|
|
2019-04-13 00:08:58 +08:00
|
|
|
/* doorbell */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.irq_thread = hda_dsp_ipc_irq_thread;
|
2019-04-13 00:08:58 +08:00
|
|
|
|
|
|
|
/* ipc */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.send_msg = hda_dsp_ipc_send_msg;
|
2019-12-05 05:15:53 +08:00
|
|
|
|
2019-04-13 00:08:58 +08:00
|
|
|
/* debug */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.debug_map = apl_dsp_debugfs;
|
|
|
|
sof_apl_ops.debug_map_count = ARRAY_SIZE(apl_dsp_debugfs);
|
|
|
|
sof_apl_ops.ipc_dump = hda_ipc_dump;
|
2019-04-13 00:08:58 +08:00
|
|
|
|
|
|
|
/* firmware run */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.run = hda_dsp_cl_boot_firmware;
|
2019-04-13 00:08:58 +08:00
|
|
|
|
|
|
|
/* pre/post fw run */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.post_fw_run = hda_dsp_post_fw_run;
|
2020-11-28 00:40:19 +08:00
|
|
|
|
2021-11-20 03:26:20 +08:00
|
|
|
/* dsp core get/put */
|
2022-04-15 02:48:11 +08:00
|
|
|
sof_apl_ops.core_get = hda_dsp_core_get;
|
2019-04-13 00:08:58 +08:00
|
|
|
|
2022-04-15 02:48:11 +08:00
|
|
|
return 0;
|
2019-04-13 00:08:58 +08:00
|
|
|
};
|
2022-04-15 02:48:11 +08:00
|
|
|
EXPORT_SYMBOL_NS(sof_apl_ops_init, SND_SOC_SOF_INTEL_HDA_COMMON);
|
2019-04-13 00:08:58 +08:00
|
|
|
|
|
|
|
const struct sof_intel_dsp_desc apl_chip_info = {
|
|
|
|
/* Apollolake */
|
|
|
|
.cores_num = 2,
|
|
|
|
.init_core_mask = 1,
|
2020-09-11 00:41:24 +08:00
|
|
|
.host_managed_cores_mask = GENMASK(1, 0),
|
2019-04-13 00:08:58 +08:00
|
|
|
.ipc_req = HDA_DSP_REG_HIPCI,
|
|
|
|
.ipc_req_mask = HDA_DSP_REG_HIPCI_BUSY,
|
|
|
|
.ipc_ack = HDA_DSP_REG_HIPCIE,
|
|
|
|
.ipc_ack_mask = HDA_DSP_REG_HIPCIE_DONE,
|
|
|
|
.ipc_ctl = HDA_DSP_REG_HIPCCTL,
|
|
|
|
.rom_init_timeout = 150,
|
2019-05-01 07:09:21 +08:00
|
|
|
.ssp_count = APL_SSP_COUNT,
|
|
|
|
.ssp_base_offset = APL_SSP_BASE_OFFSET,
|
2021-12-08 03:39:42 +08:00
|
|
|
.quirks = SOF_INTEL_PROCEN_FMT_QUIRK,
|
2019-04-13 00:08:58 +08:00
|
|
|
};
|
2019-12-18 04:22:28 +08:00
|
|
|
EXPORT_SYMBOL_NS(apl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
|