Skip to content

aspeed: Add AST1040 Caliptra mailbox support

Steven Lee via qemu-arm qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/misc/aspeed_scu: Add AST1040 SCU modelhw/misc/aspeed_scu.c hw/misc/trace-events include/hw/misc/aspeed_scu.h+263 -00 replies
2/6hw/misc: Add ASPEED Caliptra mailbox frontendhw/misc/aspeed_cptra_mbox.c hw/misc/meson.build hw/misc/trace-events +1 more+518 -00 replies
3/6hw/misc: Add external Caliptra mailbox peerMAINTAINERS hw/misc/cptra_mbox_peer_extern.c hw/misc/meson.build+320 -00 replies
4/6hw/arm/aspeed_ast1040: Wire Caliptra mailboxhw/arm/aspeed_ast1040.c hw/arm/aspeed_ast1040_evb.c include/hw/arm/aspeed_soc.h+140 -50 replies
5/6tests/qtest: Add ASPEED Caliptra mailbox testtests/qtest/aspeed_cptra_mbox-test.c tests/qtest/meson.build+225 -10 replies
6/6docs/system/arm: Document AST1040 Caliptra mailboxdocs/system/arm/aspeed.rst+32 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/6] aspeed: Add AST1040 Caliptra mailbox support

This series adds AST1040 Caliptra MCI mailbox support for the ast1040-evb machine.

AST1040 firmware accesses Caliptra through an MCI page aperture. This series adds an AST1040 SCU model with the CPTRA page-select registers, a mailbox frontend that exposes the Caliptra SRAM and CSR windows, and an optional external chardev peer so a Caliptra simulator can service EXECUTE requests.

The SoC wiring maps the mailbox SRAM, CSR window and 4 KiB remap aperture. The EVB machine also gets a cptra-peer option for linking the external peer after the machine is initialized.

The external peer backend is intended for co-simulation with an external Caliptra model. The current bring-up backend used for manual testing is caliptra-server:

https://github.com/stevenlee7189/caliptra-server/blob/main-2.x/README.md

That README includes the server command line, the matching QEMU command line, and the guest-side MFWV smoke test sequence used to validate the MCI aperture, LOCK/CMD/DLEN/EXECUTE flow, and FirmwareVersion response. The qtest added by this series does not depend on that repository; it uses a socket-backed test peer to validate the QEMU-side protocol and mailbox flow.

Patch layout:
- patches 1-2 add the AST1040 SCU model and mailbox frontend
- patch 3 adds the external chardev peer backend
- patch 4 wires the mailbox into the AST1040 SoC and EVB machine
- patches 5-6 add qtest coverage and documentation

The qtest covers mailbox lock, execute and completion flow through a socket-backed peer, and verifies that SCU CPTRA_PAGE_REG0 remaps the MCI aperture between CSR and SRAM pages.

Validation:
- scripts/checkpatch.pl --branch origin/master..HEAD
- qtest coverage for the AST1040 mailbox execute path with a socket-backed external peer
- manual co-simulation bring-up with caliptra-server through cptra-mbox-peer-extern

Steven Lee (6):
hw/misc/aspeed_scu: Add AST1040 SCU model hw/misc: Add ASPEED Caliptra mailbox frontend hw/misc: Add external Caliptra mailbox peer hw/arm/aspeed_ast1040: Wire Caliptra mailbox tests/qtest: Add ASPEED Caliptra mailbox test docs/system/arm: Document AST1040 Caliptra mailbox

 MAINTAINERS                          |   1 +
 docs/system/arm/aspeed.rst           |  32 +++
 include/hw/arm/aspeed_soc.h          |  11 +
 include/hw/misc/aspeed_cptra_mbox.h  | 133 ++++++++++
 include/hw/misc/aspeed_scu.h         |  10 +
 hw/arm/aspeed_ast1040.c              |  60 ++++-
 hw/arm/aspeed_ast1040_evb.c          |  74 +++++-
 hw/misc/aspeed_cptra_mbox.c          | 380 +++++++++++++++++++++++++++
 hw/misc/aspeed_scu.c                 | 251 ++++++++++++++++++
 hw/misc/cptra_mbox_peer_extern.c     | 318 ++++++++++++++++++++++
 tests/qtest/aspeed_cptra_mbox-test.c | 223 ++++++++++++++++
 hw/misc/meson.build                  |   2 +
 hw/misc/trace-events                 |   6 +
 tests/qtest/meson.build              |   3 +-
 14 files changed, 1498 insertions(+), 6 deletions(-)
 create mode 100644 include/hw/misc/aspeed_cptra_mbox.h
 create mode 100644 hw/misc/aspeed_cptra_mbox.c
 create mode 100644 hw/misc/cptra_mbox_peer_extern.c
 create mode 100644 tests/qtest/aspeed_cptra_mbox-test.c
Signature · 1 line
2.43.0