lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502154445.3008598-7-Vijendar.Mukunda@amd.com>
Date: Fri, 2 May 2025 21:12:45 +0530
From: Vijendar Mukunda <Vijendar.Mukunda@....com>
To: <broonie@...nel.org>, <alsa-devel@...a-project.org>
CC: <Mario.Limonciello@....com>, <venkataprasad.potturu@....com>,
	<Basavaraj.Hiregoudar@....com>, <Sunil-kumar.Dommati@....com>,
	<linux-kernel@...r.kernel.org>, <linux-sound@...r.kernel.org>,
	<sound-open-firmware@...a-project.org>, Vijendar Mukunda
	<Vijendar.Mukunda@....com>, Ranjani Sridharan
	<ranjani.sridharan@...ux.intel.com>, Bard Liao
	<yung-chuan.liao@...ux.intel.com>, Liam Girdwood <lgirdwood@...il.com>,
	"Peter Ujfalusi" <peter.ujfalusi@...ux.intel.com>, Daniel Baluta
	<daniel.baluta@....com>, Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>, Jaroslav Kysela
	<perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, Cristian Ciocaltea
	<cristian.ciocaltea@...labora.com>, Peter Zijlstra <peterz@...radead.org>,
	Mario Limonciello <mario.limonciello@....com>
Subject: [PATCH 6/9] ASoC: SOF: amd: refactor acp reset sequence

Below mentioned register sequence should be part of acp init
sequence.
1) Set ACP clock mux selection register to ACP_ACLK clock
source.
2) Enable ACP global interrupt enable register
3) Enable ACP error interrupt mask.
ACP reset sequence should contain code related to asserting
acp soft reset and release the soft reset.
Move the rest of the registers programming to acp init sequence.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@....com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@...ux.intel.com>
---
 sound/soc/sof/amd/acp.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 615ed7ff3846..2ad5fbf43c8a 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -511,7 +511,6 @@ static int acp_power_on(struct snd_sof_dev *sdev)
 
 static int acp_reset(struct snd_sof_dev *sdev)
 {
-	const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
 	unsigned int val;
 	int ret;
 
@@ -532,14 +531,6 @@ static int acp_reset(struct snd_sof_dev *sdev)
 	if (ret < 0)
 		dev_err(sdev->dev, "timeout in releasing reset\n");
 
-	if (desc->acp_clkmux_sel)
-		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
-
-	if (desc->ext_intr_enb)
-		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_enb, 0x01);
-
-	if (desc->ext_intr_cntl)
-		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_cntl, ACP_ERROR_IRQ_MASK);
 	return ret;
 }
 
@@ -570,6 +561,7 @@ static int acp_dsp_reset(struct snd_sof_dev *sdev)
 
 static int acp_init(struct snd_sof_dev *sdev)
 {
+	const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
 	struct acp_dev_data *acp_data;
 	int ret;
 
@@ -586,6 +578,16 @@ static int acp_init(struct snd_sof_dev *sdev)
 	ret = acp_reset(sdev);
 	if (ret)
 		return ret;
+
+	if (desc->acp_clkmux_sel)
+		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK);
+
+	if (desc->ext_intr_enb)
+		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_enb, 0x01);
+
+	if (desc->ext_intr_cntl)
+		snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_cntl, ACP_ERROR_IRQ_MASK);
+
 	switch (acp_data->pci_rev) {
 	case ACP70_PCI_ID:
 	case ACP71_PCI_ID:
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