Leveraging OpenAMP in Embedded Mixed Critical Systems
The electronics industry has seen a dramatic rise in the use of multicore processing in recent years. Multicore designs in embedded systems are now becoming mainstream due to market demand for increased performance, lower power consumption, and optimized costs. CPUs with diverse capabilities are therefore being clustered together to optimally handle different tasks in a single System on Chip (SOC).
Essentially, there are two multicore system architectures – Asymmetric Multicore Processing (AMP) and Symmetric Multicore Processing (SMP). SMP provides an approach to multicore design in which all cores share the same memory, operating systems, and other resources. AMP, on the other hand, is an approach to multicore design in which cores operate independently and perform dedicated tasks.
An AMP system may be constructed from any combination of core architectures; all the cores may be identical or there may be a rich mixture of core types that includes conventional processing units as well as specialized cores, like digital signal processors (DSPs) for instance. Each core executes independently in an AMP architecture, with or without an operating system, and their operating system may be selected based on the required functionality.
Combinations of SMP and AMP yield good results in scenarios in which the main system runs on a few cores that use SMP and are helped by cores running AMP modes as software accelerators. It should be noted here that multicore applications can be implemented using a SMP-enabled operating system, but that approach does not allow for independent workloads to be executed on different cores and does not support utilization of heterogeneous cores.
In an AMP system, there is no unified operating system or scheduler managing all resources in the system. Hence, there is a need for a software framework which helps manage boot order, data exchange, and power consumption.
Thus, the Open AMP came into existence. OpenAMP manages boot order and communication between the cores that are running independently.
What is OpenAMP?
OpenAMP stands for Open Asymmetric Multi-Processing, an open-source software framework that provides software components for working with Asymmetric multiprocessing (AMP) systems. The framework is maintained by the OpenAMP project, which comprises of member companies, including, Xilinx, ARM, STMicroelectronics, Linaro, Texas Instruments, Wind River and Nordic Semiconductor.
The key components and capabilities provided by the OpenAMP Framework include:
- remoteproc – This component allows for the Life Cycle Management (LCM) of remote processors from software running on a master processor. The remoteproc API provided by the OpenAMP Framework complies with the remoteproc infrastructure that is present in upstream Linux 3.4.x kernel onward. It has the ability to load firmware and to start and stop remote processors.
- RPMsg – The RPMsg API facilitates Inter Processor Communications (IPC) between the independent software contexts running on heterogenous or homogeneous cores present in an AMP system. This API is compliant with the RPMsg bus infrastructure present in upstream Linux 3.4.x kernel onward.
The API enables applications to send and receive variable length binary message data, with the message format being defined by the application. It is well suited for exchanging asynchronous and event-based messages with remote processors.
In an OpenAMP system, a software that is booted first and is responsible for managing other CPU’s software is known as master. A remote is defined as the CPU/software managed by the master software. OpenAMP can work on cores running independently on different software environments Linux, RTOS, or bare metal.
Some of the configurations supported by OpenAMP are:
- Master – Linux, Remote – RTOS or Bare Metal
- Master – RTOS or Bare Metal, Remote – Linux
- Master – RTOS or Bare Metal, Remote – RTOS or Bare Metal, Remote
Figure 1: Bootup with remoteproc
OpenAMP in Action
The key advantage of OpenAMP lies in its application in mixed safety-critical systems. The main requirement for a safety-critical system is the isolation to separate different software components from each other. Today, several hardware-assisted separation capabilities are provided by various MPSOC manufacturers to isolate safe and non-safe domain. The separation is required for the processing blocks, memory blocks, peripherals, and system functions. The OpenAMP framework helps facilitate the implementation of fault-tolerant systems. The OpenAMP framework can enable an RTOS on the safety critical processor, which is the system master and manage the critical system operations, to control the lifecycle on the application processor. If there is a failure, the RTOS can simply reboot the system without impacting the operation of the rest of the system.
Let us take the example of a patient monitoring system (Figure 2), with a platform that compromises a cluster of ARM Cortex A5 as a Real-time Processing Unit (RPU) and ARM Cortex-A53 core as an Application Processing Unit (APU). The functional safety-certified software context RPU obtains the sensor data. The sensor data contains the patient vitals. The RPU main purpose is to monitor the patient vitals. The non-critical subsystem in the APU consists of the high-level operating system, which displays the data on an LCD and provides internet connectivity. The OpenAMP helps to isolate the critical from non-critical subsystems and communicate person vitals from RPU to APU using OpenAMP RPMsgs.
Figure 2: Example architecture diagram illustrating a mix-critical safety system
Hybrid Design Approach: Widening the OpenAMP Ecosystem
The current trend is to merge both hypervisor and OpenAMP framework to form a hybrid design. This helps solve problems related to mixed critical systems in various applications areas across automotive, medical, banking, and many others.
In modern automotive applications like Digital cockpit, there is a need to separate safety critical from the non-critical components. To address such a situation, a hybrid design (Figure 3) can be used where both the advantages of hypervisor and OpenAMP framework are combined into the architecture to create a zone of trust for communication where data exchange can happen safely between the remote and the master.
Figure 3: Hybrid design approach in a Digital Cockpit
The Road Ahead for the OpenAMP Ecosystem
The multi-core processor SoCs can deliver an enhanced level of unified peripheral and CPU clusters which enable engineers to lower BOM costs, reduce power consumption and accelerate design implementation. These designs are becoming increasingly common across verticals and will soon be mainstream.
With this increase in the adoption of multicore designs, we will also witness the rise in the broader usage of OpenAMP. OpenAMP has opened up several new avenues to reimagine mixed-safety critical applications and will continue to gain in importance as a solution for implementing mixed safety-critical systems in a robust and cost-effective manner.