How to handle interrupts at the "application layer" when implementing communication between A and M

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to handle interrupts at the "application layer" when implementing communication between A and M

518 次查看
ximenbingmeng
Contributor III

Hello, during the use of the Rpmsg bus, the device tree&rpmsg was modified at core A, and ttyRPMSG30 devices were identified in the dev directory;

Data can be read through a serial application program read()/write() through querying.

We would like to know how MU hardware interrupts are reported to the application layer, and how should we handle them at the application layer?

I referred to the following article,

https://blog.csdn.net/kunkliu/article/details/126475045?spm=1001.2101.3001.6650.3&utm_medium=distrib...
https://blog.csdn.net/kunkliu/article/details/126475302
https://blog.csdn.net/weixin_43717839/article/details/129119174

0 项奖励
回复
1 回复

475 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You should refer in drivers/mailbox/imx-mailbox.c and rpmsg framework;

We register mbox into mailbox framework

priv->mbox.dev = dev;
	priv->mbox.ops = &imx_mu_ops;
	priv->mbox.chans = priv->mbox_chans;
	priv->mbox.txdone_irq = true;

	platform_set_drvdata(pdev, priv);

	ret = devm_mbox_controller_register(dev, &priv->mbox);

and use mbox_xxx_xxx in imx-rpmsg to get data.

The interrupt is handled by  imx-mailbox and call the callback(rpmsg_tty_cb/rpmsg_pingpong_cb) in rpmsg driver we defined. If you need report it to kernel layer, you need refer the drivers/rpmsg/imx_rpmsg_pingpong.c or drivers/rpmsg/imx_rpmsg_tty.c to write your driver to report status to userspace and handle it . In this process, you may need modify mailbox driver.

 

Or you can just read the MU registers in userspace

 

0 项奖励
回复