Lines Matching refs:ipc

296 static void skl_ipc_tx_msg(struct sst_generic_ipc *ipc, struct ipc_message *msg)  in skl_ipc_tx_msg()  argument
301 sst_dsp_outbox_write(ipc->dsp, msg->tx.data, msg->tx.size); in skl_ipc_tx_msg()
302 sst_dsp_shim_write_unlocked(ipc->dsp, SKL_ADSP_REG_HIPCIE, in skl_ipc_tx_msg()
304 sst_dsp_shim_write_unlocked(ipc->dsp, SKL_ADSP_REG_HIPCI, in skl_ipc_tx_msg()
325 static struct ipc_message *skl_ipc_reply_get_msg(struct sst_generic_ipc *ipc, in skl_ipc_reply_get_msg() argument
331 if (list_empty(&ipc->rx_list)) { in skl_ipc_reply_get_msg()
332 dev_err(ipc->dev, "ipc: rx list is empty but received 0x%x\n", in skl_ipc_reply_get_msg()
337 msg = list_first_entry(&ipc->rx_list, struct ipc_message, list); in skl_ipc_reply_get_msg()
345 int skl_ipc_process_notification(struct sst_generic_ipc *ipc, in skl_ipc_process_notification() argument
348 struct skl_dev *skl = container_of(ipc, struct skl_dev, ipc); in skl_ipc_process_notification()
354 dev_err(ipc->dev, "FW Underrun %x\n", header.primary); in skl_ipc_process_notification()
358 dev_err(ipc->dev, "MCPS Budget Violation: %x\n", in skl_ipc_process_notification()
368 dev_dbg(ipc->dev, "***** Phrase Detected **********\n"); in skl_ipc_process_notification()
376 skl->enable_miscbdcge(ipc->dev, false); in skl_ipc_process_notification()
381 dev_err(ipc->dev, "ipc: Unhandled error msg=%x\n", in skl_ipc_process_notification()
405 static int skl_ipc_set_reply_error_code(struct sst_generic_ipc *ipc, u32 reply) in skl_ipc_set_reply_error_code() argument
415 dev_err(ipc->dev, "ipc FW reply: %d FW Error Code: %u\n", in skl_ipc_set_reply_error_code()
417 ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); in skl_ipc_set_reply_error_code()
422 dev_err(ipc->dev, "ipc FW reply: %s FW Error Code: %u\n", in skl_ipc_set_reply_error_code()
424 ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); in skl_ipc_set_reply_error_code()
426 dev_info(ipc->dev, "ipc FW reply: %s FW Error Code: %u\n", in skl_ipc_set_reply_error_code()
428 ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); in skl_ipc_set_reply_error_code()
433 void skl_ipc_process_reply(struct sst_generic_ipc *ipc, in skl_ipc_process_reply() argument
439 struct skl_dev *skl = container_of(ipc, struct skl_dev, ipc); in skl_ipc_process_reply()
442 spin_lock_irqsave(&ipc->dsp->spinlock, flags); in skl_ipc_process_reply()
443 msg = skl_ipc_reply_get_msg(ipc, *ipc_header); in skl_ipc_process_reply()
444 spin_unlock_irqrestore(&ipc->dsp->spinlock, flags); in skl_ipc_process_reply()
446 dev_dbg(ipc->dev, "ipc: rx list is empty\n"); in skl_ipc_process_reply()
453 dev_dbg(ipc->dev, "ipc FW reply %x: success\n", header.primary); in skl_ipc_process_reply()
455 sst_dsp_inbox_read(ipc->dsp, msg->rx.data, msg->rx.size); in skl_ipc_process_reply()
469 msg->errno = skl_ipc_set_reply_error_code(ipc, reply); in skl_ipc_process_reply()
484 spin_lock_irqsave(&ipc->dsp->spinlock, flags); in skl_ipc_process_reply()
485 sst_ipc_tx_msg_reply_complete(ipc, msg); in skl_ipc_process_reply()
486 spin_unlock_irqrestore(&ipc->dsp->spinlock, flags); in skl_ipc_process_reply()
493 struct sst_generic_ipc *ipc = &skl->ipc; in skl_dsp_irq_thread_handler() local
536 skl_ipc_process_reply(ipc, header); in skl_dsp_irq_thread_handler()
539 skl_ipc_process_notification(ipc, header); in skl_dsp_irq_thread_handler()
553 schedule_work(&ipc->kwork); in skl_dsp_irq_thread_handler()
601 struct sst_generic_ipc *ipc; in skl_ipc_init() local
604 ipc = &skl->ipc; in skl_ipc_init()
605 ipc->dsp = skl->dsp; in skl_ipc_init()
606 ipc->dev = dev; in skl_ipc_init()
608 ipc->tx_data_max_size = SKL_ADSP_W1_SZ; in skl_ipc_init()
609 ipc->rx_data_max_size = SKL_ADSP_W0_UP_SZ; in skl_ipc_init()
611 err = sst_ipc_init(ipc); in skl_ipc_init()
615 ipc->ops.tx_msg = skl_ipc_tx_msg; in skl_ipc_init()
616 ipc->ops.tx_data_copy = skl_ipc_tx_data_copy; in skl_ipc_init()
617 ipc->ops.is_dsp_busy = skl_ipc_is_dsp_busy; in skl_ipc_init()
622 void skl_ipc_free(struct sst_generic_ipc *ipc) in skl_ipc_free() argument
625 sst_dsp_shim_update_bits(ipc->dsp, SKL_ADSP_REG_HIPCCTL, in skl_ipc_free()
629 sst_dsp_shim_update_bits(ipc->dsp, SKL_ADSP_REG_HIPCCTL, in skl_ipc_free()
632 sst_ipc_fini(ipc); in skl_ipc_free()
635 int skl_ipc_create_pipeline(struct sst_generic_ipc *ipc, in skl_ipc_create_pipeline() argument
652 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); in skl_ipc_create_pipeline()
653 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_create_pipeline()
655 dev_err(ipc->dev, "ipc: create pipeline fail, err: %d\n", ret); in skl_ipc_create_pipeline()
663 int skl_ipc_delete_pipeline(struct sst_generic_ipc *ipc, u8 instance_id) in skl_ipc_delete_pipeline() argument
675 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); in skl_ipc_delete_pipeline()
676 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_delete_pipeline()
678 dev_err(ipc->dev, "ipc: delete pipeline failed, err %d\n", ret); in skl_ipc_delete_pipeline()
686 int skl_ipc_set_pipeline_state(struct sst_generic_ipc *ipc, in skl_ipc_set_pipeline_state() argument
700 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); in skl_ipc_set_pipeline_state()
701 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_set_pipeline_state()
703 dev_err(ipc->dev, "ipc: set pipeline state failed, err: %d\n", ret); in skl_ipc_set_pipeline_state()
711 skl_ipc_save_pipeline(struct sst_generic_ipc *ipc, u8 instance_id, int dma_id) in skl_ipc_save_pipeline() argument
725 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); in skl_ipc_save_pipeline()
726 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_save_pipeline()
728 dev_err(ipc->dev, "ipc: save pipeline failed, err: %d\n", ret); in skl_ipc_save_pipeline()
736 int skl_ipc_restore_pipeline(struct sst_generic_ipc *ipc, u8 instance_id) in skl_ipc_restore_pipeline() argument
748 dev_dbg(ipc->dev, "In %s header=%d\n", __func__, header.primary); in skl_ipc_restore_pipeline()
749 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_restore_pipeline()
751 dev_err(ipc->dev, "ipc: restore pipeline failed, err: %d\n", ret); in skl_ipc_restore_pipeline()
759 int skl_ipc_set_dx(struct sst_generic_ipc *ipc, u8 instance_id, in skl_ipc_set_dx() argument
776 dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__, in skl_ipc_set_dx()
778 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_set_dx()
780 dev_err(ipc->dev, "ipc: set dx failed, err %d\n", ret); in skl_ipc_set_dx()
788 int skl_ipc_init_instance(struct sst_generic_ipc *ipc, in skl_ipc_init_instance() argument
816 dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__, in skl_ipc_init_instance()
818 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_init_instance()
821 dev_err(ipc->dev, "ipc: init instance failed\n"); in skl_ipc_init_instance()
829 int skl_ipc_bind_unbind(struct sst_generic_ipc *ipc, in skl_ipc_bind_unbind() argument
849 dev_dbg(ipc->dev, "In %s hdr=%x ext=%x\n", __func__, header.primary, in skl_ipc_bind_unbind()
851 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_bind_unbind()
853 dev_err(ipc->dev, "ipc: bind/unbind failed\n"); in skl_ipc_bind_unbind()
867 int skl_ipc_load_modules(struct sst_generic_ipc *ipc, in skl_ipc_load_modules() argument
883 ret = sst_ipc_tx_message_nowait(ipc, request); in skl_ipc_load_modules()
885 dev_err(ipc->dev, "ipc: load modules failed :%d\n", ret); in skl_ipc_load_modules()
891 int skl_ipc_unload_modules(struct sst_generic_ipc *ipc, u8 module_cnt, in skl_ipc_unload_modules() argument
907 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_unload_modules()
909 dev_err(ipc->dev, "ipc: unload modules failed :%d\n", ret); in skl_ipc_unload_modules()
915 int skl_ipc_set_large_config(struct sst_generic_ipc *ipc, in skl_ipc_set_large_config() argument
942 dev_dbg(ipc->dev, "In %s primary=%#x ext=%#x\n", __func__, in skl_ipc_set_large_config()
944 dev_dbg(ipc->dev, "transmitting offset: %#x, size: %#x\n", in skl_ipc_set_large_config()
950 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_ipc_set_large_config()
952 dev_err(ipc->dev, in skl_ipc_set_large_config()
971 int skl_ipc_get_large_config(struct sst_generic_ipc *ipc, in skl_ipc_get_large_config() argument
1000 ret = sst_ipc_tx_message_wait(ipc, request, &reply); in skl_ipc_get_large_config()
1002 dev_err(ipc->dev, "ipc: get large config fail, err: %d\n", ret); in skl_ipc_get_large_config()
1015 int skl_sst_ipc_load_library(struct sst_generic_ipc *ipc, in skl_sst_ipc_load_library() argument
1030 ret = sst_ipc_tx_message_wait(ipc, request, NULL); in skl_sst_ipc_load_library()
1032 ret = sst_ipc_tx_message_nowait(ipc, request); in skl_sst_ipc_load_library()
1035 dev_err(ipc->dev, "ipc: load lib failed\n"); in skl_sst_ipc_load_library()
1041 int skl_ipc_set_d0ix(struct sst_generic_ipc *ipc, struct skl_ipc_d0ix_msg *msg) in skl_ipc_set_d0ix() argument
1057 dev_dbg(ipc->dev, "In %s primary=%x ext=%x\n", __func__, in skl_ipc_set_d0ix()
1063 ret = sst_ipc_tx_message_nopm(ipc, request, NULL); in skl_ipc_set_d0ix()
1065 dev_err(ipc->dev, "ipc: set d0ix failed, err %d\n", ret); in skl_ipc_set_d0ix()