Lines Matching +full:timer +full:- +full:dsp

1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
15 * Hardware interface for audio DSP on Cannonlake.
21 #include "../ipc4-priv.h"
24 #include "hda-ipc.h"
25 #include "../sof-audio.h"
30 {"dsp", HDA_DSP_BAR, 0, 0x10000, SOF_DEBUGFS_ACCESS_ALWAYS},
47 /* DSP received the message */ in cnl_ipc4_irq_thread()
58 /* Message from DSP (reply or notification) */ in cnl_ipc4_irq_thread()
66 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in cnl_ipc4_irq_thread()
67 struct sof_ipc4_msg *data = sdev->ipc->msg.reply_data; in cnl_ipc4_irq_thread()
69 data->primary = primary; in cnl_ipc4_irq_thread()
70 data->extension = extension; in cnl_ipc4_irq_thread()
72 spin_lock_irq(&sdev->ipc_lock); in cnl_ipc4_irq_thread()
76 snd_sof_ipc_reply(sdev, data->primary); in cnl_ipc4_irq_thread()
78 spin_unlock_irq(&sdev->ipc_lock); in cnl_ipc4_irq_thread()
80 dev_dbg_ratelimited(sdev->dev, in cnl_ipc4_irq_thread()
89 sdev->ipc->msg.rx_data = &notification_data; in cnl_ipc4_irq_thread()
91 sdev->ipc->msg.rx_data = NULL; in cnl_ipc4_irq_thread()
93 /* Let DSP know that we have finished processing the message */ in cnl_ipc4_irq_thread()
102 dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n"); in cnl_ipc4_irq_thread()
105 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in cnl_ipc4_irq_thread()
107 if (hdev->delayed_ipc_tx_msg) in cnl_ipc4_irq_thread()
108 cnl_ipc4_send_msg(sdev, hdev->delayed_ipc_tx_msg); in cnl_ipc4_irq_thread()
131 /* reply message from DSP */ in cnl_ipc_irq_thread()
143 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in cnl_ipc_irq_thread()
144 spin_lock_irq(&sdev->ipc_lock); in cnl_ipc_irq_thread()
146 /* handle immediate reply from DSP core */ in cnl_ipc_irq_thread()
152 spin_unlock_irq(&sdev->ipc_lock); in cnl_ipc_irq_thread()
154 dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_READY: %#x\n", in cnl_ipc_irq_thread()
161 /* new message from DSP */ in cnl_ipc_irq_thread()
168 /* handle messages from DSP */ in cnl_ipc_irq_thread()
170 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in cnl_ipc_irq_thread()
178 * to false as the DSP might be able to boot in the next in cnl_ipc_irq_thread()
181 if (sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS && in cnl_ipc_irq_thread()
182 hda->boot_iteration < HDA_FW_BOOT_ATTEMPTS) in cnl_ipc_irq_thread()
200 dev_dbg_ratelimited(sdev->dev, in cnl_ipc_irq_thread()
211 * clear busy interrupt to tell dsp controller this in cnl_ipc_host_done()
219 * set done bit to ack dsp the msg has been in cnl_ipc_host_done()
220 * processed and send reply msg to dsp in cnl_ipc_host_done()
231 * set DONE bit - tell DSP we have received the reply msg in cnl_ipc_dsp_done()
232 * from DSP, and processed it, don't send more reply to host in cnl_ipc_dsp_done()
249 struct sof_ipc_pm_gate *pm_gate = msg->msg_data; in cnl_compact_ipc_compress()
251 if (pm_gate->hdr.cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE)) { in cnl_compact_ipc_compress()
256 *dd = pm_gate->flags; in cnl_compact_ipc_compress()
266 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in cnl_ipc4_send_msg()
267 struct sof_ipc4_msg *msg_data = msg->msg_data; in cnl_ipc4_send_msg()
270 hdev->delayed_ipc_tx_msg = msg; in cnl_ipc4_send_msg()
274 hdev->delayed_ipc_tx_msg = NULL; in cnl_ipc4_send_msg()
277 if (msg_data->data_size) in cnl_ipc4_send_msg()
278 sof_mailbox_write(sdev, sdev->host_box.offset, msg_data->data_ptr, in cnl_ipc4_send_msg()
279 msg_data->data_size); in cnl_ipc4_send_msg()
281 snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDD, msg_data->extension); in cnl_ipc4_send_msg()
283 msg_data->primary | CNL_DSP_REG_HIPCIDR_BUSY); in cnl_ipc4_send_msg()
293 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in cnl_ipc_send_msg()
300 * IPC which is used for transitioning the DSP between the in cnl_ipc_send_msg()
303 * that a compact IPC results in the DSP exiting D0I3 without in cnl_ipc_send_msg()
316 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, in cnl_ipc_send_msg()
317 msg->msg_size); in cnl_ipc_send_msg()
321 hdr = msg->msg_data; in cnl_ipc_send_msg()
326 * IPCs are sent at a high-rate. mod_delayed_work() in cnl_ipc_send_msg()
327 * modifies the timer if the work is pending. in cnl_ipc_send_msg()
329 * CTX_SAVE IPC, which is sent before the DSP enters D3. in cnl_ipc_send_msg()
331 if (hdr->cmd != (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE)) in cnl_ipc_send_msg()
332 mod_delayed_work(system_wq, &hdev->d0i3_work, in cnl_ipc_send_msg()
354 dev_err(sdev->dev, in cnl_ipc_dump()
355 "error: host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", in cnl_ipc_dump()
376 dev_err(sdev->dev, in cnl_ipc4_dump()
395 if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { in sof_cnl_ops_init()
408 if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { in sof_cnl_ops_init()
411 sdev->private = kzalloc(sizeof(*ipc4_data), GFP_KERNEL); in sof_cnl_ops_init()
412 if (!sdev->private) in sof_cnl_ops_init()
413 return -ENOMEM; in sof_cnl_ops_init()
415 ipc4_data = sdev->private; in sof_cnl_ops_init()
416 ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET; in sof_cnl_ops_init()
418 ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_1_8; in sof_cnl_ops_init()
421 ipc4_data->load_library = hda_dsp_ipc4_load_library; in sof_cnl_ops_init()
448 /* dsp core get/put */ in sof_cnl_ops_init()
487 * two cores, it cannot support the IceLake-specific power-up sequences