Using rproc on the imx8mp

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

Using rproc on the imx8mp

879 Views
waker
Contributor I

Hope you are well. This may be a bit of a sporadic set of questions but I'm new to Yocto and heterogeneous chips. Any help would be much appreciated.

I'm using a Kontron baseboard that uses a imx8mp. I've been able to get Yocto building and running on the A-cores off an SD card, likewise I have code running on the M-cores. The later was done though using u-Boot, and now I want to move that over to be rproc controlled with rpmsg capabilities.

I've enabled the drivers with menuconfig, and now when loading Linux I see the remoteproc folder in sys/class/. However, it's empty. This I believe means that it's not enabled in the device tree. My understanding, correct me if I'm wrong, is I want to do these steps:

  1. Modify device tree to reserve memory for the TCM (and enable mailboxes?).
  2. Do this with an overlay instead of modify the dtb file that is pulled in.
  3. Add this to the kernel build with a recipe/layer.

I've found this imx linux rproc support doc but it doesn't tell me how to load the overlay like described above or different.

My vague questions are:

  1. Am I barking up the wrong tree in direction to the device tree? What's the "done" way?
  2. My end goal is I build everything with Yocto, flash the image onto the board no further board interaction needed. Is this possible?

More pointed questions:

  1. How do I get an overlay to be applied at Yocto build time?
  2. Is the imx linux rproc support doc mentions the rproc DTS node and the used memory nodes. Are these the only changes needed?

Thanks in advance!

0 Kudos
Reply
3 Replies

797 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @waker,


Am I barking up the wrong tree with the device tree? What’s the “done” way?

You’re correct: the done way is to enable the i.MX remoteproc node in the DT and reserve the memory regions used by the firmware and RPMsg (ITCM/DTCM or DDR, vrings, vdev buffer, optional resource table), and to wire up the mailboxes (MU) used by rpmsg‑virtio. The kernel rproc driver for i.MX ( imx-rproc ) expects these DT nodes; when present, you’ll see remoteproc0 under /sys/class/remoteproc/.

 

How do I get an overlay applied at Yocto build time?

You can follow the next guides to achieve that goal:

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-use-Devshell-to-compile-device-tr...

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-compile-Linux-Kernel-Image-and-de...

My end goal is I build everything with Yocto, flash the image onto the board no further board interaction needed. Is this possible?

Yes, you can generate a proper patch according to your needs and apply the patch to yocto project.

 

Is the imx linux rproc support doc mentions the rproc DTS node and the used memory nodes. Are these the only changes needed?

Yes.

 

You can check our demos and device tree of the iMX8MP-EVK board as a reference.

To enable the virtual channel you have to install a kernel module in the system as we describe in our examples.

 

https://github.com/nxp-mcuxpresso/legacy-mcux-sdk-examples/tree/main/evkmimx8mp/multicore_examples/r...

https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/arch/arm64/boot/dts/freescale/imx8mp-evk-rpmsg.d...

 

Best Regards,
Chavira

 

0 Kudos
Reply

647 Views
waker
Contributor I

Thanks for the response, I have the device tree loading onto the system (the modified Kontron provided device tree attached). I can see this is the reserved-memory directory:

root@kontron-mx8mp:~# ls /proc/device-tree/reserved-memory/
'#address-cells'   m4@0x10000000   m4@0x800000   name    '#size-cells'           vdev0vring1@55008000
 dsp@92400000      m4@0x7E0000     m4@80000000   ranges   vdev0vring0@55000000   vdevbuffer@55400000

However, the remote proc directory (/sys/class/remoteproc/) is empty, and I've read this is a memory issue in the device tree. Any idea where I may have gone wrong?

It may also be worth mentioning I see the following on boot:

[   13.286497] remoteproc remoteproc0: releasing imx-rproc

 

I have also trued using the provided evk rpmsg dts you mentioned, but to no avail. I'm getting the same issue.

0 Kudos
Reply

642 Views
waker
Contributor I
I'm also seeing this on boot:
`[ 13.289371] platform imx8mp-cm7: deferred probe pending`
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2297414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUsing%20rproc%20on%20the%20imx8mp%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2297414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHope%20you%20are%20well.%20This%20may%20be%20a%20bit%20of%20a%20sporadic%20set%20of%20questions%20but%20I'm%20new%20to%20Yocto%20and%20heterogeneous%20chips.%20Any%20help%20would%20be%20much%20appreciated.%3C%2FP%3E%3CP%3EI'm%20using%20a%20%3CA%20href%3D%22https%3A%2F%2Fwww.kontron.com%2Fen%2Fproducts%2Fbaseboard-bl-i.mx8m-plus%2Fp186231%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EKontron%20baseboard%3C%2FA%3E%26nbsp%3Bthat%20uses%20a%20imx8mp.%20I've%20been%20able%20to%20get%20Yocto%20building%20and%20running%20on%20the%20A-cores%20off%20an%20SD%20card%2C%20likewise%20I%20have%20code%20running%20on%20the%20M-cores.%20The%20later%20was%20done%20though%20using%20u-Boot%2C%20and%20now%20I%20want%20to%20move%20that%20over%20to%20be%20rproc%20controlled%20with%20rpmsg%20capabilities.%3C%2FP%3E%3CP%3EI've%20enabled%20the%20drivers%20with%20menuconfig%2C%20and%20now%20when%20loading%20Linux%20I%20see%20the%20remoteproc%20folder%20in%26nbsp%3Bsys%2Fclass%2F.%20However%2C%20it's%20empty.%20This%20I%20believe%20means%20that%20it's%20not%20enabled%20in%20the%20device%20tree.%20My%20understanding%2C%20correct%20me%20if%20I'm%20wrong%2C%20is%20I%20want%20to%20do%20these%20steps%3A%3C%2FP%3E%3COL%3E%3CLI%3EModify%20device%20tree%20to%20reserve%20memory%20for%20the%20TCM%20(and%20enable%20mailboxes%3F).%3C%2FLI%3E%3CLI%3EDo%20this%20with%20an%20overlay%20instead%20of%20modify%20the%20dtb%20file%20that%20is%20pulled%20in.%3C%2FLI%3E%3CLI%3EAdd%20this%20to%20the%20kernel%20build%20with%20a%20recipe%2Flayer.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EI've%20found%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.nxp.com%2Fbundle%2FAN5317%2Fpage%2Ftopics%2Fimx_linux_rproc_support.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eimx%20linux%20rproc%20support%3C%2FA%3E%26nbsp%3Bdoc%20but%20it%20doesn't%20tell%20me%20how%20to%20load%20the%20overlay%20like%20described%20above%20or%20different.%3C%2FP%3E%3CP%3EMy%20vague%20questions%20are%3A%3C%2FP%3E%3COL%3E%3CLI%3EAm%20I%20barking%20up%20the%20wrong%20tree%20in%20direction%20to%20the%20device%20tree%3F%20What's%20the%20%22done%22%20way%3F%3C%2FLI%3E%3CLI%3EMy%20end%20goal%20is%20I%20build%20everything%20with%20Yocto%2C%20flash%20the%20image%20onto%20the%20board%20no%20further%20board%20interaction%20needed.%20Is%20this%20possible%3F%3C%2FLI%3E%3C%2FOL%3E%3CP%3EMore%20pointed%20questions%3A%3C%2FP%3E%3COL%3E%3CLI%3EHow%20do%20I%20get%20an%20overlay%20to%20be%20applied%20at%20Yocto%20build%20time%3F%3C%2FLI%3E%3CLI%3EIs%20the%20imx%20linux%20rproc%20support%20doc%20mentions%20the%20%3CSPAN%3Erproc%20DTS%20node%20and%20the%20used%20memory%20nodes.%20Are%20these%20the%20only%20changes%20needed%3F%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2297414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2298539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20rproc%20on%20the%20imx8mp%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2298539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257951%22%20target%3D%22_blank%22%3E%40waker%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CBR%20%2F%3EAm%20I%20barking%20up%20the%20wrong%20tree%20with%20the%20device%20tree%3F%20What%E2%80%99s%20the%20%E2%80%9Cdone%E2%80%9D%20way%3F%3C%2FSTRONG%3E%3CBR%20%2F%3EYou%E2%80%99re%20correct%3A%20the%20done%20way%20is%20to%20enable%20the%20i.MX%20remoteproc%20node%20in%20the%20DT%20and%20reserve%20the%20memory%20regions%20used%20by%20the%20firmware%20and%20RPMsg%20(ITCM%2FDTCM%20or%20DDR%2C%20vrings%2C%20vdev%20buffer%2C%20optional%20resource%20table)%2C%20and%20to%20wire%20up%20the%20mailboxes%20(MU)%20used%20by%20rpmsg%E2%80%91virtio.%20The%20kernel%20rproc%20driver%20for%20i.MX%20(%20imx-rproc%20)%20expects%20these%20DT%20nodes%3B%20when%20present%2C%20you%E2%80%99ll%20see%20remoteproc0%20under%20%2Fsys%2Fclass%2Fremoteproc%2F.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EHow%20do%20I%20get%20an%20overlay%20applied%20at%20Yocto%20build%20time%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EYou%20can%20follow%20the%20next%20guides%20to%20achieve%20that%20goal%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2FHow-to-use-Devshell-to-compile-device-tree-files%2Fta-p%2F1727428%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2FHow-to-use-Devshell-to-compile-device-tree-files%2Fta-p%2F1727428%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2FHow-to-compile-Linux-Kernel-Image-and-device-tree-using-Yocto%2Fta-p%2F2022759%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2FHow-to-compile-Linux-Kernel-Image-and-device-tree-using-Yocto%2Fta-p%2F2022759%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EMy%20end%20goal%20is%20I%20build%20everything%20with%20Yocto%2C%20flash%20the%20image%20onto%20the%20board%20no%20further%20board%20interaction%20needed.%20Is%20this%20possible%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EYes%2C%20you%20can%20generate%20a%20proper%20patch%20according%20to%20your%20needs%20and%20apply%20the%20patch%20to%20yocto%20project.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EIs%20the%20imx%20linux%20rproc%20support%20doc%20mentions%20the%20rproc%20DTS%20node%20and%20the%20used%20memory%20nodes.%20Are%20these%20the%20only%20changes%20needed%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EYes.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EYou%20can%20check%20our%20demos%20and%20device%20tree%20of%20the%20iMX8MP-EVK%20board%20as%20a%20reference.%3C%2FP%3E%0A%3CP%3ETo%20enable%20the%20virtual%20channel%20you%20have%20to%20install%20a%20kernel%20module%20in%20the%20system%20as%20we%20describe%20in%20our%20examples.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Flegacy-mcux-sdk-examples%2Ftree%2Fmain%2Fevkmimx8mp%2Fmulticore_examples%2Frpmsg_lite_str_echo_rtos%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-mcuxpresso%2Flegacy-mcux-sdk-examples%2Ftree%2Fmain%2Fevkmimx8mp%2Fmulticore_examples%2Frpmsg_lite_str_echo_rtos%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mp-evk-rpmsg.dts%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mp-evk-rpmsg.dts%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards%2C%3CBR%20%2F%3EChavira%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2302900%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20rproc%20on%20the%20imx8mp%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2302900%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20for%20the%20response%2C%20I%20have%20the%20device%20tree%20loading%20onto%20the%20system%20(the%20modified%20Kontron%20provided%20device%20tree%20attached).%20I%20can%20see%20this%20is%20the%20reserved-memory%20directory%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eroot%40kontron-mx8mp%3A~%23%20ls%20%2Fproc%2Fdevice-tree%2Freserved-memory%2F%0A'%23address-cells'%20%20%20m4%400x10000000%20%20%20m4%400x800000%20%20%20name%20%20%20%20'%23size-cells'%20%20%20%20%20%20%20%20%20%20%20vdev0vring1%4055008000%0A%20dsp%4092400000%20%20%20%20%20%20m4%400x7E0000%20%20%20%20%20m4%4080000000%20%20%20ranges%20%20%20vdev0vring0%4055000000%20%20%20vdevbuffer%4055400000%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EHowever%2C%20the%20remote%20proc%20directory%20(%2Fsys%2Fclass%2Fremoteproc%2F)%20is%20empty%2C%20and%20I've%20read%20this%20is%20a%20memory%20issue%20in%20the%20device%20tree.%20Any%20idea%20where%20I%20may%20have%20gone%20wrong%3F%3C%2FP%3E%3CP%3EIt%20may%20also%20be%20worth%20mentioning%20I%20see%20the%20following%20on%20boot%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%5B%20%20%2013.286497%5D%20remoteproc%20remoteproc0%3A%20releasing%20imx-rproc%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EI%20have%20also%20trued%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Flinux-imx%2Fblob%2Flf-6.12.y%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mp-evk-rpmsg.dts%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eprovided%3C%2FA%3E%20evk%20rpmsg%20dts%20you%20mentioned%2C%20but%20to%20no%20avail.%20I'm%20getting%20the%20same%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2302996%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20rproc%20on%20the%20imx8mp%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2302996%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI'm%20also%20seeing%20this%20on%20boot%3A%3CBR%20%2F%3E%60%5B%2013.289371%5D%20platform%20imx8mp-cm7%3A%20deferred%20probe%20pending%60%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E