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.
Unified · Split
| @@ -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 | ||
| 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) |
| 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), |
| @@ -497,6 +497,7 @@ struct sof_intel_hda_stream { · 496 unmodified lines | |||
| 497 | */ | 497 | */ |
| 498 | int hda_dsp_probe(struct snd_sof_dev *sdev); | 498 | int hda_dsp_probe(struct snd_sof_dev *sdev); |
| 499 | int hda_dsp_remove(struct snd_sof_dev *sdev); | 499 | 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); | ||
| 500 | int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask); | 501 | int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask); |
| 501 | int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask); | 502 | int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask); |
| 502 | int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev, | 503 | int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev, |