mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <Basavaraj.Hiregoudar@amd.com>,
	<Sunil-kumar.Dommati@amd.com>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>,
	Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>,
	Chao Song <chao.song@intel.com>,
	Venkata Prasad Potturu <venkataprasad.potturu@amd.com>,
	Mastan Katragadda <Mastan.Katragadda@amd.com>,
	Ajye Huang <ajye_huang@compal.corp-partner.google.com>,
	"moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" 
	<sound-open-firmware@alsa-project.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/7] ASoC: SOF: amd: add module parameter for firmware debug
Date: Wed, 23 Aug 2023 13:03:35 +0530	[thread overview]
Message-ID: <20230823073340.2829821-3-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20230823073340.2829821-1-Vijendar.Mukunda@amd.com>

Add module parameter for firmware debug. If firmware debug
flag is enabled, clear the fusion stall bit which is required
for enabling firmware debugging through JTAG.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/sof/amd/acp-loader.c | 3 ++-
 sound/soc/sof/amd/acp.c        | 5 +++++
 sound/soc/sof/amd/acp.h        | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/amd/acp-loader.c b/sound/soc/sof/amd/acp-loader.c
index a63c00b53a5e..a427673cfb03 100644
--- a/sound/soc/sof/amd/acp-loader.c
+++ b/sound/soc/sof/amd/acp-loader.c
@@ -207,6 +207,7 @@ EXPORT_SYMBOL_NS(acp_dsp_pre_fw_run, SND_SOC_SOF_AMD_COMMON);
 
 int acp_sof_dsp_run(struct snd_sof_dev *sdev)
 {
+	struct acp_dev_data *adata = sdev->pdata->hw_pdata;
 	const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
 	int val;
 
@@ -215,7 +216,7 @@ int acp_sof_dsp_run(struct snd_sof_dev *sdev)
 	dev_dbg(sdev->dev, "ACP_DSP0_RUNSTALL : 0x%0x\n", val);
 
 	/* Some platforms won't support fusion DSP,keep offset zero for no support */
-	if (desc->fusion_dsp_offset) {
+	if (desc->fusion_dsp_offset && adata->enable_fw_debug) {
 		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->fusion_dsp_offset, ACP_DSP_RUN);
 		val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->fusion_dsp_offset);
 		dev_dbg(sdev->dev, "ACP_DSP0_FUSION_RUNSTALL : 0x%0x\n", val);
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 651b56388cb6..ebc985e2aaad 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -22,6 +22,10 @@
 
 #define SECURED_FIRMWARE 1
 
+static bool enable_fw_debug;
+module_param(enable_fw_debug, bool, 0444);
+MODULE_PARM_DESC(enable_fw_debug, "Enable Firmware debug");
+
 const struct dmi_system_id acp_sof_quirk_table[] = {
 	{
 		/* Valve Jupiter device */
@@ -558,6 +562,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
 		dev_dbg(sdev->dev, "fw_code_bin:%s, fw_data_bin:%s\n", adata->fw_code_bin,
 			adata->fw_data_bin);
 	}
+	adata->enable_fw_debug = enable_fw_debug;
 	acp_memory_init(sdev);
 
 	acp_dsp_stream_init(sdev);
diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h
index 97bcada822ef..4dcceb764769 100644
--- a/sound/soc/sof/amd/acp.h
+++ b/sound/soc/sof/amd/acp.h
@@ -205,6 +205,7 @@ struct acp_dev_data {
 	struct acp_dsp_stream *dtrace_stream;
 	struct pci_dev *smn_dev;
 	struct acp_dsp_stream *probe_stream;
+	bool enable_fw_debug;
 };
 
 void memcpy_to_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *src, size_t bytes);
-- 
2.34.1


  parent reply	other threads:[~2023-08-23  7:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  7:33 [PATCH 1/7] ASoC: SOF: amd: remove unused sha dma interrupt code Vijendar Mukunda
2023-08-23  7:33 ` [PATCH 2/7] ASoC: SOF: amd: enable ACP external global interrupt Vijendar Mukunda
2023-08-23  7:33 ` Vijendar Mukunda [this message]
2023-08-23  7:33 ` [PATCH 4/7] ASoC: SOF: amd: remove redundant clock mux selection register write Vijendar Mukunda
2023-08-23  7:33 ` [PATCH 5/7] ASoC: SOF: amd: add conditional check for acp_clkmux_sel register Vijendar Mukunda
2023-08-23  7:33 ` [PATCH 6/7] ASoC: SOF: amd: clear panic mask status when panic occurs Vijendar Mukunda
2023-08-23  7:33 ` [PATCH 7/7] ASoC: SOF: amd: clear dsp to host interrupt status Vijendar Mukunda
2023-08-23 16:26 ` [PATCH 1/7] ASoC: SOF: amd: remove unused sha dma interrupt code Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230823073340.2829821-3-Vijendar.Mukunda@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=AjitKumar.Pandey@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mastan.Katragadda@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=Vsujithkumar.Reddy@amd.com \
    --cc=ajye_huang@compal.corp-partner.google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=chao.song@intel.com \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=venkataprasad.potturu@amd.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®