iMX8-M4 RPMSG ISSUE 4GB RAM

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

iMX8-M4 RPMSG ISSUE 4GB RAM

跳至解决方案
5,070 次查看
francescoferrar
Contributor III

I have a problem with RPMSG on iMX8MM M4 side

My board is equipped with 4GB DDR

On A53 side, while kernel boot,  the function vring_map_one_sg(vq, sg, DMA_FROM_DEVICE), called from

virtqueue_add(...), return the buffer data address that M4 use to write messagges.

With 2GB (OK)

vring_map_one_sg() return first address at 0xa8040000.

With 4GB (KO)

vring_map_one_sg() return first address at 0xe8040000.
When M4 gets the address 0xe8040000 to use as data buffer, it crashes
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
4,628 次查看
francescoferrar
Contributor III

Hi Igor

I fixed the issue adding cma to kernel command line. In my case (cma=320M@-2048M)

In this way virtqueue_add() function populates the address list buffers starting from 0x60040000 that is a address accesible by M4.

 

Reference:

https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html

(cma=nn[MG]@[start[MG][-end[MG]]])


Best Regards

Francesco

在原帖中查看解决方案

0 项奖励
回复
8 回复数
4,628 次查看
francescoferrar
Contributor III

Sorry Igor,

I believe that M4 is not able to access the DDR at 0xe8040000. Do you know if M4 can access DDR over 3GB?

Thanks

Francesco

0 项奖励
回复
4,628 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Francesco

I think you are right, according to sect.2.1.3 Cortex-M4 Memory Map

Reference Manual address 0xe8040000 is marked as "reserved".

Best regards
igor

0 项奖励
回复
4,628 次查看
francescoferrar
Contributor III

Hi Igor

How can I fix the RPMSG problem with 4GB DDR?

 

I add a new test that could help:

If I set mem=2048 in kernel command line parameters, RPMSG works fine with 4GBytes of DDR.

 

Best regards

Francesco

0 项奖励
回复
4,628 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Francesco

seems you already found solution. In general one can debug it

using rpmsg driver description in Linux Manual included in Linux 4.14.98_2.2.0 Documentation

Best regards
igor

0 项奖励
回复
4,628 次查看
francescoferrar
Contributor III

Sorry Igor

mem = 2048 is not the solution, I have to use all 4 GB so I can't limit the memory to 2048

Thanks

Francesco

0 项奖励
回复
4,628 次查看
igorpadykov
NXP Employee
NXP Employee

seems this general linux issue, suggest to post issue on kernel mail list.

Majordomo Lists at VGER.KERNEL.ORG 

Obviously there is no workaround or solution for M4 access to 0xe8040000 as

this is i.MX8M Mini hardware limitation accordng to 2.1.3 Cortex-M4 Memory Map

i.MX 8M Mini Applications Processor Reference Manual

Also for rpmsg memory usage may be useful to check

https://community.nxp.com/thread/453549 

Best regards
igor

4,629 次查看
francescoferrar
Contributor III

Hi Igor

I fixed the issue adding cma to kernel command line. In my case (cma=320M@-2048M)

In this way virtqueue_add() function populates the address list buffers starting from 0x60040000 that is a address accesible by M4.

 

Reference:

https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html

(cma=nn[MG]@[start[MG][-end[MG]]])


Best Regards

Francesco

0 项奖励
回复
4,628 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Francesco

one can try to configure access permissions using RDC, examples

can be found in SDK EVK-MIMX8M Mini  Welcome | MCUXpresso SDK Builder 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复