@@ -80,13 +80,13 @@ int MAILBOX_Init(void)
8080
8181 if (HAL_IPCC_ActivateNotification (& hipcc , IPCC_CHANNEL_1 , IPCC_CHANNEL_DIR_RX ,
8282 IPCC_channel1_callback ) != HAL_OK ) {
83- OPENAMP_log_err ( "%s: ch_1 RX fail\n" , __func__ );
83+ Error_Handler ( );
8484 return -1 ;
8585 }
8686
8787 if (HAL_IPCC_ActivateNotification (& hipcc , IPCC_CHANNEL_2 , IPCC_CHANNEL_DIR_RX ,
8888 IPCC_channel2_callback ) != HAL_OK ) {
89- OPENAMP_log_err ( "%s: ch_2 RX fail\n" , __func__ );
89+ Error_Handler ( );
9090 return -1 ;
9191 }
9292
@@ -106,27 +106,23 @@ int MAILBOX_Notify(void *priv, uint32_t id)
106106 /* Called after virtqueue processing: time to inform the remote */
107107 if (id == VRING0_ID ) {
108108 channel = IPCC_CHANNEL_1 ;
109- OPENAMP_log_dbg ("Send msg on ch_1\r\n" );
110109 } else if (id == VRING1_ID ) {
111110 /* Note: the OpenAMP framework never notifies this */
112111 channel = IPCC_CHANNEL_2 ;
113- OPENAMP_log_dbg ("Send 'buff free' on ch_2\r\n" );
114112 return -1 ;
115113 } else {
116- OPENAMP_log_err ("invalid vring (%d)\r\n" , (int )id );
117114 return -1 ;
118115 }
119116
120117 /* Check that the channel is free (otherwise wait until it is) */
121118 if (HAL_IPCC_GetChannelStatus (& hipcc , channel , IPCC_CHANNEL_DIR_TX ) == IPCC_CHANNEL_STATUS_OCCUPIED ) {
122- OPENAMP_log_dbg ( "Waiting for channel to be freed\r\n" );
119+ // Wait for channel to be freed
123120 while (HAL_IPCC_GetChannelStatus (& hipcc , channel , IPCC_CHANNEL_DIR_TX ) == IPCC_CHANNEL_STATUS_OCCUPIED )
124121 ;
125122 }
126123
127124 /* Inform A7 (either new message, or buf free) */
128125 HAL_IPCC_NotifyCPU (& hipcc , channel , IPCC_CHANNEL_DIR_TX );
129-
130126 return 0 ;
131127}
132128
0 commit comments