mbox series

[v2,0/3] Add MediaTek APU Mailbox Support For MT8196

Message ID 20241230034446.1195728-1-karl.li@mediatek.com (mailing list archive)
Headers show
Series Add MediaTek APU Mailbox Support For MT8196 | expand

Message

Karl.Li Dec. 30, 2024, 3:43 a.m. UTC
From: Karl Li <karl.li@mediatek.com>

Based on tag: next-20241220, linux-next/master

Hello,

This patch series introduces support for the MediaTek APU (AI Processing Unit) mailbox, a crucial component for facilitating communication between the APU and other system processors within MediaTek platforms. The APU subsystem relies on a message-passing mechanism built atop the mailbox infrastructure, necessitating enhancements to the existing mailbox framework to accommodate the APU's communication requirements.

The series begins by adding the necessary device tree bindings for the APU mailbox, followed by an enhancement to the mailbox framework allowing for bottom-half processing of received data. This is particularly important for the APU's operation, as it relies on a combination of mailbox messages and shared memory for data exchange. Finally, we introduce the MediaTek APU mailbox driver itself, which implements the communication protocol and exposes additional hardware features for broader system integration.

Patch Summary:
1. dt-bindings: mailbox: mediatek: Add apu-mailbox document
   - Introduces the device tree bindings necessary for describing the APU mailbox in device tree sources, enabling the kernel to correctly configure and utilize this component.

2. mailbox: add support for bottom half received data
   - Enhances the mailbox framework to support sleepable contexts in the processing of received messages. This is critical for APU communication, where message handling may require operations that cannot be performed in atomic contexts.

3. mailbox: mediatek: Add mtk-apu-mailbox driver
   - Adds the driver for the MediaTek APU mailbox, facilitating communication with the APU microprocessor and providing interfaces for other system components to interact with the APU through spare registers.

This work is a step towards fully integrating MediaTek's APU capabilities with the Linux kernel, enhancing support for AI features on MediaTek platforms.

Please review and provide feedback.

Best regards

---

Changes in v2
- [1/3]
	- Add APU description in commit message and dt-bindings description.
	- Remove mt8188 in dt-bindings to make this patch focus on mt8196.
	- Drop "apu_mailbox" label since no one reference to it.
	- Modify the rule of compatible property.
	- Add cells number to resolve dt_binding_check error.
- [2/3]
	- Add more description in commit message to describe why we need sleepable callback function.
- [3/3]
	- Use regmap provide spare register operation.
	- Remove global variable `g_mbox`.
	- Add `MTK_APU_MBOX` prefix for each macro define.
	- Only keep mt8196 compatible to make this patch focus on mt8196.
	- Rename mbox_controller to `mbox`.
	- Use mtk_apu_mbox_msg to define msgs in mtk_apu_mailbox.
	- Rename top-half and bottom-half function.
	- Change to pass mbox.chans to isr.
	- Move platform_get_irq before register controller.
	- Remove `remove` callback function.
	- Rename send_cnt to data_cnt, and using u8 instead of int.
	- Use platform data to support the available slots for different platforms.
	- Use memory copy to sync mailbox data.
	- Use outbox irq bits to indicate the received slots number.

---

Karl Li (3):
  dt-bindings: mailbox: mediatek: Add apu-mailbox dt-bindings
  mailbox: add support for bottom half received data
  mailbox: mediatek: Add mtk-apu-mailbox driver

 .../mailbox/mediatek,apu-mailbox.yaml         |  60 ++++++
 drivers/mailbox/Kconfig                       |   9 +
 drivers/mailbox/Makefile                      |   2 +
 drivers/mailbox/mailbox.c                     |  16 ++
 drivers/mailbox/mtk-apu-mailbox.c             | 202 ++++++++++++++++++
 include/linux/mailbox/mtk-apu-mailbox.h       |  15 ++
 include/linux/mailbox_client.h                |   2 +
 include/linux/mailbox_controller.h            |   1 +
 8 files changed, 307 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/mediatek,apu-mailbox.yaml
 create mode 100644 drivers/mailbox/mtk-apu-mailbox.c
 create mode 100644 include/linux/mailbox/mtk-apu-mailbox.h

Comments

Krzysztof Kozlowski Dec. 31, 2024, 8:24 a.m. UTC | #1
On Mon, Dec 30, 2024 at 11:43:34AM +0800, Karl.Li wrote:
> From: Karl Li <karl.li@mediatek.com>
> 
> Based on tag: next-20241220, linux-next/master
> 
> Hello,
> 
> This patch series introduces support for the MediaTek APU (AI Processing Unit) mailbox, a crucial component for facilitating communication between the APU and other system processors within MediaTek platforms. The APU subsystem relies on a message-passing mechanism built atop the mailbox infrastructure, necessitating enhancements to the existing mailbox framework to accommodate the APU's communication requirements.
> 


Wrap your patch descriptions.

https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597

Best regards,
Krzysztof