ARM Sunxi Platform Development
 help / color / mirror / Atom feed
* [PATCH 0/7] remoteproc/mailbox: add Allwinner A523/A527/T527 E907 RISC-V support
@ 2026-09-22  3:47 Tim Michals
  2026-09-22  3:47 ` [PATCH 1/7] dt-bindings: mailbox: add Allwinner sun55i msgbox schema Tim Michals
                   ` (8 more replies)
  0 siblings, 9 replies; 35+ messages in thread
From: Tim Michals @ 2026-09-22  3:47 UTC (permalink / raw)
  To: linux-sunxi; +Cc: wens, jernej.skrabec, samuel, Tim Michals

This patch series introduces mainline Linux support for the Alibaba T-Head
XuanTie E907 (RV32IMAFDC @ 200 MHz) RISC-V auxiliary co-processor and the
4-port hardware Message Box IP integrated into Allwinner A523, A527, and
T527 (sun55i) SoCs.

The series adds the standalone 4-port hardware Message Box driver with
KUnit tests, the XuanTie RemoteProc driver with da_to_va KUnit tests, the
associated Devicetree binding schemas, and DTS node enablement.

Background & Hardware Architecture
==================================
Allwinner sun55i SoCs integrate an octa-core ARM Cortex-A55 cluster
alongside an auxiliary XuanTie E907 RISC-V co-processor. The co-processor
boots from on-chip dedicated SRAM Space 0 (Host PA 0x07280000 / Core DA
0x3FFC0000, 256 KB), can access secondary switchable SRAM Space 1 (Host
PA 0x072C0000 / Core DA 0x40000000, 256 KB), and interacts with external
DDR DRAM across the SoC's internal AXI bus.

Inter-processor communication (IPC) is coordinated via a 4-port hardware
Message Box controller (CPUX_MSGBOX at 0x03003000). The mailbox acts as a
star crossbar connecting four processors on the silicon die:
  - Port 0: ARM Cortex-A55 host cluster
  - Port 1: Cadence Tensilica HiFi4 Audio DSP
  - Port 2: Power Management Unit (CPUS)
  - Port 3: XuanTie E907 RISC-V co-processor

The Cortex-A55 exposes 12 logical channels (4 per remote processor), where
Channels 8..11 route directly to the XuanTie E907.

Hardware Validation & Silicon Evidence
======================================
This driver series has been extensively validated on physical silicon using
the Radxa Cubie A5E development board (Allwinner A527 / T527) running
mainline Linux PREEMPT_RT:

1. In-Kernel KUnit Tests:
   - sun55i_msgbox_test: Register mapping, channel routing, and interrupt
     mask bit manipulation across all 4 ports.
   - sunxi_rproc_test: Comprehensive da_to_va address translation across
     SRAM Space 0 (Host PA & Core DA), SRAM Space 1, DDR DRAM carveouts,
     and trace memory regions.

2. Target Automated Test Suite:
   - testBasic.elf: Core reset de-assertion, SRAM boot, MISA CSR
     verification (0x40901125), and heartbeat logging via debugfs trace0.
   - testStringBinaryTrace0.elf: Sustained trace0 ring-buffer streaming,
     hardware single-precision FPU math (sine wave calculation), and
     packed binary telemetry parsing.
   - testCrash.elf: Machine-mode exception trap (mtvec) verification,
     capturing full register autopsy (mepc, mcause=0x2, 31 GPRs) upon
     intentional illegal instruction while the host remains stable.
   - testPingRpmsg.elf: Full Linux VirtIO RPMsg framework validation
     over dynamic DDR CMA buffers. Tested 1,000 round-trip ping-pong
     packets with 100% success rate, measuring ~175 us average RTT
     latency and 5.37 MB/s bandwidth at 512-byte VirtIO buffer size.

PREEMPT_RT Real-Time Compliance
===============================
When the E907 announces a new RPMsg channel via Name Service announcement,
the kernel's rpmsg_char/virtio_rpmsg_bus layers acquire sleeping mutexes
(device_register, blocking_notifier_call_chain). Calling these from
hard-IRQ context triggers "scheduling while atomic" warnings on PREEMPT_RT
kernels. In sunxi_rproc.c, the mailbox callback defers the VirtIO vring
interrupt handler via schedule_work(&priv->vq_work), ensuring 100% clean
operation on PREEMPT_RT kernels.

Design Decisions for Maintainer Review
======================================
1. Standalone drivers/mailbox/sun55i-msgbox.c vs sun6i-msgbox.c:
   The existing sun6i-msgbox.c driver is architected around a legacy
   2-core point-to-point mailbox with flat global registers. The sun55i
   hardware is a 4-processor crossbar where registers are banked per
   processor in independent 0x100-byte apertures with hardware routing
   tables and 8-entry FIFOs. A clean standalone controller driver
   was implemented to avoid extensive conditional branches across every
   function.

2. Devicetree YAML Schemas:
   Both allwinner,sun55i-a523-msgbox.yaml and allwinner,sun55i-rproc.yaml
   have been created and pass dt_binding_check and checkpatch.pl cleanly.

Acknowledgements & References
=============================
Thanks to the Linux-sunxi community and YuzukiHD for SyterKit and
FreeRTOS-HIFI4-DSP as independent references to cross-check register
offsets, SRAM mappings, and clock/reset sequencing on the T527 and A733.


