hw/arm: aspeed: PoC integration for Caliptra Root of Trust
Subsystems (2)
v2 cover hw/arm: aspeed: PoC integration for Caliptra Root of Trust
Hi,
This series is an RFC for modelling the Caliptra Root of Trust found in the ASPEED ast27x0 family.
ast27x0 integrates a Caliptra 1.2 core as an on-die RoT block. From the host side, the visible interface is a Caliptra APB register window rather than a standardized external command protocol. QEMU does not currently have a Caliptra emulator, and there is not yet an agreed upstream model for how ASPEED Caliptra support should be structured.
On the real ast27x0, Caliptra bring-up and secure-boot orchestration are handled by bootmcu rather than by the CA35 host CPUs. In particular, bootmcu is expected to own the mailbox-driven interaction with the Caliptra core during firmware loading and verification. At a high level:
- bootmcu releases the Caliptra core from reset
- bootmcu loads the Caliptra FMC/runtime firmware through the mailbox path
- Caliptra verifies the images and boots to runtime-ready
- bootmcu then relies on Caliptra services as part of the platform secure-boot flow before CA35 firmware starts
QEMU does not currently model bootmcu or that orchestration flow. Accordingly, this RFC does not attempt to model the final ast27x0 boot architecture. Instead, it uses the CA35-visible Caliptra MMIO/APB window as an initial integration point to validate the transport/backend split. A subsequent revision would wire this into the proper bootmcu-owned boot path.
Changes since RFC v1:
- reworked the PoC to remove the direct caliptra-sw C-binding dependency from the QEMU build.
- dropped the sibling-tree auto-detection of external headers and libraries.
- replaced the in-process Caliptra model with an external caliptra-server backend reached over a Unix socket.
- replaced the v1 worker-thread-based boot sequencing with a model where the backend is started independently and is already runtime-ready when QEMU connects.
- removed the use of vm_stop_force_state() to hold the CA35 until Caliptra boot completion.
- narrowed the QEMU-side PoC to the CA35-visible Caliptra MMIO/APB window on ast2700fc machine.
The patch in this RFC:
- adds an ASPEED-specific sysbus device for Caliptra emulation.
- exposes a 128 KiB MMIO window at 0x14c60000 on ast2700fc machine.
- forwards guest MMIO accesses to an external backend as APB read/write transactions over a Unix socket.
- assumes the backend is already running and ready before QEMU starts.
Current limitations of the PoC:
- no boot handshake between QEMU and the backend.
- synchronous socket round-trips on guest register access.
- no reset/migration/lifecycle integration.
- minimal wire protocol, designed to be replaced with a standardized IPC scheme.
- no modeling of bootmcu or the full secure-boot orchestration flow.
Testing:
# Terminal 1: start the external backend and wait for runtime-ready.
caliptra-server \
--socket /tmp/caliptra.sock \
--rom images/caliptra-rom.bin \
--firmware images/caliptra-fw.bundle# The server boots caliptra-sw independently, then prints that it is
# listening on the socket after boot_status reaches runtime-ready.
# Terminal 2: launch QEMU after the socket is ready.
qemu-system-aarch64 \
-M ast2700fc,caliptra-socket=/tmp/caliptra.sock \
... # In the guest, exercise the Caliptra MMIO window and confirm the # APB transactions are forwarded to caliptra-server.
#
# The sequence below drives the mailbox CSR block at 0x30020000
# through the AST2700fc window: # 0x00 LOCK - confirm the mailbox CSR block is reachable # 0x08 CMD - program the mailbox command opcode # 0x0c DLEN - declare the payload length # 0x10 DATAIN - provide the checksum word required by CAPS # 0x18 EXECUTE - doorbell to start command processing # 0x1c STATUS - read back the command result
md 0x14c60000 1 # Read LOCK to confirm the Caliptra mailbox CSR window is accessible.
mw 0x14c60008 0x43415053 # Write CMD = OP_CAPABILITIES ("CAPS").
mw 0x14c6000c 4 # Write DLEN = 4 bytes; CAPABILITIES carries only the checksum word.
mw 0x14c60010 0xFFFFFED9 # Write the checksum word expected by caliptra-sw for this CAPS request.
mw 0x14c60018 1 # Write EXECUTE = 1 to kick off mailbox command processing.
md 0x14c6001c 1 # Read STATUS to verify the command completed successfully.
The backend used for evaluation is currently based on the caliptra-1.2 branch of:
https://github.com/chipsalliance/caliptra-sw
The reference caliptra-server implementation used in this RFC is available at:
https://github.com/stevenlee7189/caliptra-server
The intent here is not to propose this PoC as merge-ready. The goal is to get feedback on whether this general direction makes sense for ASPEED.
In particular, feedback is welcome on the following:
- Is a socket-connected external backend an acceptable direction for supporting a Caliptra core on ASPEED platforms, or should we pursue an alternative approach such as an in-process model or a different IPC mechanism?
Other comments on the design are also welcome.
Thanks,
Steven Lee
Steven Lee (1):
hw/arm: aspeed: PoC integration for Caliptra Root of Trust
MAINTAINERS | 2 + docs/system/arm/aspeed.rst | 35 +++ include/hw/arm/aspeed_caliptra_emu.h | 29 +++ hw/arm/aspeed_ast27x0-fc.c | 55 +++++ hw/arm/aspeed_caliptra_emu.c | 338 +++++++++++++++++++++++++++ hw/arm/meson.build | 1 + 6 files changed, 460 insertions(+) create mode 100644 include/hw/arm/aspeed_caliptra_emu.h create mode 100644 hw/arm/aspeed_caliptra_emu.c
Signature · 1 line
2.43.0
RFC PATCH v2 1/1 hw/arm: aspeed: PoC integration for Caliptra Root of Trust
ast27x0 integrates a Caliptra Root of Trust core, but QEMU does not currently have an agreed model for ASPEED Caliptra emulation.
This patch adds an ASPEED-specific sysbus device that exposes the Caliptra mailbox/SOC-IFC MMIO window and forwards guest register accesses to an external caliptra-server backend over a Unix socket. This allows evaluation of the QEMU/Caliptra integration shape without pulling the upstream caliptra-sw hw-model into the QEMU build.
The reference caliptra-server implementation used in this RFC is available at:
https://github.com/stevenlee7189/caliptra-server
The device provides a 128 KiB MMIO window at 0x14c60000, matching the ast27x0 bootmcu Caliptra mailbox node, and maps it onto the backend APB register space.
https://github.com/AspeedTech-BMC/zephyr/blob/v00.03.07/dts/riscv/aspeed/ast27xx.dtsi#L310-L312
On the real ast27x0, Caliptra bring-up and secure-boot orchestration are handled by bootmcu; CA35 is not involved in that path. This patch uses the CA35-visible Caliptra MMIO window as an initial integration point to validate the socket-backed external backend approach, not to model the final boot architecture.
This is an RFC PoC only. It assumes the backend is already running, does not implement boot/reset handshaking or migration support, and uses a minimal wire protocol designed to be replaced with a standardized IPC scheme.
--- MAINTAINERS | 2 + docs/system/arm/aspeed.rst | 35 +++ include/hw/arm/aspeed_caliptra_emu.h | 29 +++ hw/arm/aspeed_ast27x0-fc.c | 55 +++++ hw/arm/aspeed_caliptra_emu.c | 338 +++++++++++++++++++++++++++ hw/arm/meson.build | 1 + 6 files changed, 460 insertions(+) create mode 100644 include/hw/arm/aspeed_caliptra_emu.h create mode 100644 hw/arm/aspeed_caliptra_emu.c
MAINTAINERS +2 -0
@@ -1263,6 +1263,8 @@ L: [email protected] S: Maintained F: hw/*/*aspeed* F: include/hw/*/*aspeed* +F: hw/arm/aspeed_caliptra_emu.c +F: include/hw/arm/aspeed_caliptra_emu.h F: hw/net/ftgmac100.c F: include/hw/net/ftgmac100.h F: docs/system/arm/aspeed.rst
docs/system/arm/aspeed.rst +35 -0
@@ -423,6 +423,41 @@ Steps to boot the AST2700fc machine: -snapshot \ -S -nographic +The ``ast2700fc`` machine can also forward CA35 accesses to the on-die +Caliptra Root-of-Trust core to an external Caliptra backend over a Unix +socket. The backend (``caliptra-server``) is launched independently with +the Caliptra ROM and firmware bundle, boots the Caliptra emulated model +to runtime-ready, then listens on a Unix socket. QEMU connects to that +socket from the device's ``realize()`` and forwards every CA35 read/write +in the Caliptra MMIO window as an APB transaction on the socket. + +The socket path is configured with the ``caliptra-socket`` machine +property. If the property is not set, no Caliptra backend is attached +and the Caliptra MMIO window is left unmapped. + +For example, to run Caliptra firmware from ``caliptra-sw``: + +.. code-block:: bash + + # Terminal 1: start caliptra-server with the ROM/firmware images. + # It boots the model to runtime-ready before opening the socket. + $ caliptra-server \ + --socket /tmp/caliptra.sock \ + --rom images/caliptra-rom-with-log.bin \ + --firmware images/caliptra-fw.bundle + + # Terminal 2: launch QEMU; the CA35 starts running immediately. + $ qemu-system-aarch64 \ + -M ast2700fc,caliptra-socket=/tmp/caliptra.sock \ + ... + +There is no boot handshake between QEMU and the backend: by the time the +device's ``realize()`` runs, ``caliptra-server`` is already at +runtime-ready, so the CA35 is not held in reset. The wire protocol +between QEMU and the backend is APB-level: ``APB_READ`` / ``APB_WRITE`` +requests from QEMU are answered by ``APB_RDATA`` / ``APB_WACK`` from the +backend. This protocol is RFC-stage and may change. + After launching QEMU, serial devices will be automatically redirected. Example output:
include/hw/arm/aspeed_caliptra_emu.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* ASPEED Caliptra emulator backend +* +* Copyright (C) 2026 ASPEED Technology Inc. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef ASPEED_CALIPTRA_EMU_H +#define ASPEED_CALIPTRA_EMU_H + +#define TYPE_ASPEED_CALIPTRA_EMU "aspeed-caliptra-emu" + +/* +* RFC/PoC integration hook only. +* +* This address is used by the current QEMU experiment to attach the +* external Caliptra backend to the AST2700fc machine. It must not be +* interpreted as the final functional interface used by real hardware: +* early Caliptra interaction is bootmcu-owned, and CA35 does not use +* this path for functional access to the Caliptra core. +* +* The 128 KiB region covers: +* +0x00000 mailbox CSR (caliptra APB 0x30020000) +* +0x10000 SOC IFC (caliptra APB 0x30030000) +*/ +#define ASPEED_CALIPTRA_MMIO_BASE 0x14c60000ULL + +#endif /* ASPEED_CALIPTRA_EMU_H */
hw/arm/aspeed_ast27x0-fc.c +55 -0
88 lines not on this page · raw message
hw/arm/aspeed_caliptra_emu.c new file +338 -0
338 lines not on this page · raw message
hw/arm/meson.build +1 -0
@@ -72,6 +72,7 @@ arm_common_ss.add(when: ['CONFIG_ASPEED_SOC', 'TARGET_AARCH64'], if_true: files( 'aspeed_ast1700.c', 'aspeed_ast27x0.c', 'aspeed_ast27x0_evb.c', + 'aspeed_caliptra_emu.c', 'aspeed_ast27x0-fc.c', 'aspeed_ast27x0-ssp.c', 'aspeed_ast27x0-tsp.c',
Signature · 1 line
2.43.0