Commit 7198879e authored by Daniel Baluta's avatar Daniel Baluta Committed by Mark Brown

ASoC: SOF: loader: Use the BAR provided by FW

Make sure to use the newly introduced function snd_sof_dsp_get_bar_index
that converts the section type to appropriate BAR index.
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190722141402.7194-8-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ce8234a6
...@@ -92,7 +92,7 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev, ...@@ -92,7 +92,7 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev,
struct snd_sof_mod_hdr *module) struct snd_sof_mod_hdr *module)
{ {
struct snd_sof_blk_hdr *block; struct snd_sof_blk_hdr *block;
int count; int count, bar;
u32 offset; u32 offset;
size_t remaining; size_t remaining;
...@@ -128,6 +128,13 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev, ...@@ -128,6 +128,13 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev,
case SOF_FW_BLK_TYPE_IRAM: case SOF_FW_BLK_TYPE_IRAM:
case SOF_FW_BLK_TYPE_DRAM: case SOF_FW_BLK_TYPE_DRAM:
offset = block->offset; offset = block->offset;
bar = snd_sof_dsp_get_bar_index(sdev, block->type);
if (bar < 0) {
dev_err(sdev->dev,
"error: no BAR mapping for block type 0x%x\n",
block->type);
return bar;
}
break; break;
default: default:
dev_err(sdev->dev, "error: bad type 0x%x for block 0x%x\n", dev_err(sdev->dev, "error: bad type 0x%x for block 0x%x\n",
...@@ -145,7 +152,7 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev, ...@@ -145,7 +152,7 @@ int snd_sof_parse_module_memcpy(struct snd_sof_dev *sdev,
block->size); block->size);
return -EINVAL; return -EINVAL;
} }
snd_sof_dsp_block_write(sdev, sdev->mmio_bar, offset, snd_sof_dsp_block_write(sdev, bar, offset,
block + 1, block->size); block + 1, block->size);
if (remaining < block->size) { if (remaining < block->size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment