Skip to content

Add Allwinner A523 message box and XuanTie E906 remoteproc support

Tim Michals linux-arm-kernel linux-devicetree linux-remoteproc linux-sunxi lkml llvm oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 4 repliesIn review
  2. v27 patches 2 repliesSuperseded
  3. v17 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Message box: all four banks are clocked and out of reset (an unclocked bank drops writes). The FIFO is drained before its pending bit is cleared, and messages are delivered after the controller lock is dropped. A kick is done once the receiver's FIFO has room; a full FIFO is never written, and in poll mode the check and the write are under one lock. The shared reset is never asserted, as in
sun6i-msgbox: the other banks carry traffic between the other processors. allwinner,tx-done-irq selects the receiver bank's write interrupt instead of the 1 ms poll. OMAP's ti,mbox-send-noirq is the same kind of per-mailbox switch, in the other direction: it turns the TX interrupt off for the WkupM3.
- Remoteproc: one mailbox channel; the receive callback is deferred to an ordered workqueue; address translation covers only the two SRAM windows; debug reset and power domains added; all register regions, clocks and resets are required, the mailbox is optional. Carveouts and crash dump segments are registered in parse_fw(), and crash dumps contain both SRAMs and the carveouts.
- Bindings: fixed lists for reg, clocks, resets and interrupts; "schema" dropped from the subjects (Krzysztof). All four message box interrupts are required: every A523 has them. The DSP and CPUS message box bank addresses were swapped in v2 and are fixed. The SRAMs are named as in the T527 manual (sram-a3-0, sram-a3-1).
- KUnit patches moved after the drivers. Both suites redirect register access with static stubs to mocks, so they run on any architecture, UML included. Patches 6 and 7 only add tests and can be dropped or taken separately.
- Rebased on next-20261030.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7dt-bindings: mailbox: Add Allwinner A523 message boxDocumentation/devicetree/bindings/mailbox/allwinner,sun55i-a523-msgbox.yaml+146 -01 reply
2/7mailbox: sun55i: Add Allwinner A523 message box driverMAINTAINERS drivers/mailbox/Kconfig drivers/mailbox/Makefile +2 more+729 -01 reply
3/7dt-bindings: remoteproc: Add Allwinner A523 RISC-V remote processorDocumentation/devicetree/bindings/remoteproc/allwinner,sun55i-a523-rproc.yaml+146 -01 reply
4/7remoteproc: sunxi: Add Allwinner A523 XuanTie E906 driverMAINTAINERS drivers/remoteproc/Kconfig drivers/remoteproc/Makefile +2 more+999 -01 reply
5/7arm64: dts: allwinner: a523: Add message box and remoteproc nodesarch/arm64/boot/dts/allwinner/sun55i-a523.dtsi+47 -00 replies
6/7mailbox: sun55i: Add KUnit testsdrivers/mailbox/Kconfig drivers/mailbox/Makefile drivers/mailbox/sun55i_msgbox_kunit.c+1400 -00 replies
7/7remoteproc: sunxi: Add KUnit testsdrivers/remoteproc/Kconfig drivers/remoteproc/Makefile drivers/remoteproc/sunxi_rproc_kunit.c+1330 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/7] Add Allwinner A523 message box and XuanTie E906 remoteproc support

This series adds a driver for the message box of the Allwinner A523, A527 and T527 (sun55i) and a remoteproc driver for their T-Head XuanTie E906 RISC-V core, with bindings, DT nodes and KUnit tests.

v2: https://lore.kernel.org/linux-sunxi/[email protected]/

Changes in v3 (details in each patch):
- Message box: all four banks are clocked and out of reset (an unclocked bank drops writes). The FIFO is drained before its pending bit is cleared, and messages are delivered after the controller lock is dropped. A kick is done once the receiver's FIFO has room; a full FIFO is never written, and in poll mode the check and the write are under one lock. The shared reset is never asserted, as in
sun6i-msgbox: the other banks carry traffic between the other processors. allwinner,tx-done-irq selects the receiver bank's write interrupt instead of the 1 ms poll. OMAP's ti,mbox-send-noirq is the same kind of per-mailbox switch, in the other direction: it turns the TX interrupt off for the WkupM3.
- Remoteproc: one mailbox channel; the receive callback is deferred to an ordered workqueue; address translation covers only the two SRAM windows; debug reset and power domains added; all register regions, clocks and resets are required, the mailbox is optional. Carveouts and crash dump segments are registered in parse_fw(), and crash dumps contain both SRAMs and the carveouts.
- Bindings: fixed lists for reg, clocks, resets and interrupts; "schema" dropped from the subjects (Krzysztof). All four message box interrupts are required: every A523 has them. The DSP and CPUS message box bank addresses were swapped in v2 and are fixed. The SRAMs are named as in the T527 manual (sram-a3-0, sram-a3-1).
- KUnit patches moved after the drivers. Both suites redirect register access with static stubs to mocks, so they run on any architecture, UML included. Patches 6 and 7 only add tests and can be dropped or taken separately.
- Rebased on next-20261030.

