Booting Remote Cores#

This section discusses booting remote cores from Linux, using the standard Linux SDK SPL boot flow.

If using the SBL boot flow that can be found in the MCU+ SDK, then remote cores can be initialized by the SBL boot instead.

Linux can boot remote cores during Linux boot, or during Linux runtime.

Reference section Development & debug through CCS for information about booting remote cores from CCS.

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, the Linux 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      43 Mar 12 19:39 am64-main-r5f0_0-fw -> /usr/lib/firmware/mcusdk-benchmark_demo/am64-main-r5f0_0-fw
lrwxrwxrwx 1 root root      59 Mar  7 11:24 am64-main-r5f0_1-fw -> /usr/lib/firmware/mcusdk-benchmark_demo/am64-main-r5f0_1-fw
lrwxrwxrwx 1 root root      59 Mar  9  2018 am64-main-r5f1_0-fw -> /usr/lib/firmware/mcusdk-benchmark_demo/am64-main-r5f1_0-fw
lrwxrwxrwx 1 root root      59 Mar  9  2018 am64-main-r5f1_1-fw -> /usr/lib/firmware/mcusdk-benchmark_demo/am64-main-r5f1_1-fw
lrwxrwxrwx 1 root root      72 Mar  9  2018 am64-mcu-m4f0_0-fw -> /usr/lib/firmware/ti-ipc/am64xx/ipc_echo_test_mcu3_0_release_strip.xer5f

Booting Remote Cores from the Linux Console or User Space#

Note

Graceful shutdown of AM64x R5F cores is broken on the Linux SDK 10.0 release. Graceful shutdown was supported on the previous SDK 9.2.1 release, and it is supported again starting on the upcoming SDK 10.1 release. Users on SDK 10.0, please reboot the AM64x in order to load new firmware into the R5F cores.

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

Note

The RemoteProc driver only supports using “echo stop” to shut down a remote core if graceful shutdown has been enabled in the remote core firmware. The other option to load new binaries into a remote core is to update the symbolic link with the new firmware (if needed), and reboot the board. For more information about graceful shutdown, refer to section Graceful shutdown.

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

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 load an IPC example onto the R5F cluster0-Core0.

If the firmware already running on the R5F0-0 has graceful shutdown enabled, then we can use the sysfs interface to restart the remote core:

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 /usr/lib/firmware/ti-ipc/am64xx/ipc_echo_baremetal_test_mcu1_0_release_strip.xer5f am64-main-r5f0_0-fw

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