Enabling Cortex-M7 Asymmetric Multiprocessing boot support for i.MX8MPEVK on Qemu

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Enabling Cortex-M7 Asymmetric Multiprocessing boot support for i.MX8MPEVK on Qemu

Enabling Cortex-M7 Asymmetric Multiprocessing boot support for i.MX8MPEVK on Qemu



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:

      • 4x Cortex-A53 cores (application processors running Linux/Android)
      • 1x Cortex-M7 core (real-time processor for RTOS/bare-metal)

In AMP mode, the boot sequence typically works as follows:

      1. Primary boot: Cortex-A53 cores boot first (running U-Boot, then Linux)
      2. Secondary boot: Cortex-M7 is loaded and started by Linux or U-Boot

 

 There are 2 control paths for Cortex-M7 on iMX8MP:-

  1. Firmware-mediated (via SMC/ATF)
  2. MMIO driven path (via SRC and GPR access)

 

"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:

  1. Linux booted with imx8mp-evk-rpmsg.dtb
  2. Linux loads the CM7 ELF into a reserved DDR region
  3. Linux toggles the CM7 start/stop control (SRC/GPR CPUWAIT, etc.)
  4. CM7 starts executing from that DDR entry

 

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 -

https://github.com/qemu/QEMU


//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.

  1. copy the iMX8MP kernel to the location ~/qemu-emulation/iMX8MP/
  2. copy imx8mp-evk-rpmsg.dtb to the same location
  3. Download .img for imx8mp from here - Buildroot 2024.02 Release for i.MX Platforms | Ezurio

    Testing:-

    Execute the following from the build folder of your qemu:-

    ./qemu-system-aarch64 -M imx8mp-evk -smp 4,maxcpus=5 -global fsl-imx8mp.enable-cm7=on -m 3G -display none -serial null -serial stdio -serial null -serial pty:/tmp/imx8mp-uart -kernel ~/qemu-emulation/iMX8MP/Image -dtb ~/qemu-emulation/iMX8MP/imx8mp-evk-rpmsg.dtb -append "root=/dev/mmcblk2p1" -drive file=~/qemu-emulation/iMX8MP/20240522-br2024.02-nitrogen8mp_qt5_gst1.img,if=sd,bus=2,format=raw,id=mmcblk2 -net nic,model=imx.enet -net user,hostfwd=tcp::2222-:22

     1.png
 

2.png



 

 

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: -

 3.png

 

As soon you do this, you will observe in the other tab that M7 binary has started executing: -


 4.png

 

 

 

 

ラベル(1)
添付
評価なし
バージョン履歴
最終更新日:
木曜日
更新者: