@@ -42,21 +42,24 @@ static void acpbus_trigger_host_to_dsp_swintr(struct acp_dev_data *adata)
4242
4343static void acp_ipc_host_msg_set (struct snd_sof_dev * sdev )
4444{
45- unsigned int host_msg = offsetof(struct scratch_ipc_conf , sof_host_msg_write );
45+ unsigned int host_msg = sdev -> debug_box .offset +
46+ offsetof(struct scratch_ipc_conf , sof_host_msg_write );
4647
4748 snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + host_msg , 1 );
4849}
4950
5051static void acp_dsp_ipc_host_done (struct snd_sof_dev * sdev )
5152{
52- unsigned int dsp_msg = offsetof(struct scratch_ipc_conf , sof_dsp_msg_write );
53+ unsigned int dsp_msg = sdev -> debug_box .offset +
54+ offsetof(struct scratch_ipc_conf , sof_dsp_msg_write );
5355
5456 snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + dsp_msg , 0 );
5557}
5658
5759static void acp_dsp_ipc_dsp_done (struct snd_sof_dev * sdev )
5860{
59- unsigned int dsp_ack = offsetof(struct scratch_ipc_conf , sof_dsp_ack_write );
61+ unsigned int dsp_ack = sdev -> debug_box .offset +
62+ offsetof(struct scratch_ipc_conf , sof_dsp_ack_write );
6063
6164 snd_sof_dsp_write (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + dsp_ack , 0 );
6265}
@@ -65,7 +68,7 @@ int acp_sof_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
6568{
6669 struct acp_dev_data * adata = sdev -> pdata -> hw_pdata ;
6770 const struct sof_amd_acp_desc * desc = get_chip_info (sdev -> pdata );
68- unsigned int offset = offsetof( struct scratch_ipc_conf , sof_in_box ) ;
71+ unsigned int offset = sdev -> host_box . offset ;
6972 unsigned int count = ACP_HW_SEM_RETRY_COUNT ;
7073
7174 while (snd_sof_dsp_read (sdev , ACP_DSP_BAR , desc -> hw_semaphore_offset )) {
@@ -95,7 +98,7 @@ static void acp_dsp_ipc_get_reply(struct snd_sof_dev *sdev)
9598 struct snd_sof_ipc_msg * msg = sdev -> msg ;
9699 struct sof_ipc_reply reply ;
97100 struct sof_ipc_cmd_hdr * hdr ;
98- unsigned int offset = offsetof( struct scratch_ipc_conf , sof_in_box ) ;
101+ unsigned int offset = sdev -> host_box . offset ;
99102 int ret = 0 ;
100103
101104 /*
@@ -145,11 +148,19 @@ static void acp_dsp_ipc_get_reply(struct snd_sof_dev *sdev)
145148irqreturn_t acp_sof_ipc_irq_thread (int irq , void * context )
146149{
147150 struct snd_sof_dev * sdev = context ;
148- unsigned int dsp_msg_write = offsetof(struct scratch_ipc_conf , sof_dsp_msg_write );
149- unsigned int dsp_ack_write = offsetof(struct scratch_ipc_conf , sof_dsp_ack_write );
151+ unsigned int dsp_msg_write = sdev -> debug_box .offset +
152+ offsetof(struct scratch_ipc_conf , sof_dsp_msg_write );
153+ unsigned int dsp_ack_write = sdev -> debug_box .offset +
154+ offsetof(struct scratch_ipc_conf , sof_dsp_ack_write );
150155 bool ipc_irq = false;
151156 int dsp_msg , dsp_ack ;
152157
158+ if (sdev -> first_boot && sdev -> fw_state != SOF_FW_BOOT_COMPLETE ) {
159+ snd_sof_ipc_msgs_rx (sdev );
160+ acp_dsp_ipc_host_done (sdev );
161+ return IRQ_HANDLED ;
162+ }
163+
153164 dsp_msg = snd_sof_dsp_read (sdev , ACP_DSP_BAR , ACP_SCRATCH_REG_0 + dsp_msg_write );
154165 if (dsp_msg ) {
155166 snd_sof_ipc_msgs_rx (sdev );
@@ -179,7 +190,7 @@ EXPORT_SYMBOL_NS(acp_sof_ipc_irq_thread, SND_SOC_SOF_AMD_COMMON);
179190int acp_sof_ipc_msg_data (struct snd_sof_dev * sdev , struct snd_pcm_substream * substream ,
180191 void * p , size_t sz )
181192{
182- unsigned int offset = offsetof( struct scratch_ipc_conf , sof_out_box ) ;
193+ unsigned int offset = sdev -> dsp_box . offset ;
183194
184195 if (!substream || !sdev -> stream_box .size )
185196 acp_mailbox_read (sdev , offset , p , sz );
@@ -196,4 +207,10 @@ int acp_sof_ipc_get_mailbox_offset(struct snd_sof_dev *sdev)
196207}
197208EXPORT_SYMBOL_NS (acp_sof_ipc_get_mailbox_offset , SND_SOC_SOF_AMD_COMMON );
198209
210+ int acp_sof_ipc_get_window_offset (struct snd_sof_dev * sdev , u32 id )
211+ {
212+ return 0 ;
213+ }
214+ EXPORT_SYMBOL_NS (acp_sof_ipc_get_window_offset , SND_SOC_SOF_AMD_COMMON );
215+
199216MODULE_DESCRIPTION ("AMD ACP sof-ipc driver" );
0 commit comments