Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
Add multi-core support on mtl#4198
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -346,11 +346,17 @@ static int mtl_dsp_core_power_up(struct snd_sof_dev *sdev, int core) | ||
| ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, MTL_DSP2CXCTL_PRIMARY_CORE, dspcxctl, | ||
| (dspcxctl & cpa) == cpa, HDA_DSP_REG_POLL_INTERVAL_US, | ||
| HDA_DSP_RESET_TIMEOUT_US); | ||
| if (ret < 0) | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "%s: timeout on MTL_DSP2CXCTL_PRIMARY_CORE read\n", | ||
| __func__); | ||
| return ret; | ||
| } | ||
| return ret; | ||
| /* set primary core mask and refcount to 1 */ | ||
| sdev->enabled_cores_mask = BIT(SOF_DSP_PRIMARY_CORE); | ||
| sdev->dsp_core_ref_count[SOF_DSP_PRIMARY_CORE] = 1; | ||
| return 0; | ||
| } | ||
| static int mtl_dsp_core_power_down(struct snd_sof_dev *sdev, int core) | ||
| @@ -373,10 +379,15 @@ static int mtl_dsp_core_power_down(struct snd_sof_dev *sdev, int core) | ||
| !(dspcxctl & MTL_DSP2CXCTL_PRIMARY_CORE_CPA_MASK), | ||
| HDA_DSP_REG_POLL_INTERVAL_US, | ||
| HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC); | ||
| if (ret < 0) | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "failed to power down primary core\n"); | ||
| return ret; | ||
| } | ||
| return ret; | ||
| sdev->enabled_cores_mask = 0; | ||
| sdev->dsp_core_ref_count[SOF_DSP_PRIMARY_CORE] = 0; | ||
| return 0; | ||
| } | ||
| int mtl_power_down_dsp(struct snd_sof_dev *sdev) | ||
| @@ -598,6 +609,36 @@ static u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev, | ||
| return ((u64)llp_u << 32) | llp_l; | ||
| } | ||
| static int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core) | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| { | ||
| const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; | ||
| if (core == SOF_DSP_PRIMARY_CORE) | ||
| return mtl_dsp_core_power_up(sdev, SOF_DSP_PRIMARY_CORE); | ||
| if (pm_ops->set_core_state) | ||
| return pm_ops->set_core_state(sdev, core, true); | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return 0; | ||
| } | ||
| static int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core) | ||
| { | ||
| const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; | ||
| int ret; | ||
| if (pm_ops->set_core_state) { | ||
| ret = pm_ops->set_core_state(sdev, core, false); | ||
| if (ret < 0) | ||
| return ret; | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| if (core == SOF_DSP_PRIMARY_CORE) | ||
| return mtl_dsp_core_power_down(sdev, SOF_DSP_PRIMARY_CORE); | ||
| return 0; | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| /* Meteorlake ops */ | ||
| struct snd_sof_dsp_ops sof_mtl_ops; | ||
| EXPORT_SYMBOL_NS(sof_mtl_ops, SND_SOC_SOF_INTEL_HDA_COMMON); | ||
| @@ -634,7 +675,8 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev) | ||
| sof_mtl_ops.parse_platform_ext_manifest = NULL; | ||
| /* dsp core get/put */ | ||
| /* TODO: add core_get and core_put */ | ||
| sof_mtl_ops.core_get = mtl_dsp_core_get; | ||
| sof_mtl_ops.core_put = mtl_dsp_core_put; | ||
| sof_mtl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -39,14 +39,18 @@ static int tgl_dsp_core_get(struct snd_sof_dev *sdev, int core) | ||
| static int tgl_dsp_core_put(struct snd_sof_dev *sdev, int core) | ||
| { | ||
| const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; | ||
| int ret; | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if (pm_ops->set_core_state) { | ||
| ret = pm_ops->set_core_state(sdev, core, false); | ||
| if (ret < 0) | ||
| return ret; | ||
| } | ||
| /* power down primary core and return */ | ||
| if (core == SOF_DSP_PRIMARY_CORE) | ||
| return hda_dsp_core_reset_power_down(sdev, BIT(core)); | ||
| if (pm_ops->set_core_state) | ||
| return pm_ops->set_core_state(sdev, core, false); | ||
| return 0; | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.