Skip to content

Commit b2b05b0

Browse files
crojewsk-intelgregkh
authored andcommitted
ASoC: Intel: Skylake: Await purge request ack on CNL
commit 7693cad upstream. Each purge request is sent by driver after master core is powered up and unresetted but before it is unstalled. On unstall, ROM begins processing the request and initializing environment for FW load. Host should await ROM's ack before moving forward. Without doing so, ROM init poll may start too early and false timeouts can occur. Fixes: cb6a552 ("ASoC: Intel: cnl: Add sst library functions for cnl platform") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200305145314.32579-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org> # 5.4.x Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a28144d commit b2b05b0

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

sound/soc/intel/skylake/bxt-sst.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "skl.h"
1818

1919
#define BXT_BASEFW_TIMEOUT 3000
20-
#define BXT_INIT_TIMEOUT 300
2120
#define BXT_ROM_INIT_TIMEOUT 70
2221
#define BXT_IPC_PURGE_FW 0x01004000
2322

sound/soc/intel/skylake/cnl-sst.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,34 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize)
5757
ctx->dsp_ops.stream_tag = stream_tag;
5858
memcpy(ctx->dmab.area, fwdata, fwsize);
5959

60+
ret = skl_dsp_core_power_up(ctx, SKL_DSP_CORE0_MASK);
61+
if (ret < 0) {
62+
dev_err(ctx->dev, "dsp core0 power up failed\n");
63+
ret = -EIO;
64+
goto base_fw_load_failed;
65+
}
66+
6067
/* purge FW request */
6168
sst_dsp_shim_write(ctx, CNL_ADSP_REG_HIPCIDR,
6269
CNL_ADSP_REG_HIPCIDR_BUSY | (CNL_IPC_PURGE |
6370
((stream_tag - 1) << CNL_ROM_CTRL_DMA_ID)));
6471

65-
ret = cnl_dsp_enable_core(ctx, SKL_DSP_CORE0_MASK);
72+
ret = skl_dsp_start_core(ctx, SKL_DSP_CORE0_MASK);
6673
if (ret < 0) {
67-
dev_err(ctx->dev, "dsp boot core failed ret: %d\n", ret);
74+
dev_err(ctx->dev, "Start dsp core failed ret: %d\n", ret);
6875
ret = -EIO;
6976
goto base_fw_load_failed;
7077
}
7178

79+
ret = sst_dsp_register_poll(ctx, CNL_ADSP_REG_HIPCIDA,
80+
CNL_ADSP_REG_HIPCIDA_DONE,
81+
CNL_ADSP_REG_HIPCIDA_DONE,
82+
BXT_INIT_TIMEOUT, "HIPCIDA Done");
83+
if (ret < 0) {
84+
dev_err(ctx->dev, "timeout for purge request: %d\n", ret);
85+
goto base_fw_load_failed;
86+
}
87+
7288
/* enable interrupt */
7389
cnl_ipc_int_enable(ctx);
7490
cnl_ipc_op_int_enable(ctx);

sound/soc/intel/skylake/skl-sst-dsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct skl_dev;
6868
#define SKL_FW_INIT 0x1
6969
#define SKL_FW_RFW_START 0xf
7070
#define BXT_FW_ROM_INIT_RETRY 3
71+
#define BXT_INIT_TIMEOUT 300
7172

7273
#define SKL_ADSPIC_IPC 1
7374
#define SKL_ADSPIS_IPC 1

0 commit comments

Comments
 (0)