linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support
@ 2023-06-01  3:49 Trevor Wu
  2023-06-01  3:49 ` [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump Trevor Wu
  2023-06-01 14:12 ` [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Trevor Wu @ 2023-06-01  3:49 UTC (permalink / raw)
  To: pierre-louis.bossart, peter.ujfalusi, yung-chuan.liao,
	ranjani.sridharan, kai.vehmanen, daniel.baluta, broonie,
	lgirdwood, tiwai, perex, matthias.bgg, angelogioacchino.delregno
  Cc: trevor.wu, yc.hung, tinghan.shen, sound-open-firmware,
	alsa-devel, linux-mediatek, linux-arm-kernel, linux-kernel

This series adds mt8188 audio support and dbg_dump callback for
mt8186 and mt8188.

Changes since v2:
  - resend the correct patch for adsp debug dump

Changes since v1:
  - fix typo
  - adopt reviewer's suggestion

Trevor Wu (1):
  ASoC: SOF: mediatek: add adsp debug dump

 sound/soc/sof/mediatek/mt8186/mt8186.c | 22 ++++++++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h |  5 +++++
 2 files changed, 27 insertions(+)

-- 
2.18.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump
  2023-06-01  3:49 [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Trevor Wu
@ 2023-06-01  3:49 ` Trevor Wu
  2023-06-01 10:03   ` AngeloGioacchino Del Regno
  2023-06-01 14:12 ` [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Trevor Wu @ 2023-06-01  3:49 UTC (permalink / raw)
  To: pierre-louis.bossart, peter.ujfalusi, yung-chuan.liao,
	ranjani.sridharan, kai.vehmanen, daniel.baluta, broonie,
	lgirdwood, tiwai, perex, matthias.bgg, angelogioacchino.delregno
  Cc: trevor.wu, yc.hung, tinghan.shen, sound-open-firmware,
	alsa-devel, linux-mediatek, linux-arm-kernel, linux-kernel

Add mt8188 and mt8186 .dbg_dump callback to print some information when
DSP panic occurs.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 22 ++++++++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h |  5 +++++
 2 files changed, 27 insertions(+)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index cc91c2928fb6..3e0ea0e109e2 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -24,6 +24,7 @@
 #include "../../sof-of-dev.h"
 #include "../../sof-audio.h"
 #include "../adsp_helper.h"
+#include "../mtk-adsp-common.h"
 #include "mt8186.h"
 #include "mt8186-clk.h"
 
@@ -473,6 +474,26 @@ static snd_pcm_uframes_t mt8186_pcm_pointer(struct snd_sof_dev *sdev,
 	return pos;
 }
 
+static void mt8186_adsp_dump(struct snd_sof_dev *sdev, u32 flags)
+{
+	u32 dbg_pc, dbg_data, dbg_inst, dbg_ls0stat, dbg_status, faultinfo;
+
+	/* 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_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGINST);
+	dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS0STAT);
+	dbg_status = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGSTATUS);
+	faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTINFO);
+
+	dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, dbg_inst %#x,",
+		 dbg_pc, dbg_data, dbg_inst);
+	dev_info(sdev->dev, "ls0stat %#x, status %#x, faultinfo %#x",
+		 dbg_ls0stat, dbg_status, faultinfo);
+
+	mtk_adsp_dump(sdev, flags);
+}
+
 static struct snd_soc_dai_driver mt8186_dai[] = {
 {
 	.name = "SOF_DL1",
@@ -555,6 +576,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
 	.num_drv	= ARRAY_SIZE(mt8186_dai),
 
 	/* Debug information */
+	.dbg_dump = mt8186_adsp_dump,
 	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
 	/* PM */
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
index 5b521c60b4e3..91323f492a1e 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.h
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
@@ -38,6 +38,11 @@ struct snd_sof_dev;
 #define DSP_MBOX3_IRQ_EN		BIT(3)
 #define DSP_MBOX4_IRQ_EN		BIT(4)
 #define DSP_PDEBUGPC			0x013C
+#define DSP_PDEBUGDATA			0x0140
+#define DSP_PDEBUGINST			0x0144
+#define DSP_PDEBUGLS0STAT		0x0148
+#define DSP_PDEBUGSTATUS		0x014C
+#define DSP_PFAULTINFO			0x0150
 #define ADSP_CK_EN			0x1000
 #define CORE_CLK_EN			BIT(0)
 #define COREDBG_EN			BIT(1)
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump
  2023-06-01  3:49 ` [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump Trevor Wu
@ 2023-06-01 10:03   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-06-01 10:03 UTC (permalink / raw)
  To: Trevor Wu, pierre-louis.bossart, peter.ujfalusi, yung-chuan.liao,
	ranjani.sridharan, kai.vehmanen, daniel.baluta, broonie,
	lgirdwood, tiwai, perex, matthias.bgg
  Cc: yc.hung, tinghan.shen, sound-open-firmware, alsa-devel,
	linux-mediatek, linux-arm-kernel, linux-kernel

Il 01/06/23 05:49, Trevor Wu ha scritto:
> Add mt8188 and mt8186 .dbg_dump callback to print some information when
> DSP panic occurs.
> 
> Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support
  2023-06-01  3:49 [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Trevor Wu
  2023-06-01  3:49 ` [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump Trevor Wu
@ 2023-06-01 14:12 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-06-01 14:12 UTC (permalink / raw)
  To: pierre-louis.bossart, peter.ujfalusi, yung-chuan.liao,
	ranjani.sridharan, kai.vehmanen, daniel.baluta, lgirdwood, tiwai,
	perex, matthias.bgg, angelogioacchino.delregno, Trevor Wu
  Cc: yc.hung, tinghan.shen, sound-open-firmware, alsa-devel,
	linux-mediatek, linux-arm-kernel, linux-kernel

On Thu, 01 Jun 2023 11:49:38 +0800, Trevor Wu wrote:
> This series adds mt8188 audio support and dbg_dump callback for
> mt8186 and mt8188.
> 
> Changes since v2:
>   - resend the correct patch for adsp debug dump
> 
> Changes since v1:
>   - fix typo
>   - adopt reviewer's suggestion
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: mediatek: add adsp debug dump
      commit: 089adf33701426869dd50d1b8b8a4abd25ae39ae

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-01 14:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01  3:49 [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Trevor Wu
2023-06-01  3:49 ` [PATCH v3 1/1] ASoC: SOF: mediatek: add adsp debug dump Trevor Wu
2023-06-01 10:03   ` AngeloGioacchino Del Regno
2023-06-01 14:12 ` [PATCH v3 0/1] ASoC: SOF: add mt8188 audio support Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).