This article gives information about the Linux® mailbox framework. The mailbox framework is involved in interprocessor communication in heterogeneous multicore systems.
1. Framework purpose[edit | edit source]
The mailbox is used in interprocessor communication to exchange messages or signals between the host and the coprocessor cores. The mailbox framework is based on:
- A mailbox controller that is platform dependent:
- It is in charge of configuring and handling IRQ from the IPCC peripheral.
- It provides a generic API to the mailbox client.
- A mailbox client that is in charge of the message to send or receive.
A general presentation of the mailbox framework is available in the Linux mailbox documentation [1].
2. System overview[edit | edit source]
Information |
The stm32_m0_rproc driver is specifically designed for the Cortex®-M0+ for use with STM32MP25x lines |
2.1. Component description[edit | edit source]
- Mailbox controller
- The mailbox controller is the stm32_ipcc. It configures and controls the IPCC peripheral
- Mailbox client
- The user can define their own mailbox client.
- A mailbox client character device driver is provided as an example to demonstrate communication using a mailbox and shared memory ([2]).
- Another example is the RPMsg framework, which uses a mailbox for interprocessor communication. In this case, the mailbox client is the remoteproc driver that forwards services from/to the RPMsg framework.
- === API description ===
The APIs are described in the Mailbox client API [3]
3. Configuration[edit | edit source]
3.1. Kernel Configuration[edit | edit source]
The following kernel configurations can be enabled using the Linux Menuconfig tool: Menuconfig or how to configure kernel :
- Activate STM32 IPCC mailbox controller driver
Device drivers --->
-*- Mailbox Hardware Support --->
<*> STM32 IPCC Mailbox
- Activate MAILBOX CDEV mailbox client driver
Device drivers ---> -*- Mailbox Hardware Support ---> <*> mailbox client char device
3.2. Device tree configuration[edit | edit source]
Please refer to the IPCC device tree configuration.
4. How to use the framework[edit | edit source]
The Linux mailbox documentation [1] provides with a very simple example of use.
5. How to trace and debug the framework[edit | edit source]
5.1. How to trace[edit | edit source]
Dynamic debug traces can be added using the following commands:
echo -n 'file stm32-ipcc.c +p' > /sys/kernel/debug/dynamic_debug/control echo -n 'file mailbox.c +p' > /sys/kernel/debug/dynamic_debug/control
- stm32-ipcc driver: drivers/mailbox/stm32-ipcc.c
6. Source code location[edit | edit source]
- framework: drivers/mailbox/mailbox.c
- client interface: include/linux/mailbox_client.h
7. References[edit | edit source]