@@ -58,13 +58,13 @@ static void do_notify(void)
5858 uint32_t flags ;
5959 struct ipc_msg * msg ;
6060
61- tracev_ipc ("Not" );
62-
6361 spin_lock_irq (& _ipc -> lock , flags );
6462 msg = _ipc -> shared_ctx -> dsp_msg ;
6563 if (msg == NULL )
6664 goto out ;
6765
66+ trace_ipc ("ipc: not rx -> 0x%x" , msg -> header );
67+
6868 /* copy the data returned from DSP */
6969 if (msg -> rx_size && msg -> rx_size < SOF_IPC_MSG_MAX_SIZE )
7070 mailbox_dspbox_read (msg -> rx_data , 0 , msg -> rx_size );
@@ -88,12 +88,13 @@ static void do_notify(void)
8888static void irq_handler (void * arg )
8989{
9090 uint32_t isr ;
91-
92- tracev_ipc ("IRQ" );
91+ uint32_t msg = 0 ;
9392
9493 /* Interrupt arrived, check src */
9594 isr = shim_read (SHIM_ISRD );
9695
96+ tracev_ipc ("ipc: irq isr 0x%x" , isr );
97+
9798 if (isr & SHIM_ISRD_DONE ) {
9899
99100 /* Mask Done interrupt before return */
@@ -108,12 +109,17 @@ static void irq_handler(void *arg)
108109 shim_write (SHIM_IMRD , shim_read (SHIM_IMRD ) | SHIM_IMRD_BUSY );
109110 interrupt_clear (PLATFORM_IPC_INTERRUPT );
110111
112+ msg = shim_read (SHIM_IPCXL );
113+
111114 /* TODO: place message in Q and process later */
112115 /* It's not Q ATM, may overwrite */
113116 if (_ipc -> host_pending ) {
114- trace_ipc_error ("Pen" );
117+ trace_ipc_error ("ipc: dropping msg 0x%x" , msg );
118+ trace_ipc_error (" isr 0x%x imrd 0x%x ipcxh 0x%x" ,
119+ isr , shim_read (SHIM_IMRD ),
120+ shim_read (SHIM_IPCXH ));
115121 } else {
116- _ipc -> host_msg = shim_read ( SHIM_IPCXL ) ;
122+ _ipc -> host_msg = msg ;
117123 _ipc -> host_pending = 1 ;
118124 ipc_schedule_process (_ipc );
119125 }
@@ -127,7 +133,7 @@ void ipc_platform_do_cmd(struct ipc *ipc)
127133 uint32_t ipcxh ;
128134 int32_t err ;
129135
130- tracev_ipc ( "Cmd" );
136+ trace_ipc ( "ipc: msg rx -> 0x%x" , ipc -> host_msg );
131137
132138 /* perform command and return any error */
133139 err = ipc_cmd ();
@@ -159,12 +165,9 @@ void ipc_platform_do_cmd(struct ipc *ipc)
159165 /* are we about to enter D3 ? */
160166 if (iipc -> pm_prepare_D3 ) {
161167 while (1 ) {
162- trace_ipc ("pme" );
163168 wait_for_interrupt (0 );
164169 }
165170 }
166-
167- tracev_ipc ("CmD" );
168171}
169172
170173void ipc_platform_send_msg (struct ipc * ipc )
@@ -190,7 +193,7 @@ void ipc_platform_send_msg(struct ipc *ipc)
190193 mailbox_dspbox_write (0 , msg -> tx_data , msg -> tx_size );
191194 list_item_del (& msg -> list );
192195 ipc -> shared_ctx -> dsp_msg = msg ;
193- tracev_ipc ("Msg" );
196+ tracev_ipc ("ipc: msg tx -> 0x%x" , msg -> header );
194197
195198 /* now interrupt host to tell it we have message sent */
196199 shim_write (SHIM_IPCDL , msg -> header );
0 commit comments