New-Tech Europe | April 2016 | Digital edition

Figure 1. Symmetric multiprocessing. The SMP kernel can run simultaneously on multiple cores.

Figure 2. AMP with the Linux SMP kernel

kernel and the remote processor. The VDEV definition includes fields that negotiate the size of the queues as well as the interrupts used to signal between the processors. The Linux kernel handles initialization of the virtual I/O queues. The software running on a remote processor need only include a VDEV description in its resource table and then use the queues once it begins execution; the kernel handles the rest. Remote Processor Messaging Framework (rpmsg) Framework is a messaging “bus” based on the Linux kernel’s virtual I/O system. The messaging bus is similar to a local area subnetwork in which individual processors can create addressable endpoints and exchange messages, all via shared memory. The kernel’s rpmsg framework acts as a switch, routing messages to the appropriate endpoint based on the destination address contained in the message. Because the message header includes a source address, ad hoc connections can be established

kernel. The ability to dynamically control the number of cores used by the kernel is a primary reason AMP developers prefer the SMP kernel over the UP kernel. The Remote Processor Framework The Remote Processor (remoteproc) Framework is the Linux component that is responsible for starting and stopping individual cores (remote processors), as well as for loading a core's software in an AMP system. For example, we can dynamically reconfigure the SMP system shown in Figure 1 into the AMP system shown in Figure 2, and then back again to SMP, using the capabilities of remoteproc. We can fully control reconfiguration via a user-space application or system initialization script. This allows user applications to stop, reload and run a variety of RTOS applications based on the dynamic needs of the system. The core’s software (in our example, the RTOS and user application) is loaded from a standard Executable and Linkable Format (ELF) file that contains a special section known as the resource table. The resource table

is analogous to the PCI configuration space in that it describes the resources that the RTOS requires. Among those resources is the memory needed for the RTOS code and data. Trace buffers Trace buffers are regions of memory that automatically appear as files in a Linux file system. As their name suggests, trace buffers provide basic tracing capabilities to the remote processor. A remote processor writes trace, debug and status messages to the buffers, where the messages are available for inspection via the Linux command line or by custom applications. One or more trace buffers may be requested via entries in the resource table. Although they typically contain plain text, trace buffers may also contain binary data such as application state information or alarm indications. Virtual I/O devices The resource table also supports the definition virtual input/output devices (VDEVs), which are basically pairs of shared memory queues that support message transfer between the Linux

60 l New-Tech Magazine Europe

Made with