-
Notifications
You must be signed in to change notification settings - Fork 140
IPC4: TGL: Add multicore support #3711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d3a0a1
9c7208b
7a67cb8
c2608f9
d94e66b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| * Hardware interface for audio DSP on Tigerlake. | ||
| */ | ||
|
|
||
| #include <sound/sof/ipc4/header.h> | ||
| #include <sound/sof/ext_manifest4.h> | ||
| #include "../ipc4-priv.h" | ||
| #include "../ops.h" | ||
|
|
@@ -50,6 +51,40 @@ static int tgl_dsp_core_put(struct snd_sof_dev *sdev, int core) | |
| return 0; | ||
| } | ||
|
|
||
| static int tgl_dsp_ipc4_core_get(struct snd_sof_dev *sdev, int core) | ||
| { | ||
| struct sof_ipc4_msg msg; | ||
| struct sof_ipc4_dx_info dx_info; | ||
|
|
||
| dx_info.core_mask = BIT(core); | ||
| dx_info.dx_mask = BIT(core); | ||
| msg.primary = SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_MOD_SET_DX); | ||
| msg.primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST); | ||
| msg.primary |= SOF_IPC4_MSG_TARGET(SOF_IPC4_MODULE_MSG); | ||
| msg.data_ptr = &dx_info; | ||
| msg.data_size = sizeof(dx_info); | ||
|
|
||
| /* now send the iPC */ | ||
| return sof_ipc_tx_message(sdev->ipc, &msg, sizeof(dx_info), NULL, 0); | ||
| } | ||
|
|
||
| static int tgl_dsp_ipc4_core_put(struct snd_sof_dev *sdev, int core) | ||
| { | ||
| struct sof_ipc4_msg msg; | ||
| struct sof_ipc4_dx_info dx_info; | ||
|
|
||
| dx_info.core_mask = BIT(core); | ||
| dx_info.dx_mask = ~BIT(core); | ||
| msg.primary = SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_MOD_SET_DX); | ||
| msg.primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST); | ||
| msg.primary |= SOF_IPC4_MSG_TARGET(SOF_IPC4_MODULE_MSG); | ||
| msg.data_ptr = &dx_info; | ||
| msg.data_size = sizeof(dx_info); | ||
|
|
||
| /* now send the iPC */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IPC |
||
| return sof_ipc_tx_message(sdev->ipc, &msg, sizeof(dx_info), NULL, 0); | ||
| } | ||
|
|
||
| /* Tigerlake ops */ | ||
| struct snd_sof_dsp_ops sof_tgl_ops; | ||
| EXPORT_SYMBOL_NS(sof_tgl_ops, SND_SOC_SOF_INTEL_HDA_COMMON); | ||
|
|
@@ -68,6 +103,10 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) | |
|
|
||
| /* ipc */ | ||
| sof_tgl_ops.send_msg = cnl_ipc_send_msg; | ||
|
|
||
| /* dsp core get/put */ | ||
| sof_tgl_ops.core_get = tgl_dsp_core_get; | ||
| sof_tgl_ops.core_put = tgl_dsp_core_put; | ||
| } | ||
|
|
||
| if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { | ||
|
|
@@ -85,6 +124,10 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) | |
|
|
||
| /* ipc */ | ||
| sof_tgl_ops.send_msg = cnl_ipc4_send_msg; | ||
|
|
||
| /* dsp core get/put */ | ||
| sof_tgl_ops.core_get = tgl_dsp_ipc4_core_get; | ||
| sof_tgl_ops.core_put = tgl_dsp_ipc4_core_put; | ||
| } | ||
|
|
||
| /* set DAI driver ops */ | ||
|
|
@@ -101,10 +144,6 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) | |
| /* firmware run */ | ||
| sof_tgl_ops.run = hda_dsp_cl_boot_firmware_iccmax; | ||
|
|
||
| /* dsp core get/put */ | ||
| sof_tgl_ops.core_get = tgl_dsp_core_get; | ||
| sof_tgl_ops.core_put = tgl_dsp_core_put; | ||
|
|
||
| return 0; | ||
| }; | ||
| EXPORT_SYMBOL_NS(sof_tgl_ops_init, SND_SOC_SOF_INTEL_HDA_COMMON); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,4 +48,14 @@ extern const struct sof_ipc_pcm_ops ipc4_pcm_ops; | |
|
|
||
| int sof_ipc4_set_pipeline_state(struct snd_sof_dev *sdev, u32 id, u32 state); | ||
|
|
||
| /** | ||
| * struct sof_ipc4_dx_info: ipc4 core/Dx mask data | ||
| * @core_mask: core mask | ||
| * @dx_mask: Dx mask | ||
| */ | ||
| struct sof_ipc4_dx_info { | ||
| u32 core_mask; | ||
| u32 dx_mask; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is very confusing, please describe more. is core_mask the active cores, the managed cores? Why do we need a new definition? Likewise Dx means 1 for D0 and 0 for D3? What about D0ix for core0? |
||
| }; | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPC