arch/arm/am67: Add rptun IPC with the Linux A53 (remoteproc/rpmsg) - #20183
Open
gemstonedevteam wants to merge 4 commits into
Open
gemstonedevteam wants to merge 4 commits into
gemstonedevteam wants to merge 4 commits into
Conversation
acassis
previously approved these changes
Sep 18, 2026
Connects the R5F to Linux remoteproc over the NAVSS mailbox. The mailbox ISR only drains the FIFO and acknowledges; OpenAMP delivery is deferred to HPWORK, because the rpmsg rx path takes mutexes and allocates. The resource table publishes two vdevs, rpmsg and virtio-net, leaving every vring address FW_RSC_ADDR_ANY: Linux allocates them from the R5F DMA pool and rejects fixed addresses outside it. Shared IPC memory is mapped Non-cacheable, since the R5F is not coherent with the A53 and cached mappings leave NuttX reading stale vring state. Also drops the duplicate arm_mpu.c from CHIP_CSRCS. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Ulaş Sertan Kemeç <sertan.usk@gmail.com>
J722S maps DDR above the first 2 GB at 0x8_8000_0000, out of reach of the 32-bit R5F, while a 64-bit Linux peer posts virtio buffers there. Dedicates RAT region 0 as a 16 MB window at 0xFE000000. am67_rat_map() re-aims it and returns a pointer plus the bytes left before the edge, so callers can split copies that straddle it. The window is Non-cacheable, since it retargets at runtime and cached lines would alias across physical blocks. A mapping is valid only until the next call; the sole user, vhost-net, is serialised on the netdev work thread. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Ulaş Sertan Kemeç <sertan.usk@gmail.com>
Record the rptun/rpmsg link to the Linux A53 in the board's Peripheral Support list. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Ulaş Sertan Kemeç <sertan.usk@gmail.com>
The mailbox handler drained the FIFO without checking the message body. That caused shutdown messages to be lost, hence being unable to start/stop the R5 cores from the Linux side. The additions allow checking messages for control and virtqueue types. Shutdown messages fall to the control branch, which ACKs the shutdown request and parks the core in WFI. Virtqueues still work as intended; the only difference is that control messages are now handled correctly. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Ulaş Sertan Kemeç <sertan.usk@gmail.com>
gemstonedevteam
force-pushed
the
am67-pr-08
branch
from
September 19, 2026 06:39
efff976 to
2e0c3c5
Compare
Contributor
|
@gemstonedevteam please rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four commits: the
drivers/rptunresource-table sizing change, the AM67 rptunlowerhalf, the RAT sliding window, an nxstyle fix to a file this PR touches, and
documentation.
Summary
mailbox0_cluster3(R5F TX on FIFO 0 → Linux GIC SPI 109; Linux TX onFIFO 1 → VIM IRQ 116).
OpenAMP delivery is deferred to HPWORK, because the rpmsg rx stack takes
mutexes and allocates, neither of which is legal in interrupt context.
device addresses
FW_RSC_ADDR_ANY: Linux remoteproc allocates each vringfrom the R5F DMA pool and writes the chosen address back before releasing
the core; fixed addresses outside the pool are rejected.
drivers/rptun:rptun_do_start()installed the resource table with ahardcoded
sizeof(struct rptun_rsc_s), truncating extended tables thatcarry more than the single rpmsg vdev. An optional
get_rsc_size()op isadded with an
RPTUN_GET_RSC_SIZEmacro that falls back to the old value,so drivers using the standard table are unaffected.
maps DDR beyond the first 2 GB at
0x8_8000_0000, outside the R5F'saddressable space, while Linux freely posts virtio buffers there. Region 0
is dedicated as a 16 MB window at
0xFE000000, re-aimed per access, withthe window range MPU-mapped Non-cacheable.
hardware-coherent with the A53; with cacheable mappings NuttX reads stale
DRIVER_OK/vring state and the handshake hangs.Impact
drivers/rptunchange is an optional op with afallback to the previous behaviour; existing rptun drivers are unaffected.
RPTUN_GET_RSC_SIZEfalls back tosizeof(struct rptun_rsc_s)when a driver does not implement it.drivers/rptunsizing change and the AM67lowerhalf are bundled deliberately: the lowerhalf's extended two-vdev table
is truncated without it, so neither is functional alone. This is not a
breaking change.
Testing
Testing logs before change: no IPC support on this arch.
The version string in the logs is from the tested build; the commits were
GPG-signed afterwards, which rewrites hashes. The code is unchanged.
Testing logs after change:
PR verification Self-Check