@@ -377,13 +377,41 @@ void memcpy_to_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *src,
377377 snd_sof_dsp_write (sdev , ACP_DSP_BAR , reg_offset + i , src [j ]);
378378}
379379
380+ static int acp_init_scratch_mem_ipc_flags (struct snd_sof_dev * sdev )
381+ {
382+ u32 dsp_msg_write , dsp_ack_write , host_msg_write , host_ack_write ;
383+
384+ dsp_msg_write = sdev -> debug_box .offset +
385+ offsetof(struct scratch_ipc_conf , sof_dsp_msg_write );
386+ dsp_ack_write = sdev -> debug_box .offset +
387+ offsetof(struct scratch_ipc_conf , sof_dsp_ack_write );
388+ host_msg_write = sdev -> debug_box .offset +
389+ offsetof(struct scratch_ipc_conf , sof_host_msg_write );
390+ host_ack_write = sdev -> debug_box .offset +
391+ offsetof(struct scratch_ipc_conf , sof_host_ack_write );
392+ /* Initialize host message write flag */
393+ snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + host_msg_write , 0 );
394+
395+ /* Initialize host ack write flag */
396+ snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + host_ack_write , 0 );
397+
398+ /* Initialize DSP message write flag */
399+ snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + dsp_msg_write , 0 );
400+
401+ /* Initialize DSP ack write flag */
402+ snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + dsp_ack_write , 0 );
403+
404+ return 0 ;
405+ }
406+
380407static int acp_memory_init (struct snd_sof_dev * sdev )
381408{
382409 struct acp_dev_data * adata = sdev -> pdata -> hw_pdata ;
383410 const struct sof_amd_acp_desc * desc = get_chip_info (sdev -> pdata );
384411
385412 snd_sof_dsp_update_bits (sdev , ACP_DSP_BAR , desc -> dsp_intr_base + DSP_SW_INTR_CNTL_OFFSET ,
386413 ACP_DSP_INTR_EN_MASK , ACP_DSP_INTR_EN_MASK );
414+ acp_init_scratch_mem_ipc_flags (sdev );
387415 init_dma_descriptor (adata );
388416
389417 return 0 ;
0 commit comments