diff options
author | Jayachandran B <jayachandran.b@intel.com> | 2016-06-21 10:17:41 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-22 16:13:12 +0100 |
commit | 052f103c89aa8ff6a72a4cadc0a5471cc8bc4c93 (patch) | |
tree | ba87d20ce1e7d7bf43d2460a4c6f63c66992c7a5 /sound/soc/intel/skylake/skl-sst.c | |
parent | 957427d94a82459b080a99cc7e9f4d5b8c067410 (diff) | |
download | lwn-052f103c89aa8ff6a72a4cadc0a5471cc8bc4c93.tar.gz lwn-052f103c89aa8ff6a72a4cadc0a5471cc8bc4c93.zip |
ASoC: Intel: Skylake: Add DSP muti-core infrastructure
The DSP can have more than one cores. In that case the secondary
core has to be managed by the driver. This patch adds the changes
to driver infrastructure to support multiple core.
A new object skl_dsp_cores is introduced to support multiple
core. Helpers skl_dsp_get_core() skl_dsp_put_core() help to
managed the cores.
Many of the power_up/down and DSP APIs take additional argument
of core_id. The primary core, 0 is always powered up first and
then on demand second core.
Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake/skl-sst.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-sst.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index eaf0c9d19782..ecaca94d2a96 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -84,10 +84,8 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev); if (ret < 0) { dev_err(ctx->dev, "Request firmware failed %d\n", ret); - skl_dsp_disable_core(ctx); return -EIO; } - } ret = snd_skl_parse_uuids(ctx, SKL_ADSP_FW_BIN_HDR_OFFSET); @@ -95,7 +93,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) dev_err(ctx->dev, "UUID parsing err: %d\n", ret); release_firmware(ctx->fw); - skl_dsp_disable_core(ctx); + skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); return ret; } @@ -159,13 +157,13 @@ static int skl_load_base_firmware(struct sst_dsp *ctx) transfer_firmware_failed: ctx->cl_dev.ops.cl_cleanup_controller(ctx); skl_load_base_firmware_failed: - skl_dsp_disable_core(ctx); + skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK); release_firmware(ctx->fw); ctx->fw = NULL; return ret; } -static int skl_set_dsp_D0(struct sst_dsp *ctx) +static int skl_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) { int ret; @@ -180,7 +178,7 @@ static int skl_set_dsp_D0(struct sst_dsp *ctx) return ret; } -static int skl_set_dsp_D3(struct sst_dsp *ctx) +static int skl_set_dsp_D3(struct sst_dsp *ctx, unsigned int core_id) { int ret; struct skl_ipc_dxstate_info dx; @@ -207,7 +205,7 @@ static int skl_set_dsp_D3(struct sst_dsp *ctx) skl_ipc_op_int_disable(ctx); skl_ipc_int_disable(ctx); - ret = skl_dsp_disable_core(ctx); + ret = skl_dsp_disable_core(ctx, core_id); if (ret < 0) { dev_err(ctx->dev, "disable dsp core failed ret: %d\n", ret); ret = -EIO; @@ -466,12 +464,16 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, if (ret) return ret; + skl->cores.count = 2; + ret = sst->fw_ops.load_fw(sst); if (ret < 0) { dev_err(dev, "Load base fw failed : %d", ret); goto cleanup; } + skl_dsp_init_core_state(sst); + if (dsp) *dsp = skl; |