Commit fde10655 authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: Intel: remove the HDA_DSP_CORE_MASK() macro

Remove the HDA_DSP_CORE_MASK() macro and use BIT() and GENMASK()
macros directly for more clarity.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200910164125.2033062-4-kai.vehmanen@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 914fab3b
...@@ -129,7 +129,7 @@ const struct sof_intel_dsp_desc apl_chip_info = { ...@@ -129,7 +129,7 @@ const struct sof_intel_dsp_desc apl_chip_info = {
/* Apollolake */ /* Apollolake */
.cores_num = 2, .cores_num = 2,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0) | HDA_DSP_CORE_MASK(1), .host_managed_cores_mask = GENMASK(1, 0),
.ipc_req = HDA_DSP_REG_HIPCI, .ipc_req = HDA_DSP_REG_HIPCI,
.ipc_req_mask = HDA_DSP_REG_HIPCI_BUSY, .ipc_req_mask = HDA_DSP_REG_HIPCI_BUSY,
.ipc_ack = HDA_DSP_REG_HIPCIE, .ipc_ack = HDA_DSP_REG_HIPCIE,
......
...@@ -334,10 +334,7 @@ const struct sof_intel_dsp_desc cnl_chip_info = { ...@@ -334,10 +334,7 @@ const struct sof_intel_dsp_desc cnl_chip_info = {
/* Cannonlake */ /* Cannonlake */
.cores_num = 4, .cores_num = 4,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0) | .host_managed_cores_mask = GENMASK(3, 0),
HDA_DSP_CORE_MASK(1) |
HDA_DSP_CORE_MASK(2) |
HDA_DSP_CORE_MASK(3),
.ipc_req = CNL_DSP_REG_HIPCIDR, .ipc_req = CNL_DSP_REG_HIPCIDR,
.ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY,
.ipc_ack = CNL_DSP_REG_HIPCIDA, .ipc_ack = CNL_DSP_REG_HIPCIDA,
...@@ -353,10 +350,7 @@ const struct sof_intel_dsp_desc icl_chip_info = { ...@@ -353,10 +350,7 @@ const struct sof_intel_dsp_desc icl_chip_info = {
/* Icelake */ /* Icelake */
.cores_num = 4, .cores_num = 4,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0) | .host_managed_cores_mask = GENMASK(3, 0),
HDA_DSP_CORE_MASK(1) |
HDA_DSP_CORE_MASK(2) |
HDA_DSP_CORE_MASK(3),
.ipc_req = CNL_DSP_REG_HIPCIDR, .ipc_req = CNL_DSP_REG_HIPCIDR,
.ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY,
.ipc_ack = CNL_DSP_REG_HIPCIDA, .ipc_ack = CNL_DSP_REG_HIPCIDA,
...@@ -372,7 +366,7 @@ const struct sof_intel_dsp_desc ehl_chip_info = { ...@@ -372,7 +366,7 @@ const struct sof_intel_dsp_desc ehl_chip_info = {
/* Elkhartlake */ /* Elkhartlake */
.cores_num = 4, .cores_num = 4,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0), .host_managed_cores_mask = BIT(0),
.ipc_req = CNL_DSP_REG_HIPCIDR, .ipc_req = CNL_DSP_REG_HIPCIDR,
.ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY,
.ipc_ack = CNL_DSP_REG_HIPCIDA, .ipc_ack = CNL_DSP_REG_HIPCIDA,
...@@ -388,8 +382,7 @@ const struct sof_intel_dsp_desc jsl_chip_info = { ...@@ -388,8 +382,7 @@ const struct sof_intel_dsp_desc jsl_chip_info = {
/* Jasperlake */ /* Jasperlake */
.cores_num = 2, .cores_num = 2,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0) | .host_managed_cores_mask = GENMASK(1, 0),
HDA_DSP_CORE_MASK(1),
.ipc_req = CNL_DSP_REG_HIPCIDR, .ipc_req = CNL_DSP_REG_HIPCIDR,
.ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY,
.ipc_ack = CNL_DSP_REG_HIPCIDA, .ipc_ack = CNL_DSP_REG_HIPCIDA,
......
...@@ -114,7 +114,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration) ...@@ -114,7 +114,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
((stream_tag - 1) << 9))); ((stream_tag - 1) << 9)));
/* step 3: unset core 0 reset state & unstall/run core 0 */ /* step 3: unset core 0 reset state & unstall/run core 0 */
ret = hda_dsp_core_run(sdev, HDA_DSP_CORE_MASK(0)); ret = hda_dsp_core_run(sdev, BIT(0));
if (ret < 0) { if (ret < 0) {
if (iteration == HDA_FW_BOOT_ATTEMPTS) if (iteration == HDA_FW_BOOT_ATTEMPTS)
dev_err(sdev->dev, dev_err(sdev->dev,
...@@ -146,8 +146,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration) ...@@ -146,8 +146,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
chip->ipc_ack_mask); chip->ipc_ack_mask);
/* step 5: power down corex */ /* step 5: power down corex */
ret = hda_dsp_core_power_down(sdev, ret = hda_dsp_core_power_down(sdev, chip->host_managed_cores_mask & ~(BIT(0)));
chip->host_managed_cores_mask & ~(HDA_DSP_CORE_MASK(0)));
if (ret < 0) { if (ret < 0) {
if (iteration == HDA_FW_BOOT_ATTEMPTS) if (iteration == HDA_FW_BOOT_ATTEMPTS)
dev_err(sdev->dev, dev_err(sdev->dev,
......
...@@ -305,9 +305,6 @@ ...@@ -305,9 +305,6 @@
#define HDA_DSP_ADSPCS_CPA_SHIFT 24 #define HDA_DSP_ADSPCS_CPA_SHIFT 24
#define HDA_DSP_ADSPCS_CPA_MASK(cm) ((cm) << HDA_DSP_ADSPCS_CPA_SHIFT) #define HDA_DSP_ADSPCS_CPA_MASK(cm) ((cm) << HDA_DSP_ADSPCS_CPA_SHIFT)
/* Mask for a given core index, c = 0.. number of supported cores - 1 */
#define HDA_DSP_CORE_MASK(c) BIT(c)
/* /*
* Mask for a given number of cores * Mask for a given number of cores
* nc = number of supported cores * nc = number of supported cores
......
...@@ -124,7 +124,7 @@ const struct sof_intel_dsp_desc tgl_chip_info = { ...@@ -124,7 +124,7 @@ const struct sof_intel_dsp_desc tgl_chip_info = {
/* Tigerlake */ /* Tigerlake */
.cores_num = 4, .cores_num = 4,
.init_core_mask = 1, .init_core_mask = 1,
.host_managed_cores_mask = HDA_DSP_CORE_MASK(0), .host_managed_cores_mask = BIT(0),
.ipc_req = CNL_DSP_REG_HIPCIDR, .ipc_req = CNL_DSP_REG_HIPCIDR,
.ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY, .ipc_req_mask = CNL_DSP_REG_HIPCIDR_BUSY,
.ipc_ack = CNL_DSP_REG_HIPCIDA, .ipc_ack = CNL_DSP_REG_HIPCIDA,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment