History

ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up()

The hda_dsp_core_power_up() needs to be exposed so that it can be used in hda-loader.c to correct the boot flow. The first step must not unstall the core, it should only power up the core(s). Add sanity check for the core_mask while exposing it to be safe.

Peter Ujfalusi committed 4 years ago

Commit 08f8a931 parent ed0073b2 files · +10 −1Browse files

Unified · Split

2 files
  1. sound/soc/sof/intel/hda-dsp.c +9 −1
  2. sound/soc/sof/intel/hda.h +1 −0
sound/soc/sof/intel/hda-dsp.c+9−1
@@ -181,12 +181,20 @@ int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask) · 180 unmodified lines
181181 * Power Management.
182182 */
183183
184−static int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)
184+int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)
185185 {
186+ struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
187+ const struct sof_intel_dsp_desc *chip = hda->desc;
186188 unsigned int cpa;
187189 u32 adspcs;
188190 int ret;
189191
192+ /* restrict core_mask to host managed cores mask */
193+ core_mask &= chip->host_managed_cores_mask;
194+ /* return if core_mask is not valid */
195+ if (!core_mask)
196+ return 0;
197+
190198 /* update bits */
191199 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS,
192200 HDA_DSP_ADSPCS_SPA_MASK(core_mask),
sound/soc/sof/intel/hda.h+1−0
@@ -497,6 +497,7 @@ struct sof_intel_hda_stream { · 496 unmodified lines
497497 */
498498 int hda_dsp_probe(struct snd_sof_dev *sdev);
499499 int hda_dsp_remove(struct snd_sof_dev *sdev);
500+int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask);
500501 int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask);
501502 int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask);
502503 int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev,