Skip to content
Snippets Groups Projects
Commit ba9c0dc8 authored by Daniel Baluta's avatar Daniel Baluta Committed by Leonard Crestez
Browse files

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: default avatarCosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 48ea0209f27808ee922f44b27bdcd332f0e3b4f5)
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSrikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
parent c88b68fe
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
memcpy_dsp((void *)(dsp_priv->regs +
(sh_addr - dsp_priv->paddr)),
......@@ -704,6 +707,7 @@ static void dsp_load_firmware(const struct firmware *fw, void *context)
/* start the core */
sc_pm_cpu_start(dsp_priv->dsp_ipcHandle,
SC_R_DSP, true, dsp_priv->iram);
dsp_priv->proxy.is_loaded = 1;
}
/* Initialization of the MU code. */
......
......@@ -299,6 +299,7 @@ struct xf_proxy {
struct completion cmd_complete;
int is_ready;
int is_loaded;
/* ...internal lock */
spinlock_t lock;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment