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
181 * Power Management.181 * Power Management.
182 */182 */
183 183
184static int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)184int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)
185{185{
186 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
187 const struct sof_intel_dsp_desc *chip = hda->desc;
186 unsigned int cpa;188 unsigned int cpa;
187 u32 adspcs;189 u32 adspcs;
188 int ret;190 int ret;
189 191
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
190 /* update bits */198 /* update bits */
191 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS,199 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS,
192 HDA_DSP_ADSPCS_SPA_MASK(core_mask),200 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
497 */497 */
498int hda_dsp_probe(struct snd_sof_dev *sdev);498int hda_dsp_probe(struct snd_sof_dev *sdev);
499int hda_dsp_remove(struct snd_sof_dev *sdev);499int hda_dsp_remove(struct snd_sof_dev *sdev);
500int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask);
500int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask);501int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask);
501int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask);502int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask);
502int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev,503int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev,