Skip to content

Commit 60eb816

Browse files
vijendarmukundabroonie
authored andcommitted
ASoC: SOF: amd: add module parameter for firmware debug
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> Link: https://lore.kernel.org/r/20230823073340.2829821-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0a14281 commit 60eb816

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

sound/soc/sof/amd/acp-loader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ EXPORT_SYMBOL_NS(acp_dsp_pre_fw_run, SND_SOC_SOF_AMD_COMMON);
207207

208208
int acp_sof_dsp_run(struct snd_sof_dev *sdev)
209209
{
210+
struct acp_dev_data *adata = sdev->pdata->hw_pdata;
210211
const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
211212
int val;
212213

@@ -215,7 +216,7 @@ int acp_sof_dsp_run(struct snd_sof_dev *sdev)
215216
dev_dbg(sdev->dev, "ACP_DSP0_RUNSTALL : 0x%0x\n", val);
216217

217218
/* Some platforms won't support fusion DSP,keep offset zero for no support */
218-
if (desc->fusion_dsp_offset) {
219+
if (desc->fusion_dsp_offset && adata->enable_fw_debug) {
219220
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->fusion_dsp_offset, ACP_DSP_RUN);
220221
val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->fusion_dsp_offset);
221222
dev_dbg(sdev->dev, "ACP_DSP0_FUSION_RUNSTALL : 0x%0x\n", val);

sound/soc/sof/amd/acp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
#define SECURED_FIRMWARE 1
2424

25+
static bool enable_fw_debug;
26+
module_param(enable_fw_debug, bool, 0444);
27+
MODULE_PARM_DESC(enable_fw_debug, "Enable Firmware debug");
28+
2529
const struct dmi_system_id acp_sof_quirk_table[] = {
2630
{
2731
/* Valve Jupiter device */
@@ -558,6 +562,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
558562
dev_dbg(sdev->dev, "fw_code_bin:%s, fw_data_bin:%s\n", adata->fw_code_bin,
559563
adata->fw_data_bin);
560564
}
565+
adata->enable_fw_debug = enable_fw_debug;
561566
acp_memory_init(sdev);
562567

563568
acp_dsp_stream_init(sdev);

sound/soc/sof/amd/acp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ struct acp_dev_data {
205205
struct acp_dsp_stream *dtrace_stream;
206206
struct pci_dev *smn_dev;
207207
struct acp_dsp_stream *probe_stream;
208+
bool enable_fw_debug;
208209
};
209210

210211
void memcpy_to_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *src, size_t bytes);

0 commit comments

Comments
 (0)