[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231219112416.3334928-5-venkataprasad.potturu@amd.com>
Date: Tue, 19 Dec 2023 16:54:13 +0530
From: Venkata Prasad Potturu <venkataprasad.potturu@....com>
To: <broonie@...nel.org>, <alsa-devel@...a-project.org>
CC: <Vijendar.Mukunda@....com>, <Basavaraj.Hiregoudar@....com>,
<Sunil-kumar.Dommati@....com>, <syed.sabakareem@....com>,
<cristian.ciocaltea@...labora.com>, <emil.velikov@...labora.com>, "Venkata
Prasad Potturu" <venkataprasad.potturu@....com>, Pierre-Louis Bossart
<pierre-louis.bossart@...ux.intel.com>, Liam Girdwood <lgirdwood@...il.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>, Bard Liao
<yung-chuan.liao@...ux.intel.com>, Ranjani Sridharan
<ranjani.sridharan@...ux.intel.com>, Daniel Baluta <daniel.baluta@....com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>, Jaroslav Kysela
<perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, Mastan Katragadda
<Mastan.Katragadda@....com>, V sujith kumar Reddy
<Vsujithkumar.Reddy@....com>, "moderated list:SOUND - SOUND OPEN FIRMWARE
(SOF) DRIVERS" <sound-open-firmware@...a-project.org>, "open list:SOUND - SOC
LAYER / DYNAMIC AUDIO POWER MANAGEM..." <linux-sound@...r.kernel.org>, "open
list" <linux-kernel@...r.kernel.org>
Subject: [PATCH 5/5] ASoC: SOF: amd: Add acp-psp mailbox interface for iram-dram fence register modification
Add acp-psp mailbox communication interface for iram-dram size
modification to notify psp.
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@....com>
---
sound/soc/sof/amd/acp.c | 11 +++++++++++
sound/soc/sof/amd/acp.h | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 7860724c4d2d..32a741fcb84f 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -278,6 +278,17 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr,
return ret;
}
+ /* psp_send_cmd only required for vangogh platform (rev - 5) */
+ if (desc->rev == 5) {
+ /* Modify IRAM and DRAM size */
+ ret = psp_send_cmd(adata, MBOX_ACP_IRAM_DRAM_FENCE_COMMAND | IRAM_DRAM_FENCE_2);
+ if (ret)
+ return ret;
+ ret = psp_send_cmd(adata, MBOX_ACP_IRAM_DRAM_FENCE_COMMAND | MBOX_ISREADY_FLAG);
+ if (ret)
+ return ret;
+ }
+
ret = snd_sof_dsp_read_poll_timeout(sdev, ACP_DSP_BAR, ACP_SHA_DSP_FW_QUALIFIER,
fw_qualifier, fw_qualifier & DSP_FW_RUN_ENABLE,
ACP_REG_POLL_INTERVAL, ACP_DMA_COMPLETE_TIMEOUT_US);
diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h
index c536cfde0e44..c645aee216fd 100644
--- a/sound/soc/sof/amd/acp.h
+++ b/sound/soc/sof/amd/acp.h
@@ -74,9 +74,14 @@
#define MP0_C2PMSG_114_REG 0x3810AC8
#define MP0_C2PMSG_73_REG 0x3810A24
#define MBOX_ACP_SHA_DMA_COMMAND 0x70000
+#define MBOX_ACP_IRAM_DRAM_FENCE_COMMAND 0x80000
#define MBOX_DELAY_US 1000
#define MBOX_READY_MASK 0x80000000
#define MBOX_STATUS_MASK 0xFFFF
+#define MBOX_ISREADY_FLAG 0x40000000
+#define IRAM_DRAM_FENCE_0 0X0
+#define IRAM_DRAM_FENCE_1 0X01
+#define IRAM_DRAM_FENCE_2 0X02
#define BOX_SIZE_512 0x200
#define BOX_SIZE_1024 0x400
--
2.25.1
Powered by blists - more mailing lists