Commit 55dfc2a7 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: loader: Use the generic ops for region debugfs handling

Do not access the sdev->bar[] directly to make the code generic, use the
new generic ops for handing the regions for debugfs.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-12-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fe509b34
...@@ -362,7 +362,6 @@ static int snd_sof_fw_ext_man_parse(struct snd_sof_dev *sdev, ...@@ -362,7 +362,6 @@ static int snd_sof_fw_ext_man_parse(struct snd_sof_dev *sdev,
*/ */
static void sof_get_windows(struct snd_sof_dev *sdev) static void sof_get_windows(struct snd_sof_dev *sdev)
{ {
int bar = snd_sof_dsp_get_bar_index(sdev, SOF_FW_BLK_TYPE_SRAM);
struct sof_ipc_window_elem *elem; struct sof_ipc_window_elem *elem;
u32 outbox_offset = 0; u32 outbox_offset = 0;
u32 stream_offset = 0; u32 stream_offset = 0;
...@@ -394,64 +393,53 @@ static void sof_get_windows(struct snd_sof_dev *sdev) ...@@ -394,64 +393,53 @@ static void sof_get_windows(struct snd_sof_dev *sdev)
case SOF_IPC_REGION_UPBOX: case SOF_IPC_REGION_UPBOX:
inbox_offset = window_offset + elem->offset; inbox_offset = window_offset + elem->offset;
inbox_size = elem->size; inbox_size = elem->size;
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + inbox_offset,
inbox_offset, elem->size, "inbox",
elem->size, "inbox", SOF_DEBUGFS_ACCESS_D0_ONLY);
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_DOWNBOX: case SOF_IPC_REGION_DOWNBOX:
outbox_offset = window_offset + elem->offset; outbox_offset = window_offset + elem->offset;
outbox_size = elem->size; outbox_size = elem->size;
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + outbox_offset,
outbox_offset, elem->size, "outbox",
elem->size, "outbox", SOF_DEBUGFS_ACCESS_D0_ONLY);
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_TRACE: case SOF_IPC_REGION_TRACE:
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + window_offset + elem->offset,
window_offset + elem->size, "etrace",
elem->offset, SOF_DEBUGFS_ACCESS_D0_ONLY);
elem->size, "etrace",
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_DEBUG: case SOF_IPC_REGION_DEBUG:
debug_offset = window_offset + elem->offset; debug_offset = window_offset + elem->offset;
debug_size = elem->size; debug_size = elem->size;
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + window_offset + elem->offset,
window_offset + elem->size, "debug",
elem->offset, SOF_DEBUGFS_ACCESS_D0_ONLY);
elem->size, "debug",
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_STREAM: case SOF_IPC_REGION_STREAM:
stream_offset = window_offset + elem->offset; stream_offset = window_offset + elem->offset;
stream_size = elem->size; stream_size = elem->size;
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + stream_offset,
stream_offset, elem->size, "stream",
elem->size, "stream", SOF_DEBUGFS_ACCESS_D0_ONLY);
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_REGS: case SOF_IPC_REGION_REGS:
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + window_offset + elem->offset,
window_offset + elem->size, "regs",
elem->offset, SOF_DEBUGFS_ACCESS_D0_ONLY);
elem->size, "regs",
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
case SOF_IPC_REGION_EXCEPTION: case SOF_IPC_REGION_EXCEPTION:
sdev->dsp_oops_offset = window_offset + elem->offset; sdev->dsp_oops_offset = window_offset + elem->offset;
snd_sof_debugfs_io_item(sdev, snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
sdev->bar[bar] + window_offset + elem->offset,
window_offset + elem->size, "exception",
elem->offset, SOF_DEBUGFS_ACCESS_D0_ONLY);
elem->size, "exception",
SOF_DEBUGFS_ACCESS_D0_ONLY);
break; break;
default: default:
dev_err(sdev->dev, "error: get illegal window info\n"); dev_err(sdev->dev, "error: get illegal window info\n");
......
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