Notes for review:
- The remap register (0x07010364, PRCM) is shared with the DSP: bit 1 shares the 512 KiB SRAM A3_2 with the E906's subsystem, bit 0 belongs to the DSP. The driver maps only this register and read-modify-writes bit 1, which is safe while no other Linux driver writes it. I can move it to a syscon or the R-CCU, or describe SRAM A3_2 through the sunxi SRAM driver (allwinner,sram), if preferred.
- memory-region index 0 is the virtio DMA pool, then dram and trace, as in the TI K3 and MediaTek SCP bindings.
- The optional crash interrupt is supported by the driver but not wired in any DT and not tested on hardware; the A523 has no dedicated line for it and the vendor BSP has none.
- System suspend is not supported: the E906 runs next to a Linux that stays up, so the driver has no PM callbacks.
- Merging: patches 1, 2 and 6 are for the mailbox tree, 3, 4 and 7 for remoteproc, and 5 for sunxi. Patch 5 needs the bindings in patches 1 and 3.

Testing on a Radxa Cubie A5E (A527), Linux 7.1 PREEMPT_RT and PREEMPT with the same driver and test files:
- KUnit: 37/37 message box, 26/26 remoteproc, built in and as modules. Under UML on x86_64 one message box test is skipped (it needs SMP or spinlock debugging).
- rpmsg ping (10000 messages, about 167 us round trip) and stress (100000 messages, 16 in flight, no loss), with vrings in DRAM and in SRAM, TX done by poll and by write interrupt, and message box unbind/bind with the remoteproc driver unbound. One interrupt per message.
- The same tests with PROVE_LOCKING and DEBUG_ATOMIC_SLEEP (and PROVE_RAW_LOCK_NESTING on PREEMPT): no lockdep or sleep-in-atomic report.
- On next-20261030: W=1 build of each patch with GCC and clang, built in and as modules, dt_binding_check and dtbs_check are clean; checkpatch --strict reports only "does MAINTAINERS need updating?" for the new files, which the entries added in patches 2 and 4 cover.

Tools: I used Claude Code (Anthropic) to help review the code against the v2 comments, write the KUnit tests, run the board tests and draft commit messages. I reviewed every change; all tests above ran on my board.

Thanks to Krzysztof Kozlowski, Chen-Yu Tsai and Rob Herring for reviewing v1 and v2.

Tim Michals (7):
dt-bindings: mailbox: Add Allwinner A523 message box
mailbox: sun55i: Add Allwinner A523 message box driver
dt-bindings: remoteproc: Add Allwinner A523 RISC-V remote processor
remoteproc: sunxi: Add Allwinner A523 XuanTie E906 driver
arm64: dts: allwinner: a523: Add message box and remoteproc nodes
mailbox: sun55i: Add KUnit tests
remoteproc: sunxi: Add KUnit tests

 .../mailbox/allwinner,sun55i-a523-msgbox.yaml |  146 ++
 .../allwinner,sun55i-a523-rproc.yaml          |  146 ++
 MAINTAINERS                                   |   15 +
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi |   47 +
 drivers/mailbox/Kconfig                       |   24 +
 drivers/mailbox/Makefile                      |    3 +
 drivers/mailbox/sun55i-msgbox.c               |  613 ++++++++
 drivers/mailbox/sun55i-msgbox.h               |   95 ++
 drivers/mailbox/sun55i_msgbox_kunit.c         | 1387 +++++++++++++++++
 drivers/remoteproc/Kconfig                    |   26 +
 drivers/remoteproc/Makefile                   |    2 +
 drivers/remoteproc/sunxi_rproc.c              |  855 ++++++++++
 drivers/remoteproc/sunxi_rproc.h              |  124 ++
 drivers/remoteproc/sunxi_rproc_kunit.c        | 1314 ++++++++++++++++
 14 files changed, 4797 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/allwinner,sun55i-a523-msgbox.yaml
 create mode 100644 Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-a523-rproc.yaml
 create mode 100644 drivers/mailbox/sun55i-msgbox.c
 create mode 100644 drivers/mailbox/sun55i-msgbox.h
 create mode 100644 drivers/mailbox/sun55i_msgbox_kunit.c
 create mode 100644 drivers/remoteproc/sunxi_rproc.c
 create mode 100644 drivers/remoteproc/sunxi_rproc.h
 create mode 100644 drivers/remoteproc/sunxi_rproc_kunit.c

base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c

Signature · 1 line
2.53.0