Peripheral Sharing between M7 and A53 on IMX8MP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Peripheral Sharing between M7 and A53 on IMX8MP

1,036 Views
fladan
Contributor II

Hi,

I would like to use UART3 both on A53 and M7. In other posts I read, that using shared peripherals is quite complicated and things need to be changed in the kernel (https://community.nxp.com/t5/i-MX-Processors/Is-there-a-demo-source-code-for-peripheral-sharing-betw...). 

In my case I don't want to access peripherals simultaneously!

The idea is to use the UART3 on A53 for initialization/update sequence with a slave device. After the sequence the UART3 is unbind from the A53 and simultaneous access is prohibited in this way.

Then the firmware is started on the M7 core and UART3 is used there to get data from the slave device frequently. If another initialization sequence/update is needed, the firmware will be stopped on M7 and the UART is bind to the A53 again.

 

Can you give me a opinion and point out upcoming risks, implementing this approach with bind/unbind a serial device on A53 start/stop the firmware on M7?

echo stop >/sys/class/remoteproc/remoteprocX/state
echo 30880000.serial > /sys/bus/platform/drivers/imx-uart/bind
// do init sequence...
echo 30880000.serial > /sys/bus/platform/drivers/imx-uart/unbind
echo start >/sys/class/remoteproc/remoteprocX/state
// run application...

 

0 Kudos
4 Replies

1,008 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

This is a bit difficult, since the domain of the UART3 is in  the Cortex A53, this include the peripheral, clocks and pads, unless otherwise set. It is not as easy as to unbind and bind the device.

I would suggest that one of the two Cores, I would say the M7, have the UART3 domain at all times and initialize/update sequence is performed by A53 by sending messages to M7 through RPMSG.

Similar application as in demo app sai_low_power_audio available in SDK package at <SDK installation path\boards\evkmimx8mn\demo_apps>

Best regards,
Aldo.

0 Kudos

999 Views
fladan
Contributor II

Hello Aldo,

thank's for your reply. The procedure I mentioned in my post, works for me already in reality. I tried it on the eval kit and it seems to work.

When the UART3 is unbind from the A53 and a new firmware is flashed on the M7, which configures the UART, I don't see what can go wrong. Do you have an opinion on this?

Having UART3 on the M7 domain and using RPMSG is my fallback solution and already implemented. I will have a look on the example you mentioned, thanks.

BR,
Daniel

 

 

0 Kudos

996 Views
AldoG
NXP TechSupport
NXP TechSupport

Hi,

Your implementation looks fine, the only drawback is that you'll need to re-configure UART3 each time you bind and unbind your device, with the other solution you'll have full control of the peripheral at all time in the M7 side.

If this is not an issue for your application then it is ok.

Best regards,
Aldo.

0 Kudos

987 Views
fladan
Contributor II

Hi,

 

thanks again. I will think about both solutions and decide which is better in my case.

 

BR,

Daniel