summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp.c
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@nxp.com>2018-05-23 09:40:55 +0300
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:51:53 +0800
commit8184e47416f8e581ba3c97f84f81289d468d6840 (patch)
tree20657b91d44efb552dc340983c640baffed13640 /sound/soc/fsl/fsl_dsp.c
parent49c0d24bec411f2f787d77703c91e9d47aa67dc7 (diff)
MLK-17481-3: ASoC: fsl: Fix DSP memory mappings
We load DSP firmware from the ARM side at 0x556e8000 but because the compiler generated memory layout starts at 0x596e8000 we need to do some fixups. Thus, each address (in DSP local memory) generated by the compiler needs to be substracted an offset = 0x596e8000 - 0x556e8000 = 0x4000000. Because this only happens on QM we will use dts to specify the offset. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 8d4518d2a5d956549e829470af15003d7adff841)
Diffstat (limited to 'sound/soc/fsl/fsl_dsp.c')
-rw-r--r--sound/soc/fsl/fsl_dsp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_dsp.c b/sound/soc/fsl/fsl_dsp.c
index 593fb80ba48b..7a1a067615c7 100644
--- a/sound/soc/fsl/fsl_dsp.c
+++ b/sound/soc/fsl/fsl_dsp.c
@@ -670,6 +670,12 @@ static void dsp_load_firmware(const struct firmware *fw, void *context)
(const void *)image,
shdr->sh_size);
} else {
+ /* sh_addr is from DSP view, we need to
+ * fixup addr because we load the firmware from
+ * the ARM core side
+ */
+ sh_addr -= dsp_priv->fixup_offset;
+
memcpy_dsp((void *)(dsp_priv->regs +
(sh_addr - dsp_priv->paddr)),
(const void *)image,
@@ -811,6 +817,8 @@ static int fsl_dsp_probe(struct platform_device *pdev)
ret = of_property_read_string(np, "fsl,dsp-firmware", &fw_name);
dsp_priv->fw_name = fw_name;
+ ret = of_property_read_u32(np, "fixup-offset", &dsp_priv->fixup_offset);
+
platform_set_drvdata(pdev, dsp_priv);
pm_runtime_enable(&pdev->dev);