2.6. Booting Remote Cores¶
This section discusses booting remote cores from Linux. Linux can boot remote cores during Linux boot, or during Linux runtime. Reference section Application Development on Remote Cores for information about booting remote cores from CCS.
2.6.1. Booting Remote Cores During Linux Boot¶
In normal operation, the boot loader (U-Boot) boots and loads Linux onto the A53 cores of the AM64x. If the remote cores are enabled in the Linux devicetree, then Linux will use the RemoteProc driver to boot the remote cores during Linux kernel boot time. Reference section Linux Boot Flow for more information about the Linux boot flow.
The Linux devicetree tells the RemoteProc driver which firmware files to load into the remote cores. By default, RemoteProc looks for these files:
Core Name |
RemoteProc Name |
Description |
Firmware File Name |
---|---|---|---|
R5F0-0 |
78000000.r5f |
R5F cluster0-Core0 |
am64-main-r5f0_0-fw |
R5F0-1 |
78200000.r5f |
R5F cluster0-Core1 |
am64-main-r5f0_1-fw |
R5F1-0 |
78400000.r5f |
R5F cluster1-Core0 |
am64-main-r5f1_0-fw |
R5F1-1 |
78600000.r5f |
R5F cluster1-Core1 |
am64-main-r5f1_1-fw |
M4F |
5000000.m4f |
M4F core |
am64-mcu-m4f0_0-fw |
The above files are generally soft linked to the intended firmware on a root file system. For example:
root@am64xx-evm:~# ls -l /lib/firmware
...
lrwxrwxrwx 1 root root 55 Jan 9 2022 am64-main-r5f0_0-fw -> /lib/firmware/mcusdk-benchmark_demo/am64-main-r5f0_0-fw
lrwxrwxrwx 1 root root 55 Jan 9 2022 am64-main-r5f0_1-fw -> /lib/firmware/mcusdk-benchmark_demo/am64-main-r5f0_1-fw
lrwxrwxrwx 1 root root 55 Jan 9 2022 am64-main-r5f1_0-fw -> /lib/firmware/mcusdk-benchmark_demo/am64-main-r5f1_0-fw
lrwxrwxrwx 1 root root 55 Jan 9 2022 am64-main-r5f1_1-fw -> /lib/firmware/mcusdk-benchmark_demo/am64-main-r5f1_1-fw
lrwxrwxrwx 1 root root 72 Jan 9 2022 am64-mcu-m4f0_0-fw -> /lib/firmware/pdk-ipc/ipc_echo_baremetal_test_mcu3_0_release_strip.xer5f
2.6.2. Booting Remote Cores from the Linux Console or User Space¶
To reload a remote core with new executables, please follow the below steps.
First, identify the remotproc node associated with the remote core:
# head /sys/class/remoteproc/remoteproc*/name
Then, use the sysfs interface to stop the remote core. For example, to stop the core at remoteproc1:
# echo stop > /sys/class/remoteproc/remoteproc1/state
If needed, update the symbolic link in the /lib/firmware/
folder to
point to a new firmware:
# ln -sf /full/path/to/firmware_name symbolic_link_name
Finally, use the sysfs interface to start the remote core:
# echo start > /sys/class/remoteproc/remoteproc1/state
Note
The RemoteProc driver does not support a graceful shutdown of R5 and M4 cores in the current Linux Processor SDK. For now, it is recommended to reboot the board to load new binaries into an R5F or M4F core.
The full process on AM64x looks like this:
root@am64xx-evm:~# head /sys/class/remoteproc/remoteproc*/name
==> /sys/class/remoteproc/remoteproc0/name <==
5000000.m4fss
==> /sys/class/remoteproc/remoteproc1/name <==
78000000.r5f
==> /sys/class/remoteproc/remoteproc2/name <==
78200000.r5f
==> /sys/class/remoteproc/remoteproc3/name <==
78400000.r5f
==> /sys/class/remoteproc/remoteproc4/name <==
78600000.r5f
Let’s use the sysfs interface to load an IPC example onto R5F cluster0-Core0:
root@am64xx-evm:~# echo stop > /sys/class/remoteproc/remoteproc1/state
[ 778.963928] remoteproc remoteproc1: stopped remote processor 78000000.r5f
root@am64xx-evm:~# cd /lib/firmware
root@am64xx-evm:~# ln -sf /lib/firmware/pdk-ipc/ipc_echo_baremetal_test_mcu1_0_release_strip.xer5f am64-main-r5f0_0-fw
Since graceful shutdown of remote cores is not currently supported, reboot the board in order to load new binaries onto the remote core. Once graceful shutdown is supported, the sysfs interface can be used to re-start the remote core instead of rebooting the entire board:
root@am64xx-evm:~# echo start > /sys/class/remoteproc/remoteproc1/state
[ 1141.491165] remoteproc remoteproc1: powering up 78000000.r5f
[ 1141.497109] remoteproc remoteproc1: Booting fw image am64-main-r5f0_0-fw, size 86352
[ 1141.507920] remoteproc1#vdev0buffer: assigned reserved memory node r5f-dma-memory@a0000000
[ 1141.518539] virtio_rpmsg_bus virtio1: rpmsg host is online
[ 1141.525859] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0xe
[ 1141.536806] remoteproc1#vdev0buffer: registered virtio1 (type 7)
[ 1141.544195] remoteproc remoteproc1: remote processor 78000000.r5f is now up