As part of this brief blog, we are enabling Asymmetric Multiprocessing (AMP) boot support for the Cortex-M7 core on the i.MX8MP SoC device model in Qemu. The M7 firmware can be loadedand started from Linux running on the Cortex-A53 cores via the remoteproc framework.
Asymmetric Multiprocessing (AMP) Boot
To those of you wondering what AMP is: -
It refers to a boot configuration where different processor cores run different operating systems or applications independently.
The i.MX8M Plus contains:
In AMP mode, the boot sequence typically works as follows:
There are 2 control paths for Cortex-M7 on iMX8MP:-
"fsl,imx8mp-cm7-mmio" in linux exists specifically to select the MMIO path and avoid dependence on firmware interfaces that aren’t guaranteed in qemu.
This mode uses the SRC syscon block and the IOMUXC GPR for start/stop control.
Memory carveouts for resource table, vrings need to be specified in the "imx8mp-evk-rpmsg.dts".
Follow this application note to make the necessary changes - https://www.nxp.com/docs/en/application-note/AN5317.pdf
When Linux boots CM7 via remoteproc, the typical flow is:
The attached patch series introduces the following peripheral models needed for AMP:
- GPC (General Power Controller)
- GPR (General Purpose Registers)
- SRC (System Reset Controller)
- MU (Messaging Unit)
- Extends the CCM with M7 clock outputs and wires into the i.MX8MP SoC
- Enable Cortex-M7 boot in i.MX8MP EVK functional test
//How to apply the patches: -
1. Fetch the qemu repo's master branch and apply the patches attached with this blog.
2. Build qemu after the patches are applied. Steps to build are mentioned in the repo's readme itself -
//Testing the AMP boot of Cortex-M7 from linux on Cortex-A53
Pre-requisites: -
a. Build a bare metal M7 elf from MCUXpresso SDK of iMX8QXP. Make sure you use this build script - build_ddr_release.sh
we will be using this example for demonstration - boards/evkmimx8mp/driver_examples/uart/polling
you will obtain an elf.
b. imx8mp-evk-rpmsg.dtb built with the help of AN5317.
Now in another cli tab execute this to open the M7 console - "screen /tmp/imx8mp-uart 115200", an empty screen will open up.
now in the console where linux guest is running, execute the following: -
As soon you do this, you will observe in the other tab that M7 binary has started executing: -