Tim Michals (7):
  dt-bindings: mailbox: add Allwinner sun55i msgbox schema
  mailbox: sun55i: add Allwinner sun55i/sun60i 4-port Message Box driver
  mailbox: sun55i: add KUnit tests for routing and registers
  dt-bindings: remoteproc: add allwinner sun55i rproc binding
  remoteproc: sunxi: add allwinner riscv remoteproc driver
  remoteproc: sunxi: add KUnit tests for da_to_va address translation
  arm64: dts: allwinner: add a523 msgbox and remoteproc nodes

 .../mailbox/allwinner,sun55i-a523-msgbox.yaml |  93 ++
 .../remoteproc/allwinner,sun55i-rproc.yaml    | 152 +++
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi |  39 +
 drivers/mailbox/Kconfig                       |  20 +
 drivers/mailbox/Makefile                      |   3 +
 drivers/mailbox/sun55i-msgbox.c               | 337 +++++++
 drivers/mailbox/sun55i_msgbox_test.c          | 296 ++++++
 drivers/remoteproc/Kconfig                    |  19 +
 drivers/remoteproc/Makefile                   |   2 +
 drivers/remoteproc/sunxi_rproc.c              | 905 ++++++++++++++++++
 drivers/remoteproc/sunxi_rproc_test.c         | 442 +++++++++
 11 files changed, 2308 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/allwinner,sun55i-a523-msgbox.yaml
 create mode 100644 Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
 create mode 100644 drivers/mailbox/sun55i-msgbox.c
 create mode 100644 drivers/mailbox/sun55i_msgbox_test.c
 create mode 100644 drivers/remoteproc/sunxi_rproc.c
 create mode 100644 drivers/remoteproc/sunxi_rproc_test.c

-- 
2.53.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-10-01  6:17 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-22  3:47 [PATCH 0/7] remoteproc/mailbox: add Allwinner A523/A527/T527 E907 RISC-V support Tim Michals
2026-09-22  3:47 ` [PATCH 1/7] dt-bindings: mailbox: add Allwinner sun55i msgbox schema Tim Michals
2026-09-22  3:54   ` sashiko-bot
2026-09-22  8:54   ` Krzysztof Kozlowski
2026-09-22  3:47 ` [PATCH 2/7] mailbox: sun55i: add Allwinner sun55i/sun60i 4-port Message Box driver Tim Michals
2026-09-22  4:00   ` sashiko-bot
2026-09-22  3:47 ` [PATCH 3/7] mailbox: sun55i: add KUnit tests for routing and registers Tim Michals
2026-09-22  3:54   ` sashiko-bot
2026-09-22  3:47 ` [PATCH 4/7] dt-bindings: remoteproc: add allwinner sun55i rproc binding Tim Michals
2026-09-22  3:56   ` sashiko-bot
2026-09-22  8:58   ` Krzysztof Kozlowski
2026-09-22 12:46   ` Rob Herring (Arm)
2026-09-22  3:47 ` [PATCH 5/7] remoteproc: sunxi: add allwinner riscv remoteproc driver Tim Michals
2026-09-22  3:59   ` sashiko-bot
2026-09-22  3:47 ` [PATCH 6/7] remoteproc: sunxi: add KUnit tests for da_to_va address translation Tim Michals
2026-09-22  3:54   ` sashiko-bot
2026-09-22  3:47 ` [PATCH 7/7] arm64: dts: allwinner: add a523 msgbox and remoteproc nodes Tim Michals
2026-09-22  3:59   ` sashiko-bot
2026-09-22  6:34 ` [PATCH 0/7] remoteproc/mailbox: add Allwinner A523/A527/T527 E907 RISC-V support Chen-Yu Tsai
2026-09-27  0:20 ` [PATCH v2 0/7] remoteproc: sunxi: Add Allwinner XuanTie E907 RemoteProc and Message Box support Tim Michals
2026-09-27  0:20   ` [PATCH v2 1/7] dt-bindings: mailbox: add Allwinner sun55i msgbox schema Tim Michals
2026-09-27  0:30     ` sashiko-bot
2026-10-01  6:16     ` Krzysztof Kozlowski
2026-09-27  0:20   ` [PATCH v2 2/7] mailbox: sun55i: add Allwinner sun55i/sun60i 4-port Message Box driver Tim Michals
2026-09-27  0:33     ` sashiko-bot
2026-09-27  0:20   ` [PATCH v2 3/7] mailbox: sun55i: add KUnit test suite for sun55i msgbox driver Tim Michals
2026-09-27  0:31     ` sashiko-bot
2026-09-27  0:20   ` [PATCH v2 4/7] dt-bindings: remoteproc: add Allwinner sun55i-rproc schema Tim Michals
2026-09-27  0:27     ` sashiko-bot
2026-10-01  6:17     ` Krzysztof Kozlowski
2026-09-27  0:20   ` [PATCH v2 5/7] remoteproc: sunxi: add Allwinner XuanTie RISC-V remoteproc driver Tim Michals
2026-09-27  0:33     ` sashiko-bot
2026-09-27  0:20   ` [PATCH v2 6/7] remoteproc: sunxi: add KUnit test suite for sunxi " Tim Michals
2026-09-27  0:32     ` sashiko-bot
2026-09-27  0:20   ` [PATCH v2 7/7] arm64: dts: allwinner: add a523 msgbox and remoteproc nodes Tim Michals

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox