1
0
Fork 0

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 <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
pull/10/head
Daniel Baluta 2018-10-03 16:45:57 +03:00 committed by Jason Liu
parent 5e49abd2a3
commit a0cffd9a92
2 changed files with 9 additions and 4 deletions

View File

@ -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 */
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. */

View File

@ -299,6 +299,7 @@ struct xf_proxy {
struct completion cmd_complete;
int is_ready;
int is_loaded;
/* ...internal lock */
spinlock_t lock;