From eae3b2f34cd1a7a0301a8fe087a5a02b8a226859 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Wed, 3 Oct 2018 16:45:57 +0300 Subject: MLK-18497-13: ASoC: fsl: dsp: Skip SDRAM section update if fw is already loaded If the DSP firmware binary is already loaded it is wrong to update SDRAM located sections because we will overwrite and data stored there. This makes suspend/resume work. Reviewed-by: Cosmin-Gabriel Samoila Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_dsp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sound/soc/fsl/fsl_dsp.c') diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c index ef30b5a30bd2..c849f0832b3d 100644 --- a/sound/soc/fsl/fsl_dsp.c +++ b/sound/soc/fsl/fsl_dsp.c @@ -369,6 +369,7 @@ int fsl_dsp_open_func(struct fsl_dsp *dsp_priv, struct xf_client *client) atomic_set(&client->vm_use, 0); client->global = (void *)dsp_priv; + dsp_priv->proxy.is_loaded = 0; pm_runtime_get_sync(dev); @@ -688,10 +689,12 @@ static void dsp_load_firmware(const struct firmware *fw, void *context) (!strcmp(&strtab[shdr->sh_name], ".data")) || (!strcmp(&strtab[shdr->sh_name], ".bss")) ) { - memcpy_dsp((void *)(dsp_priv->sdram_vir_addr - + (sh_addr - dsp_priv->sdram_phys_addr)), - (const void *)image, - shdr->sh_size); + if (!dsp_priv->proxy.is_loaded) { + memcpy_dsp((void *)(dsp_priv->sdram_vir_addr + + (sh_addr - dsp_priv->sdram_phys_addr)), + (const void *)image, + shdr->sh_size); + } } else { /* sh_addr is from DSP view, we need to * fixup addr because we load the firmware from @@ -710,6 +713,7 @@ static void dsp_load_firmware(const struct firmware *fw, void *context) /* start the core */ imx_sc_pm_cpu_start(dsp_priv->dsp_ipcHandle, IMX_SC_R_DSP, true, dsp_priv->iram); + dsp_priv->proxy.is_loaded = 1; } /* Initialization of the MU code. */ -- cgit v1.2.3