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

Note

The wakeup R5F core (or DM R5F) is different. That core runs device manager (DM) software which is critical for the rest of the processor to function. Thus, the DM R5F core is not initialized by Linux. Instead, the DM R5F is integrated as a part of the tispl.bin binary, and is started earlier in the boot process.

Note

This document is written as if the Linux Linux RemoteProc driver is the one to initialize the remote cores. However, in some AM62Ax SDK releases, the remote cores are initialized by default during u-boot, before the Linux remoteproc driver runs. This changes how Remoteproc interacts with the remote cores. This usecase is discussed more below.

By default, the Linux RemoteProc looks for these files. Note that the “RemoteProc Name” for each core includes the base address for the core in the processor memory map:

Core Name

RemoteProc Name

Description

Firmware File Name

C7x

7e000000.c7x

C7x core

am62a-c71_0-fw

R5F

79000000.r5f

R5F core(MCU domain)

am62a-mcu-r5f0_0-fw

DM R5F

78000000.r5f

R5F core (wakeup domain)

not loaded by Linux

The above files are generally soft linked to the intended firmware on a root file system. For example:

root@am62axx-evm:/opt/edgeai-gst-apps# ls -al /lib/firmware
...
lrwxrwxrwx 1 root root      62 Mar  9  2018 am62a-c71_0-fw -> /usr/lib/firmware/vision_apps_eaik/vx_app_rtos_linux_c7x_1.out
lrwxrwxrwx 1 root root      73 Mar  9  2018 am62a-mcu-r5f0_0-fw -> /usr/lib/firmware/ti-ipc/am62axx/ipc_echo_test_mcu2_0_release_strip.xer5f

What if the remote cores are initialized by U-Boot?#

In some AM62Ax SDK releases, the remote cores are initialized by default during U-Boot, before the Linux remoteproc driver runs. This changes how Linux RemoteProc interacts with the remote cores.

How to tell if the remote cores were initialized by U-Boot?#

You can tell if U-Boot initialized the remote cores by inspecting the boot log. First, U-Boot will report that it “loads a Remote Processor”. Then, the Linux remoteproc driver will report that it “attached” to a remote core that was already running, instead of “initializing” the remote core.

// U-Boot output
U-Boot SPL 2024.04-dirty (Aug 22 2024 - 18:40:45 -0500)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
...
U-Boot 2024.04-dirty (Aug 22 2024 - 18:45:24 -0500)

SoC:   AM62AX SR1.0 HS-FS
Model: Texas Instruments AM62A7 SK
DRAM:  2 GiB (effective 4 GiB)
Core:  87 devices, 30 uclasses, devicetree: separate
...
Loaded env from uEnv.txt
...
Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
Load Remote Processor 0 with data@addr=0x82000000 53172 bytes: Success!
Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
Load Remote Processor 2 with data@addr=0x82000000 11604048 bytes: Success!

// Linux "attaches" to the already-running remote cores
[    6.238364] k3-dsp-rproc 7e000000.dsp: assigned reserved memory node c7x-dma-memory@99800000
[    6.247561] k3-dsp-rproc 7e000000.dsp: configured DSP for IPC-only mode
[    6.261961] remoteproc remoteproc0: 7e000000.dsp is available
[    6.267830] remoteproc remoteproc0: attaching to 7e000000.dsp
[    6.314484] k3-dsp-rproc 7e000000.dsp: DSP initialized in IPC-only mode
[    6.370123] remoteproc remoteproc0: remote processor 7e000000.dsp is now attached

[    6.313745] platform 79000000.r5f: configured R5F for IPC-only mode
[    6.320417] platform 79000000.r5f: assigned reserved memory node r5f-dma-memory@9b800000
[    6.382571] remoteproc remoteproc1: 79000000.r5f is available
[    6.403353] remoteproc remoteproc1: attaching to 79000000.r5f
[    6.411201] platform 79000000.r5f: R5F core initialized in IPC-only mode
[    6.454335] remoteproc remoteproc1: remote processor 79000000.r5f is now attached

Why does it matter if U-Boot initializes the remote cores?#

If U-Boot initializes the remote cores instead of the Linux RemoteProc driver, then the Linux RemoteProc driver cannot gracefully shut down the remote cores. This means that the only way to load new firmware into the remote cores is to reboot the board. It also means that low power modes are not supported.

How to change the out-of-the-box behavior so that the remote cores are initialized by Linux instead?#

  1. Plug the SD card into the Linux development computer.

  2. Go to the Boot partition (not the filesystem partition).

  3. Open the file uEnv.txt.

  4. Modify the setting dorprocboot=1 to dorprocboot=0.

  5. Save and close uEnv.txt.

The rest of this page is written as if the remote cores have been initialized by Linux.

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

The association between a core and a specific remoteprocX number is not fixed. Cores are assigned remoteprocX numbers during Linux boot on a first-come basis, so the same core can be assigned different remoteprocX numbers on different boots. Please check the remoteprocX name before interacting with a core through the sysfs remoteproc interface.

Another option to see which remoteprocX is assigned to a core is to inspect the boot logs for “remoteproc” prints.

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.

Note that the DM R5F cannot be stopped during runtime. The processor must be rebooted in order to load new firmware into the DM R5F. For more information about loading new firmware into the DM R5F, refer to section Developing on the DM R5F.

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 AM62Ax looks like this:

root@am62axx-evm:~# head /sys/class/remoteproc/remoteproc*/name
==> /sys/class/remoteproc/remoteproc0/name <==
7e000000.dsp

==> /sys/class/remoteproc/remoteproc1/name <==
79000000.r5f

==> /sys/class/remoteproc/remoteproc2/name <==
78000000.r5f

Let’s load an IPC example onto the MCU domain R5F core. If the firmware already running on the MCU R5F has graceful shutdown enabled, then we can use the sysfs interface to restart the remote core:

root@am62axx-evm:~# echo stop > /sys/class/remoteproc/remoteproc1/state
[71534.397910] remoteproc remoteproc1: stopped remote processor 79000000.r5f

root@am62axx-evm:~# cd /lib/firmware/

root@am62axx-evm:/lib/firmware# ln -sf /usr/lib/firmware/ti-ipc/am62axx/ipc_echo_test_mcu2_0_release_strip.xer5f am62a-mcu-r5f0_0-fw

root@am62axx-evm:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc1/state
[71938.998133] remoteproc remoteproc1: powering up 79000000.r5f
[71939.004649] remoteproc remoteproc1: Booting fw image am62a-mcu-r5f0_0-fw, size 53556
[71939.015738] rproc-virtio rproc-virtio.6.auto: assigned reserved memory node r5f-dma-memory@9b800000
[71939.026187] virtio_rpmsg_bus virtio1: rpmsg host is online
[71939.031866] rproc-virtio rproc-virtio.6.auto: registered virtio1 (type 7)
[71939.038733] remoteproc remoteproc1: remote processor 79000000.r5f is now up
root@am62axx-evm:/lib/firmware# [71939.084595] virtio_rpmsg_bus virtio1: creating channel ti.ipc4.ping-pong addr 0xd
[71939.092350] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0xe