RPMsg

From HandWiki

RPMsg (Remote Processor Messaging) is a protocol enabling inter-processor communication inside multi-core processors.

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,[1][2] has been demonstrated in Zephyr (operating system),[3][4] FreeRTOS,[5] Cadence XOS,[6] ThreadX,[7] QNX[8] and is also available as a stand-alone component for microcontroller-based systems.[9][10] Most of the RPMsg implementations are developed as open-source.[2][9][10][11]

History

RPMsg was developed for the Linux kernel by Ohad Ben-Cohen of Wizery [12][13][14][15][16] and was merged to Linux 3.4 on 20 May 2012.[17] 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,[18] STMicroelectronics,[19] Xilinx,[11][20] NXP Semiconductors,[10] Renesas Electronics[21] and Nordic Semiconductor.[22]

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.

Driver Name Description Kernel Fork Official website
imx_rpmsg_tty Exposes an RPMsg endpoint as a virtual TTY at /dev/ttyRPMSGx. Can be used wherever a serial-like connection is desirable. linux-imx [1]
rpmsg_char Exposes an RPMsg endpoint as a character device at/dev/rpmsgX, allowing a userspace applications to send and receive raw RPMsg packets via standard file I/O operations. mainline N/A
rpmsg_ctrl Exposes a control interface at /dev/rpmsg_ctrlX that allows RPMsg endpoints to be created by user-space applications. mainline N/A
rpmsg-net Exposes an RPMsg endpoint as a virtual Ethernet network interface named rpmsgX. Can be used to connect the two CPUs using at layer 2 and above. out of tree [2]
rpmsg-sysfs Exposes rpmsg bus control primitives to userspace via sysfs. out of tree [3]

References

  1. "Remote Processor Messaging (rpmsg) Framework — The Linux Kernel documentation". https://www.kernel.org/doc/html/latest/staging/rpmsg.html. 
  2. 2.0 2.1 "Linux/Documentation/staging/rpmsg.rst - Linux Cross Reference - Bootlin". https://elixir.bootlin.com/linux/latest/source/Documentation/staging/rpmsg.rst. 
  3. Project, Zephyr (2019-02-20). "The Zephyr Project Demonstrates IoT Innovation at Embedded World" (in en-US). https://www.zephyrproject.org/the-zephyr-project-demonstrates-iot-innovation-at-embedded-world/. 
  4. RPMsg Component, NXP Micro, 2022-02-16, https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_zephyr.c, retrieved 2022-03-05 
  5. RPMsg Component, NXP Micro, 2022-02-16, https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_freertos.c, retrieved 2022-03-05 
  6. RPMsg Component, NXP Micro, 2022-02-16, https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_xos.c, retrieved 2022-03-05 
  7. RPMsg Component, NXP Micro, 2022-02-16, https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_threadx.c, retrieved 2022-03-05 
  8. RPMsg Component, NXP Micro, 2022-02-16, https://github.com/NXPmicro/rpmsg-lite/blob/e3817b5e56e47fe6f18dd383146e77f5f2ee06fe/lib/rpmsg_lite/porting/environment/rpmsg_env_qnx.c, retrieved 2022-03-05 
  9. 9.0 9.1 "RPMsg-Lite User's Guide: RPMsg Component". https://nxpmicro.github.io/rpmsg-lite/. 
  10. 10.0 10.1 10.2 "NXPmicro/rpmsg-lite". https://github.com/NXPmicro/rpmsg-lite. 
  11. 11.0 11.1 "Xilinx Wiki - OpenAMP". http://www.wiki.xilinx.com/OpenAMP. 
  12. "Introducing a generic AMP/IPC framework [LWN.net"]. https://lwn.net/Articles/448562/. 
  13. "LKML: Ohad Ben-Cohen: [GIT PULL adding rpmsg and remoteproc to 3.3"]. https://lkml.org/lkml/2012/1/12/256. 
  14. "LKML: Ohad Ben-Cohen: [PATCH 0/7 Introducing a generic AMP framework"]. https://lkml.org/lkml/2011/10/25/139. 
  15. "A Generic AMP/IPC Framework For Linux" (in en). https://www.phoronix.com/scan.php?page=news_item&px=OTYwNw. 
  16. "kernel/git/torvalds/linux.git - Linux kernel source tree". https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac8954a413930dae3c53f7e782f09a94e7eae88b. 
  17. "Linux_3.4 - Linux Kernel Newbies". https://kernelnewbies.org/Linux_3.4. 
  18. "3.6.2.3. RPMsg Quick Start Guide — Processor SDK Linux for AM65X Documentation". 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. 
  19. "Linux RPMsg framework overview - stm32mpu". https://wiki.st.com/stm32mpu/wiki/Linux_RPMsg_framework_overview. 
  20. Aboelhassan, Mustafa O. E.; Bartik, Ondrej; Novak, Marek (November 2017). "Embedded multi-core systems for mixed-critical applications with RPMSG protocol based on xilinx ZYNQ-7000". 2017 7th IEEE International Conference on Control System, Computing and Engineering (ICCSCE). pp. 162–167. doi:10.1109/ICCSCE.2017.8284398. ISBN 978-1-5386-3897-2. https://ieeexplore.ieee.org/document/8284398. 
  21. "Renesas RPMsg". https://www.renesas.com/us/en/document/apn/release-note-for-rzg2l-multi-os-package-v100. 
  22. "nRF5340: Multiprotocol RPMsg — nRF Connect SDK 1.9.99 documentation". https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf5340/multiprotocol_rpmsg/README.html.