RPMsg
Background
Modern SoCs usually employ heterogeneous processors in Asymmetric multiprocessing (AMP) configurations, each of which may be running a different instance of an Operating system. Typically, SoCs have a central multi-core processor running a high-level OS, such as Linux, in a Symmetric multiprocessing (SMP) configuration, and additional remote processors running various flavors of a Real-time operating system. These remote processors are often used to offload CPU-intensive tasks from the main application processor, or to access hardware blocks otherwise inaccessible by the central processor. RPMsg facilitates communication between the various processors in the system, by providing means of sending inter-processor messages back and forth.
Implementations
RPMsg is present in the Linux kernel,{{Cite web|title=Remote Processor Messaging (rpmsg) Framework — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/staging/rpmsg.html|access-date=2022-02-25|website=www.kernel.org}}{{Cite web|url=https://elixir.bootlin.com/linux/latest/source/Documentation/staging/rpmsg.rst|title=Linux/Documentation/staging/rpmsg.rst - Linux Cross Reference - Bootlin|website=lxr.bootlin.com|access-date=2019-09-04}} has been demonstrated in Zephyr (operating system),{{Cite web |last=Project |first=Zephyr |date=2019-02-20 |title=The Zephyr Project Demonstrates IoT Innovation at Embedded World |url=https://www.zephyrproject.org/the-zephyr-project-demonstrates-iot-innovation-at-embedded-world/ |access-date=2022-03-05 |website=Zephyr Project |language=en-US}}{{Citation |title=RPMsg Component |date=2022-02-16 |url=https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_zephyr.c |publisher=NXP Micro |access-date=2022-03-05}} FreeRTOS,{{Citation |title=RPMsg Component |date=2022-02-16 |url=https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_freertos.c |publisher=NXP Micro |access-date=2022-03-05}} Cadence XOS,{{Citation |title=RPMsg Component |date=2022-02-16 |url=https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_xos.c |publisher=NXP Micro |access-date=2022-03-05}} ThreadX,{{Citation |title=RPMsg Component |date=2022-02-16 |url=https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_threadx.c |publisher=NXP Micro |access-date=2022-03-05}} QNX{{Citation |title=RPMsg Component |date=2022-02-16 |url=https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_qnx.c |publisher=NXP Micro |access-date=2022-03-05}} and is also available as a stand-alone component for microcontroller-based systems.{{Cite web|url=https://nxpmicro.github.io/rpmsg-lite/|title=RPMsg-Lite User's Guide: RPMsg Component|website=nxpmicro.github.io|access-date=2016-09-27}}{{Cite web|url=https://github.com/NXPmicro/rpmsg-lite|title=NXPmicro/rpmsg-lite|website=GitHub|access-date=2016-09-27}} Most of the RPMsg implementations are developed as open-source.{{Cite web|url=http://www.wiki.xilinx.com/OpenAMP|title=Xilinx Wiki - OpenAMP|website=www.wiki.xilinx.com|access-date=2016-09-27}}
History
RPMsg was developed for the Linux kernel by Ohad Ben-Cohen of [https://wizery.com Wizery] {{Cite web|title=Introducing a generic AMP/IPC framework [LWN.net]|url=https://lwn.net/Articles/448562/|access-date=2022-02-24|website=lwn.net}}{{Cite web|title=LKML: Ohad Ben-Cohen: [GIT PULL] adding rpmsg and remoteproc to 3.3|url=https://lkml.org/lkml/2012/1/12/256|access-date=2022-02-24|website=lkml.org}}{{Cite web|title=LKML: Ohad Ben-Cohen: [PATCH 0/7] Introducing a generic AMP framework|url=https://lkml.org/lkml/2011/10/25/139|access-date=2022-02-24|website=lkml.org}}{{Cite web|title=A Generic AMP/IPC Framework For Linux|url=https://www.phoronix.com/scan.php?page=news_item&px=OTYwNw|access-date=2022-02-24|website=www.phoronix.com|language=en}}{{Cite web |title=kernel/git/torvalds/linux.git - Linux kernel source tree |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac8954a413930dae3c53f7e782f09a94e7eae88b |access-date=2022-07-03 |website=git.kernel.org}} and was merged to Linux 3.4 on 20 May 2012.{{Cite web |title=Linux_3.4 - Linux Kernel Newbies |url=https://kernelnewbies.org/Linux_3.4 |access-date=2022-07-03 |website=kernelnewbies.org}} It was first used by Google, in Android Ice Cream Sandwich, on the Galaxy Nexus phone, to enable offloading of cpu-intensive multimedia tasks on the OMAP4: from the ARM Cortex-A9 cores, running the Linux Kernel, to the ARM Cortex-M3 cores, running the TI-RTOS OS. Several semiconductor companies have since added support for RPMsg, including Texas Instruments,{{Cite web|title=3.6.2.3. RPMsg Quick Start Guide — Processor SDK Linux for AM65X Documentation|url=https://software-dl.ti.com/processor-sdk-linux/esd/AM65X/08_00_00_04/exports/docs/linux/Foundational_Components/PRU-ICSS/RPMsg_Quick_Start_Guide.html|access-date=2022-02-25|website=software-dl.ti.com}} STMicroelectronics,{{Cite web|title=Linux RPMsg framework overview - stm32mpu|url=https://wiki.st.com/stm32mpu/wiki/Linux_RPMsg_framework_overview|access-date=2022-02-25|website=wiki.st.com}} Xilinx,{{Cite book |last1=Aboelhassan |first1=Mustafa O. E. |last2=Bartik |first2=Ondrej |last3=Novak |first3=Marek |title=2017 7th IEEE International Conference on Control System, Computing and Engineering (ICCSCE) |chapter=Embedded multi-core systems for mixed-critical applications with RPMSG protocol based on xilinx ZYNQ-7000 |date=November 2017 |chapter-url=https://ieeexplore.ieee.org/document/8284398 |pages=162–167 |doi=10.1109/ICCSCE.2017.8284398|isbn=978-1-5386-3897-2 |s2cid=46746400 }} NXP Semiconductors, Renesas Electronics{{Cite web |title=Renesas RPMsg |url=https://www.renesas.com/us/en/document/apn/release-note-for-rzg2l-multi-os-package-v100}} and Nordic Semiconductor.{{Cite web |title=nRF5340: Multiprotocol RPMsg — nRF Connect SDK 1.9.99 documentation |url=https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf5340/multiprotocol_rpmsg/README.html |access-date=2022-03-05 |website=developer.nordicsemi.com}}
User-space access
RPMsg provides a basic framework for sending framed messages between heterogenous processors, but a higher level driver is required to expose RPMsg functionality to user space in a useful way. Some of these drivers are mainlined in the Linux kernel, others are provided in a SoC vendor's kernel fork, and yet others are available out of tree.
class="wikitable sortable"
|+ !Driver Name !Description !Kernel Fork !Official website |
imx_rpmsg_tty
|Exposes an RPMsg endpoint as a virtual TTY at |linux-imx |[https://github.com/nxp-imx/linux-imx/] |
rpmsg_char
|Exposes an RPMsg endpoint as a character device at |mainline |N/A |
rpmsg_ctrl
|Exposes a control interface at |mainline |N/A |
rpmsg-net
|Exposes an RPMsg endpoint as a virtual Ethernet network interface named |out of tree |[https://github.com/jtavares/rpmsg-net/tree/main] |
rpmsg-sysfs
|Exposes rpmsg bus control primitives to userspace via sysfs. |out of tree |[https://github.com/nxp-mcuxpresso/rpmsg-sysfs] |