Lines Matching +full:ipc +full:- +full:3
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
15 #include "../ipc4-priv.h"
18 #include "hda-ipc.h"
19 #include "../sof-audio.h"
46 * set DONE bit - tell DSP we have received the reply msg from DSP, and processed it, in mtl_ipc_dsp_done()
57 /* Check if an IPC IRQ occurred */
93 struct sof_ipc4_msg *msg_data = msg->msg_data; in mtl_ipc_send_msg()
96 if (msg_data->data_size) in mtl_ipc_send_msg()
97 sof_mailbox_write(sdev, sdev->host_box.offset, msg_data->data_ptr, in mtl_ipc_send_msg()
98 msg_data->data_size); in mtl_ipc_send_msg()
101 msg_data->extension); in mtl_ipc_send_msg()
103 msg_data->primary | MTL_DSP_REG_HFIPCXIDR_BUSY); in mtl_ipc_send_msg()
110 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in mtl_enable_ipc_interrupts()
111 const struct sof_intel_dsp_desc *chip = hda->desc; in mtl_enable_ipc_interrupts()
113 /* enable IPC DONE and BUSY interrupts */ in mtl_enable_ipc_interrupts()
114 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl, in mtl_enable_ipc_interrupts()
121 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in mtl_disable_ipc_interrupts()
122 const struct sof_intel_dsp_desc *chip = hda->desc; in mtl_disable_ipc_interrupts()
124 /* disable IPC DONE and BUSY interrupts */ in mtl_disable_ipc_interrupts()
125 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl, in mtl_disable_ipc_interrupts()
140 /* Enable Host IPC and SOUNDWIRE */ in mtl_enable_interrupts()
151 dev_err(sdev->dev, "failed to enable Host IPC and/or SOUNDWIRE\n"); in mtl_enable_interrupts()
155 /* Set Host IPC interrupt enable */ in mtl_enable_interrupts()
165 dev_err(sdev->dev, "failed to set Host IPC interrupt enable\n"); in mtl_enable_interrupts()
176 dev_err(sdev->dev, "failed to set SoundWire IPC interrupt enable\n"); in mtl_enable_interrupts()
193 /* Disable Host IPC and SOUNDWIRE */ in mtl_disable_interrupts()
204 dev_err(sdev->dev, "failed to disable Host IPC and SoundWire\n"); in mtl_disable_interrupts()
206 /* Set Host IPC interrupt disable */ in mtl_disable_interrupts()
217 dev_err(sdev->dev, "failed to set Host IPC interrupt disable\n"); in mtl_disable_interrupts()
222 /* Set SoundWire IPC interrupt disable */ in mtl_disable_interrupts()
231 dev_err(sdev->dev, "failed to set SoundWire IPC interrupt disable\n"); in mtl_disable_interrupts()
261 dev_err(sdev->dev, "failed to enable DSP subsystem\n"); in mtl_dsp_pre_fw_run()
265 /* Power up gated-DSP-0 domain in order to access the DSP shim register block. */ in mtl_dsp_pre_fw_run()
278 dev_err(sdev->dev, "failed to power up gated DSP domain\n"); in mtl_dsp_pre_fw_run()
280 /* make sure SoundWire is not power-gated */ in mtl_dsp_pre_fw_run()
290 if (sdev->first_boot) { in mtl_dsp_post_fw_run()
291 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in mtl_dsp_post_fw_run()
295 dev_err(sdev->dev, "could not startup SoundWire links\n"); in mtl_dsp_post_fw_run()
301 hdev->imrboot_supported = true; in mtl_dsp_post_fw_run()
321 dev_err(sdev->dev, "ROM status: %#x, ROM error: %#x\n", fwsts, fwlec); in mtl_dsp_dump()
322 dev_err(sdev->dev, "ROM debug status: %#x, ROM debug error: %#x\n", romdbgsts, in mtl_dsp_dump()
324 romdbgsts = snd_sof_dsp_read(sdev, HDA_DSP_BAR, MTL_DSP_REG_HFFLGPXQWY + 0x8 * 3); in mtl_dsp_dump()
325 dev_printk(level, sdev->dev, "ROM feature bit%s enabled\n", in mtl_dsp_dump()
369 dev_err(sdev->dev, "%s: timeout on MTL_DSP2CXCTL_PRIMARY_CORE read\n", in mtl_dsp_core_power_up()
396 dev_err(sdev->dev, "failed to power down primary core\n"); in mtl_dsp_core_power_down()
409 dev_err(sdev->dev, "mtl dsp power down error, %d\n", ret); in mtl_power_down_dsp()
430 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in mtl_dsp_cl_init()
431 const struct sof_intel_dsp_desc *chip = hda->desc; in mtl_dsp_cl_init()
437 ipc_hdr = chip->ipc_req_mask | HDA_DSP_ROM_IPC_CONTROL; in mtl_dsp_cl_init()
439 ipc_hdr |= HDA_DSP_ROM_IPC_PURGE_FW | ((stream_tag - 1) << 9); in mtl_dsp_cl_init()
441 snd_sof_dsp_write(sdev, HDA_DSP_BAR, chip->ipc_req, ipc_hdr); in mtl_dsp_cl_init()
446 if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS) in mtl_dsp_cl_init()
447 dev_err(sdev->dev, "dsp core 0/1 power up failed\n"); in mtl_dsp_cl_init()
451 dev_dbg(sdev->dev, "Primary core power up successful\n"); in mtl_dsp_cl_init()
453 /* step 3: wait for IPC DONE bit from ROM */ in mtl_dsp_cl_init()
454 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, chip->ipc_ack, status, in mtl_dsp_cl_init()
455 ((status & chip->ipc_ack_mask) == chip->ipc_ack_mask), in mtl_dsp_cl_init()
458 if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS) in mtl_dsp_cl_init()
459 dev_err(sdev->dev, "timeout waiting for purge IPC done\n"); in mtl_dsp_cl_init()
463 /* set DONE bit to clear the reply IPC message */ in mtl_dsp_cl_init()
464 snd_sof_dsp_update_bits_forced(sdev, HDA_DSP_BAR, chip->ipc_ack, chip->ipc_ack_mask, in mtl_dsp_cl_init()
465 chip->ipc_ack_mask); in mtl_dsp_cl_init()
470 if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS) in mtl_dsp_cl_init()
471 dev_err(sdev->dev, "%s: failed to enable interrupts\n", __func__); in mtl_dsp_cl_init()
519 * ACE fw sends a new fw ipc message to host to in mtl_ipc_irq_thread()
520 * notify the status of the last host ipc message in mtl_ipc_irq_thread()
524 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in mtl_ipc_irq_thread()
525 struct sof_ipc4_msg *data = sdev->ipc->msg.reply_data; in mtl_ipc_irq_thread()
527 data->primary = primary; in mtl_ipc_irq_thread()
528 data->extension = extension; in mtl_ipc_irq_thread()
530 spin_lock_irq(&sdev->ipc_lock); in mtl_ipc_irq_thread()
533 snd_sof_ipc_reply(sdev, data->primary); in mtl_ipc_irq_thread()
535 spin_unlock_irq(&sdev->ipc_lock); in mtl_ipc_irq_thread()
537 dev_dbg_ratelimited(sdev->dev, in mtl_ipc_irq_thread()
538 "IPC reply before FW_READY: %#x|%#x\n", in mtl_ipc_irq_thread()
546 sdev->ipc->msg.rx_data = ¬ification_data; in mtl_ipc_irq_thread()
548 sdev->ipc->msg.rx_data = NULL; in mtl_ipc_irq_thread()
558 dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n"); in mtl_ipc_irq_thread()
586 dev_err(sdev->dev, in mtl_ipc_dump()
587 "Host IPC initiator: %#x|%#x|%#x, target: %#x|%#x|%#x, ctl: %#x\n", in mtl_ipc_dump()
614 /* ipc */ in sof_mtl_ops_init()
635 sdev->private = devm_kzalloc(sdev->dev, sizeof(struct sof_ipc4_fw_data), GFP_KERNEL); in sof_mtl_ops_init()
636 if (!sdev->private) in sof_mtl_ops_init()
637 return -ENOMEM; in sof_mtl_ops_init()
639 ipc4_data = sdev->private; in sof_mtl_ops_init()
640 ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET; in sof_mtl_ops_init()
642 ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2; in sof_mtl_ops_init()
652 .cores_num = 3,