Lines Matching full:ipi

12 #include <linux/mailbox/zynqmp-ipi-message.h>
22 /* IPI buffer MAX length */
94 * @ipi: pointer to mailbox information
103 struct mbox_info *ipi; member
150 struct mbox_info *ipi; in handle_event_notified() local
153 ipi = container_of(work, struct mbox_info, mbox_work); in handle_event_notified()
154 rproc = ipi->r5_core->rproc; in handle_event_notified()
157 * We only use IPI for interrupt. The RPU firmware side may or may in handle_event_notified()
158 * not write the notifyid when it trigger IPI. in handle_event_notified()
171 * Receive data from ipi buffer, ack interrupt and then
177 struct mbox_info *ipi; in zynqmp_r5_mb_rx_cb() local
180 ipi = container_of(cl, struct mbox_info, mbox_cl); in zynqmp_r5_mb_rx_cb()
182 /* copy data from ipi buffer to r5_core */ in zynqmp_r5_mb_rx_cb()
184 buf_msg = (struct zynqmp_ipi_message *)ipi->rx_mc_buf; in zynqmp_r5_mb_rx_cb()
195 if (mbox_send_message(ipi->rx_chan, NULL) < 0) in zynqmp_r5_mb_rx_cb()
198 schedule_work(&ipi->mbox_work); in zynqmp_r5_mb_rx_cb()
213 struct mbox_info *ipi; in zynqmp_r5_setup_mbox() local
215 ipi = kzalloc(sizeof(*ipi), GFP_KERNEL); in zynqmp_r5_setup_mbox()
216 if (!ipi) in zynqmp_r5_setup_mbox()
219 mbox_cl = &ipi->mbox_cl; in zynqmp_r5_setup_mbox()
227 ipi->tx_chan = mbox_request_channel_byname(mbox_cl, "tx"); in zynqmp_r5_setup_mbox()
228 if (IS_ERR(ipi->tx_chan)) { in zynqmp_r5_setup_mbox()
229 ipi->tx_chan = NULL; in zynqmp_r5_setup_mbox()
230 kfree(ipi); in zynqmp_r5_setup_mbox()
235 ipi->rx_chan = mbox_request_channel_byname(mbox_cl, "rx"); in zynqmp_r5_setup_mbox()
236 if (IS_ERR(ipi->rx_chan)) { in zynqmp_r5_setup_mbox()
237 mbox_free_channel(ipi->tx_chan); in zynqmp_r5_setup_mbox()
238 ipi->rx_chan = NULL; in zynqmp_r5_setup_mbox()
239 ipi->tx_chan = NULL; in zynqmp_r5_setup_mbox()
240 kfree(ipi); in zynqmp_r5_setup_mbox()
245 INIT_WORK(&ipi->mbox_work, handle_event_notified); in zynqmp_r5_setup_mbox()
247 return ipi; in zynqmp_r5_setup_mbox()
250 static void zynqmp_r5_free_mbox(struct mbox_info *ipi) in zynqmp_r5_free_mbox() argument
252 if (!ipi) in zynqmp_r5_free_mbox()
255 if (ipi->tx_chan) { in zynqmp_r5_free_mbox()
256 mbox_free_channel(ipi->tx_chan); in zynqmp_r5_free_mbox()
257 ipi->tx_chan = NULL; in zynqmp_r5_free_mbox()
260 if (ipi->rx_chan) { in zynqmp_r5_free_mbox()
261 mbox_free_channel(ipi->rx_chan); in zynqmp_r5_free_mbox()
262 ipi->rx_chan = NULL; in zynqmp_r5_free_mbox()
265 kfree(ipi); in zynqmp_r5_free_mbox()
278 struct mbox_info *ipi; in zynqmp_r5_rproc_kick() local
281 ipi = r5_core->ipi; in zynqmp_r5_rproc_kick()
282 if (!ipi) in zynqmp_r5_rproc_kick()
285 mb_msg = (struct zynqmp_ipi_message *)ipi->tx_mc_buf; in zynqmp_r5_rproc_kick()
288 ret = mbox_send_message(ipi->tx_chan, mb_msg); in zynqmp_r5_rproc_kick()
1005 struct mbox_info *ipi; in zynqmp_r5_cluster_init() local
1089 ipi = zynqmp_r5_setup_mbox(&child_pdev->dev); in zynqmp_r5_cluster_init()
1090 if (ipi) { in zynqmp_r5_cluster_init()
1091 r5_cores[i]->ipi = ipi; in zynqmp_r5_cluster_init()
1092 ipi->r5_core = r5_cores[i]; in zynqmp_r5_cluster_init()
1132 zynqmp_r5_free_mbox(r5_cores[i]->ipi); in zynqmp_r5_cluster_init()
1157 zynqmp_r5_free_mbox(r5_core->ipi); in zynqmp_r5_cluster_exit()