Skip to content

Mbv openamp support - #875

Merged
zeddii merged 5 commits into
devicetree-org:masterfrom
bentheredonethat:mbv-openamp-support
Nov 18, 2026
Merged

zeddii merged 5 commits into
devicetree-org:masterfrom
bentheredonethat:mbv-openamp-support

Conversation

@bentheredonethat

Copy link
Copy Markdown
Collaborator

Add support to build and validate MBV OpenAMP Linux DT and Config data for MBV OpenAMP/Libmetal ELFs

A MicroBlaze V remote in the PL cannot be described with OpenAMP or
libmetal relations today:

  - Mailbox references are searched only below /axi, but an AXI
    Mailbox interface is below /amba_pl. When the search fails, the
    lookup indexes an empty list and raises.
  - ELF-load and carveout references are searched only in reserved
    memory, /axi and, for TCM, the top level. The host side of a
    MicroBlaze V BRAM is a top-level memory node.
  - Every libmetal relation must name a timer. The RPU libmetal demo
    uses a PS TTC, but a MicroBlaze V remote may have none. One
    relation without a timer stops the expansion of its group before
    any mailbox is resolved.

Keep searching reserved memory and /axi first, and resolve any other
reference, such as a top-level memory node or a mailbox below
/amba_pl, with LopperTree.deref(). Report an unknown mailbox as an
error. Expand the timer of each relation that names one and skip the
others; the output that needs a timer still reports a missing one.

Add VEK385 MicroBlaze V domain inputs: a base description with Linux
and one bare-metal MicroBlaze V, an RPMsg overlay and a libmetal
overlay. The MicroBlaze V uses the RPU RPMsg and libmetal regions
that the EDF base device tree reserves at boot, declared with the same
names and labels as the meta-xilinx RPU overlays, so the generated PL
overlays apply to the stock EDF device tree. This needs a MicroBlaze V
DDR window that covers them, and the RPU and the MicroBlaze V must not
run at the same time. The MicroBlaze V domain takes id 3 and its
relations are named mbv0. The libmetal overlay describes how to add the
optional profiling timer.

Assisted-by: Codex:claude-opus-5.5
Signed-off-by: Ben Levinsky <[email protected]>
A MicroBlaze V in the PL runs its firmware from a dual-port BRAM that
Linux writes through an AXI BRAM controller, is held in reset by an AXI
GPIO, and is notified through an AXI Mailbox instead of a PS IPI.

Handle it in the existing remoteproc, RPMsg and libmetal parsers:

- xlnx_remoteproc_parse: a relation with a reset-controller builds the
  BRAM remoteproc (a simple-pm-bus for the controller window and a
  xlnx,zynqmp-bram-rproc core below it) instead of an RPU cluster.
  elfload may name the controller or the BRAM memory node at its
  address.
- xlnx_rpmsg_update_tree_linux: OPENAMP_LINUX_RPMSG_REGIONS gives the
  memory-region order and names by remoteproc compatible; the BRAM
  binding wants vring0, vring1, buffer with memory-region-names. RPU
  cores are not listed and keep the buffer-first order. An AXI Mailbox
  gets the PL Mailbox compatible of the SoC, from PL_MBOX_LINUX_COMPAT,
  and #mbox-cells.
- xlnx_rpmsg_parse: an AXI Mailbox relation needs a Linux host.
- xlnx_libmetal_linux_setup_ipi: an AXI Mailbox interface is the agent
  itself; Linux exports it through UIO.

RPU output is unchanged.

Assisted-by: Codex:claude-opus-5.5
Signed-off-by: Ben Levinsky <[email protected]>
The OpenAMP header and the libmetal .cmake output assume an IPI, and
the libmetal output a TTC, and both use system addresses. A MicroBlaze
V remote is notified through an AXI Mailbox, may have no timer, and
reaches DDR and its devices through the address map of its cluster.

Handle it in the existing generators:

- openamp_nontree_outputs_handler passes the remote's cluster, and
  requires a timer only for IPI relations.
- cpu_view_region() gives a node's region through the address map of a
  cluster, with parse_address_map(): from the entry that references the
  node, as for a PL device both the APU and the cluster reach, else
  from the entry whose range holds it, as for a DDR carveout. It is
  used for an AXI Mailbox remote only; the RPU outputs keep system
  addresses.
- xlnx_openamp_gen_outputs_only computes the shared-memory values once
  and writes the mailbox base with
  platform_info_header_axi_mailbox_template, or the IPI values with
  the RPU template. SHARED_MEM_SIZE is the buffer size for both.
- xlnx_libmetal_gen_output_file computes the shared-memory values and
  device names once, and writes the mailbox device, base and size with
  libmetal_cmake_axi_mailbox_template, or the IPI and TTC values with
  the existing template. When the AXI Mailbox relation names a timer,
  it adds the timer's device name, base and input clock, which the
  libmetal demo's optional latency profiling reads.
- linux_platform_device_name() gives the Linux platform device name,
  keeping the case of the node name. RPU names do not change.

RPU outputs are unchanged.

Assisted-by: Codex:claude-opus-5.5
Signed-off-by: Ben Levinsky <[email protected]>
baremetallinker_xlnx sizes the stack and heap from fixed defaults (0x400
and 0x800 on MicroBlaze processors, 0x2000 and 0x2000 on others, a 0x4000
heap in OpenAMP mode) and from the application's linker_constraints. A
system that needs other sizes for one processor, such as a MicroBlaze V
running OpenAMP or libmetal firmware, has to override them outside
Lopper, for example with --defsym in the application build.

Accept stack_size and heap_size in the linker mapping of a baremetal or
FreeRTOS domain, on any processor. YAML expansion stores them on the
domain as linker-stack-size and linker-heap-size; a mapping may hold only
sizes, which do not count as section placement. baremetallinker_xlnx
reads them from the domain that selects the CPU and lets them win over
the defaults and the application's linker_constraints. Without them the
output is unchanged.

Document the keys in the domains YAML specification.

Set a 0x4000 stack and heap in the VEK385 MicroBlaze V demo inputs,
which the OpenAMP and libmetal demos need.

Assisted-by: Codex:claude-opus-5.5
Signed-off-by: Ben Levinsky <[email protected]>
…a 0x4000 heap

OpenAMP and libmetal firmware allocates its RPMsg or libmetal buffers and
libc formatting from the heap. An RPU gets a 0x4000 heap because the
assist runs in OpenAMP mode for it, but a MicroBlaze V remote does not
use that mode: its firmware runs from BRAM, not from a DDR ELF-load
carveout. It gets the MicroBlaze default of 0x800, too small for the
OpenAMP and libmetal demos.

Default the heap to 0x4000 for a MicroBlaze V whose domain has an RPMsg
or libmetal relation. The application's linker_constraints and the
domain's heap_size still take precedence, and other processors are
unchanged.

Assisted-by: Codex:claude-opus-5.5
Signed-off-by: Ben Levinsky <[email protected]>
@zeddii
zeddii merged commit e08bc35 into devicetree-org:master Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants