Commit 3a054f90 authored by YC Hung's avatar YC Hung Committed by Mark Brown

ASoC: SOF: mediatek: Add mt8195 debug dump

Add mt8195_adsp_dump in mt8195.c for debug_dump callback to dump
mt8195 debug registers and call mtk_adsp_dump.
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarYC Hung <yc.hung@mediatek.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220517173109.468568-3-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 698c1e99
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "../../sof-of-dev.h" #include "../../sof-of-dev.h"
#include "../../sof-audio.h" #include "../../sof-audio.h"
#include "../adsp_helper.h" #include "../adsp_helper.h"
#include "../mtk-adsp-common.h"
#include "mt8195.h" #include "mt8195.h"
#include "mt8195-clk.h" #include "mt8195-clk.h"
...@@ -486,6 +487,31 @@ static int mt8195_ipc_msg_data(struct snd_sof_dev *sdev, ...@@ -486,6 +487,31 @@ static int mt8195_ipc_msg_data(struct snd_sof_dev *sdev,
return 0; return 0;
} }
static void mt8195_adsp_dump(struct snd_sof_dev *sdev, u32 flags)
{
u32 dbg_pc, dbg_data, dbg_bus0, dbg_bus1, dbg_inst;
u32 dbg_ls0stat, dbg_ls1stat, faultbus, faultinfo, swrest;
/* dump debug registers */
dbg_pc = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGPC);
dbg_data = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGDATA);
dbg_bus0 = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGBUS0);
dbg_bus1 = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGBUS1);
dbg_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGINST);
dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS0STAT);
dbg_ls1stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS1STAT);
faultbus = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTBUS);
faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTINFO);
swrest = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_RESET_SW);
dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, bus0 %#x, bus1 %#x, swrest %#x",
dbg_pc, dbg_data, dbg_bus0, dbg_bus1, swrest);
dev_info(sdev->dev, "dbg_inst %#x, ls0stat %#x, ls1stat %#x, faultbus %#x, faultinfo %#x",
dbg_inst, dbg_ls0stat, dbg_ls1stat, faultbus, faultinfo);
mtk_adsp_dump(sdev, flags);
}
static struct snd_soc_dai_driver mt8195_dai[] = { static struct snd_soc_dai_driver mt8195_dai[] = {
{ {
.name = "SOF_DL2", .name = "SOF_DL2",
...@@ -553,6 +579,9 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = { ...@@ -553,6 +579,9 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
/* Firmware ops */ /* Firmware ops */
.dsp_arch_ops = &sof_xtensa_arch_ops, .dsp_arch_ops = &sof_xtensa_arch_ops,
/* Debug information */
.dbg_dump = mt8195_adsp_dump,
/* DAI drivers */ /* DAI drivers */
.drv = mt8195_dai, .drv = mt8195_dai,
.num_drv = ARRAY_SIZE(mt8195_dai), .num_drv = ARRAY_SIZE(mt8195_dai),
......
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