Skip to content

Commit

Permalink
ASoC: SOF: add exception node in sof debugfs directory
Browse files Browse the repository at this point in the history
It is used for binary dump of exception information.

Signed-off-by: Rander Wang <rander.wang@intel.com>
  • Loading branch information
RanderWang committed Jun 8, 2023
1 parent 8b63028 commit 3e9c3a9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sound/soc/sof/ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,20 @@ static int sof_ipc4_init_msg_memory(struct snd_sof_dev *sdev)
return 0;
}

static void sof_ipc4_create_exception_debugfs_node(struct snd_sof_dev *sdev)
{
u32 telemetry_data_offset;

/* strip the first magic number dword */
telemetry_data_offset = sdev->debug_box.offset + sizeof(u32) +
(SOF_IPC4_DEBUG_TELEMETRY_SLOT_ID + 1) * SOF_IPC4_DEBUG_SLOT_SIZE;

snd_sof_debugfs_add_region_item(sdev, SOF_FW_BLK_TYPE_SRAM,
telemetry_data_offset,
SOF_IPC4_DEBUG_SLOT_SIZE, "exception",
SOF_DEBUGFS_ACCESS_D0_ONLY);
}

static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg)
{
int inbox_offset, inbox_size, outbox_offset, outbox_size;
Expand Down Expand Up @@ -569,6 +583,7 @@ static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg

sdev->debug_box.offset = snd_sof_dsp_get_window_offset(sdev,
SOF_IPC4_DEBUG_WINDOW_IDX);
sof_ipc4_create_exception_debugfs_node(sdev);

dev_dbg(sdev->dev, "mailbox upstream 0x%x - size 0x%x\n",
inbox_offset, inbox_size);
Expand Down

0 comments on commit 3e9c3a9

Please sign in to comment.