Lines Matching full:ipi

12 #include <linux/mailbox/zynqmp-ipi-message.h>
22 /* IPI buffer MAX length */
143 * @ipi: pointer to mailbox information
156 struct mbox_info *ipi; member
203 struct mbox_info *ipi; in handle_event_notified() local
206 ipi = container_of(work, struct mbox_info, mbox_work); in handle_event_notified()
207 rproc = ipi->r5_core->rproc; in handle_event_notified()
210 * We only use IPI for interrupt. The RPU firmware side may or may in handle_event_notified()
211 * not write the notifyid when it trigger IPI. in handle_event_notified()
224 * Receive data from ipi buffer, ack interrupt and then
230 struct mbox_info *ipi; in zynqmp_r5_mb_rx_cb() local
233 ipi = container_of(cl, struct mbox_info, mbox_cl); in zynqmp_r5_mb_rx_cb()
235 /* copy data from ipi buffer to r5_core */ in zynqmp_r5_mb_rx_cb()
237 buf_msg = (struct zynqmp_ipi_message *)ipi->rx_mc_buf; in zynqmp_r5_mb_rx_cb()
248 if (mbox_send_message(ipi->rx_chan, NULL) < 0) in zynqmp_r5_mb_rx_cb()
251 schedule_work(&ipi->mbox_work); in zynqmp_r5_mb_rx_cb()
266 struct mbox_info *ipi; in zynqmp_r5_setup_mbox() local
268 ipi = kzalloc(sizeof(*ipi), GFP_KERNEL); in zynqmp_r5_setup_mbox()
269 if (!ipi) in zynqmp_r5_setup_mbox()
272 mbox_cl = &ipi->mbox_cl; in zynqmp_r5_setup_mbox()
280 ipi->tx_chan = mbox_request_channel_byname(mbox_cl, "tx"); in zynqmp_r5_setup_mbox()
281 if (IS_ERR(ipi->tx_chan)) { in zynqmp_r5_setup_mbox()
282 ipi->tx_chan = NULL; in zynqmp_r5_setup_mbox()
283 kfree(ipi); in zynqmp_r5_setup_mbox()
288 ipi->rx_chan = mbox_request_channel_byname(mbox_cl, "rx"); in zynqmp_r5_setup_mbox()
289 if (IS_ERR(ipi->rx_chan)) { in zynqmp_r5_setup_mbox()
290 mbox_free_channel(ipi->tx_chan); in zynqmp_r5_setup_mbox()
291 ipi->rx_chan = NULL; in zynqmp_r5_setup_mbox()
292 ipi->tx_chan = NULL; in zynqmp_r5_setup_mbox()
293 kfree(ipi); in zynqmp_r5_setup_mbox()
298 INIT_WORK(&ipi->mbox_work, handle_event_notified); in zynqmp_r5_setup_mbox()
300 return ipi; in zynqmp_r5_setup_mbox()
303 static void zynqmp_r5_free_mbox(struct mbox_info *ipi) in zynqmp_r5_free_mbox() argument
305 if (!ipi) in zynqmp_r5_free_mbox()
308 if (ipi->tx_chan) { in zynqmp_r5_free_mbox()
309 mbox_free_channel(ipi->tx_chan); in zynqmp_r5_free_mbox()
310 ipi->tx_chan = NULL; in zynqmp_r5_free_mbox()
313 if (ipi->rx_chan) { in zynqmp_r5_free_mbox()
314 mbox_free_channel(ipi->rx_chan); in zynqmp_r5_free_mbox()
315 ipi->rx_chan = NULL; in zynqmp_r5_free_mbox()
318 kfree(ipi); in zynqmp_r5_free_mbox()
331 struct mbox_info *ipi; in zynqmp_r5_rproc_kick() local
334 ipi = r5_core->ipi; in zynqmp_r5_rproc_kick()
335 if (!ipi) in zynqmp_r5_rproc_kick()
338 mb_msg = (struct zynqmp_ipi_message *)ipi->tx_mc_buf; in zynqmp_r5_rproc_kick()
341 ret = mbox_send_message(ipi->tx_chan, mb_msg); in zynqmp_r5_rproc_kick()
1258 struct mbox_info *ipi; in zynqmp_r5_cluster_init() local
1353 ipi = zynqmp_r5_setup_mbox(&child_pdev->dev); in zynqmp_r5_cluster_init()
1354 if (ipi) { in zynqmp_r5_cluster_init()
1355 r5_cores[i]->ipi = ipi; in zynqmp_r5_cluster_init()
1356 ipi->r5_core = r5_cores[i]; in zynqmp_r5_cluster_init()
1396 zynqmp_r5_free_mbox(r5_cores[i]->ipi); in zynqmp_r5_cluster_init()
1421 zynqmp_r5_free_mbox(r5_core->ipi); in zynqmp_r5_cluster_exit()