Skip to content

Commit 6720fd8

Browse files
committed
acp_7_x: clk: enable tick counter in D0 sequence
Configure CLK_TICK_CNT before change_clock_notify so current clock readback via acp_get_current_clk uses a valid timer threshold. Signed-off-by: sneha-voona <sneha.voona@amd.com>
1 parent 11099a8 commit 6720fd8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • src/platform/amd/acp_7_x/lib

‎src/platform/amd/acp_7_x/lib/clk.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,19 @@ uint32_t mp1_mailbox_send(uint32_t _reg_id, uint32_t _value)
220220

221221
void acp_clk_d0_sequence(uint32_t clock_freq)
222222
{
223+
clk_tick_cnt_config_reg_t clk_tick_config;
224+
223225
/* Send message to PMFW to power on Audio PLL */
224226
mp1_mailbox_send(ACPSMC_MSG_PllPowerState, ACP_AUDIOPLL_POWER_ON_REQ);
225227

228+
/* Enable clk tick count */
229+
clk_tick_config.u32All = acp_reg_read_via_smn(
230+
CLK_TICK_CNT_CONFIG_REG, sizeof(uint32_t));
231+
clk_tick_config.bitfields.TIMER_ENABLE = 1;
232+
clk_tick_config.bitfields.TIMER_THRESHOLD = 0x1E0;
233+
acp_reg_write_via_smn(CLK_TICK_CNT_CONFIG_REG,
234+
clk_tick_config.u32All, sizeof(uint32_t));
235+
226236
change_clock_notify(clock_freq);
227237

228238
/* Audio PLL DFS Output for AUDIOCLK */

0 commit comments

Comments
 (0)