feat: add Battery FFA service + MCTP-via-PL011 EC relay#73
Closed
dymk wants to merge 2 commits into
Closed
Conversation
Adds a new qemu-sp-uart workspace member: a minimal blocking PL011 MMIO driver for the SP-side ec_uart device-region (mapped at 0x60030000 in the SP DTS manifest). Public API: - Pl011Uart::new(base: u64) -> Self (unsafe, RawMmio backend) - Pl011Uart::from_mmio(mmio: M) -> Self (generic, for tests) - read_byte_blocking() -> Result<u8, Error> (busy-spin, no cap) - read_byte_with_iteration_cap(cap: u32) -> Result<u8, Error> - write_bytes(&[u8]) -> Result<(), Error> Includes 5 host-side unit tests using a mock Mmio backend.
…11 to EC)
Add the SP-side infrastructure for relaying FFA service requests to the
EC over MCTP/serial (PL011 UART), and implement the Battery service as
the first consumer.
New modules:
- ec_relay: generic relay that encodes service requests as MCTP
messages, sends over PL011 to EC, reads responses
- battery: Battery FFA service handler, routes GetBst through ec_relay
Also updates supply-chain exemptions for new git-sourced deps.
There was a problem hiding this comment.
Pull request overview
Adds initial building blocks for a QEMU SBSA secure-partition EC relay path by introducing a minimal PL011 UART driver crate and adding MCTP-based relay + Battery service plumbing in ec-service-lib, along with dependency/supply-chain updates.
Changes:
- Added new
qemu-sp-uartcrate providing a blocking, polled PL011 MMIO UART driver with host-side unit tests. - Added
ec-service-libEC relay infrastructure (ec_relay) and a Battery service that proxiesGetBstover MCTP serial framing. - Updated workspace dependencies (
mctp-rs, embedded-services crates), lockfiles, cargo-vet config/imports, and cargo-deny advisories ignore list.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| supply-chain/imports.lock | Updates imported cargo-vet audit entries to cover new/transitive dependencies. |
| supply-chain/config.toml | Updates cargo-vet exemptions for updated dependency graph. |
| qemu-sp-uart/src/lib.rs | New no_std PL011 UART driver with an MMIO abstraction and host tests. |
| qemu-sp-uart/README.md | Crate documentation describing API/usage and safety contract. |
| qemu-sp-uart/Cargo.toml | Adds the new UART crate to the workspace with no external deps. |
| ec-service-lib/src/services/mod.rs | Registers new battery and ec_relay service modules and exports. |
| ec-service-lib/src/services/ec_relay.rs | Introduces transport-agnostic ODP-over-MCTP relay and a UART-based serial transport. |
| ec-service-lib/src/services/battery.rs | Adds Battery proxy service using the relay and a host-only wire-format compatibility test. |
| ec-service-lib/Cargo.toml | Adds dependencies for MCTP serial + UART crate and host-only test deps for wire-format gating. |
| deny.toml | Ignores RUSTSEC-2024-0436 for paste (transitive via embedded-services). |
| Cargo.toml | Adds qemu-sp-uart workspace member and new git-based workspace dependencies. |
| Cargo.lock | Updates dependency resolution to include embedded-services/mctp-rs and related crate version bumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
Recreating from fork branch to allow force-push updates. |
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.
Summary
Adds a Battery FFA service to the QEMU SBSA secure partition, backed by a real EC connection over PL011 UART using MCTP serial (DSP0253) framing.
New crates
sp-mctp-framer— Lightweight MCTP serial framing layer on top ofmctp-rs. Handles DSP0253 byte-stuffing, CRC-16, and packet assembly/disassembly over a raw byte stream.qemu-sp-uart— Minimal PL011 MMIO UART driver for the secure partition (polled mode, no interrupts).Changes to existing crates
qemu-sp— Wires up the new Battery FFA handler + EC relay pipeline: FFA request → MCTP serialize → PL011 TX → PL011 RX → MCTP deserialize → FFA response.Architecture