Skip to content

Commit a42db29

Browse files
vijendarmukundabroonie
authored andcommitted
ASoC: SOF: amd: Fix for acp init sequence
When ACP is not powered on by default, acp power on sequence explicitly invoked by programming pgfsm control mask. The existing implementation checks the same PGFSM status mask and programs the same PGFSM control mask in all ACP variants which breaks acp power on sequence for ACP6.0 and ACP6.3 variants. So to fix this issue, update ACP pgfsm control mask and status mask based on acp descriptor rev field, which will vary based on acp variant. Fixes: 846aef1 ("ASoC: SOF: amd: Add Renoir ACP HW support") Signed-off-by: Vijendar Mukunda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1641996 commit a42db29

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

sound/soc/sof/amd/acp.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,16 +433,31 @@ static int acp_power_on(struct snd_sof_dev *sdev)
433433
const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
434434
unsigned int base = desc->pgfsm_base;
435435
unsigned int val;
436+
unsigned int acp_pgfsm_status_mask, acp_pgfsm_cntl_mask;
436437
int ret;
437438

438439
val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, base + PGFSM_STATUS_OFFSET);
439440

440441
if (val == ACP_POWERED_ON)
441442
return 0;
442443

443-
if (val & ACP_PGFSM_STATUS_MASK)
444+
switch (desc->rev) {
445+
case 3:
446+
case 5:
447+
acp_pgfsm_status_mask = ACP3X_PGFSM_STATUS_MASK;
448+
acp_pgfsm_cntl_mask = ACP3X_PGFSM_CNTL_POWER_ON_MASK;
449+
break;
450+
case 6:
451+
acp_pgfsm_status_mask = ACP6X_PGFSM_STATUS_MASK;
452+
acp_pgfsm_cntl_mask = ACP6X_PGFSM_CNTL_POWER_ON_MASK;
453+
break;
454+
default:
455+
return -EINVAL;
456+
}
457+
458+
if (val & acp_pgfsm_status_mask)
444459
snd_sof_dsp_write(sdev, ACP_DSP_BAR, base + PGFSM_CONTROL_OFFSET,
445-
ACP_PGFSM_CNTL_POWER_ON_MASK);
460+
acp_pgfsm_cntl_mask);
446461

447462
ret = snd_sof_dsp_read_poll_timeout(sdev, ACP_DSP_BAR, base + PGFSM_STATUS_OFFSET, val,
448463
!val, ACP_REG_POLL_INTERVAL, ACP_REG_POLL_TIMEOUT_US);

sound/soc/sof/amd/acp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
#define ACP_REG_POLL_TIMEOUT_US 2000
2626
#define ACP_DMA_COMPLETE_TIMEOUT_US 5000
2727

28-
#define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01
29-
#define ACP_PGFSM_STATUS_MASK 0x03
28+
#define ACP3X_PGFSM_CNTL_POWER_ON_MASK 0x01
29+
#define ACP3X_PGFSM_STATUS_MASK 0x03
30+
#define ACP6X_PGFSM_CNTL_POWER_ON_MASK 0x07
31+
#define ACP6X_PGFSM_STATUS_MASK 0x0F
32+
3033
#define ACP_POWERED_ON 0x00
3134
#define ACP_ASSERT_RESET 0x01
3235
#define ACP_RELEASE_RESET 0x00

0 commit comments

Comments
 (0)