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

677件の閲覧回数
ximenbingmeng
Contributor IV

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 返信

634件の閲覧回数
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 件の賞賛
返信