dev-qemu: add sp-serial feature for the SP link#35
Conversation
Add an off-by-default `sp-serial` feature to dev-qemu that selects uart-service's MctpSerialMedium (DSP0253) instead of the default SmbusEspiMedium, for the two-QEMU SP <-> EC serial link. The default build keeps SmbusEspi so the ec-test-cli integration-test stays green; the harness builds --features sp-serial. This is F1.1 re-pinned onto the modernized EC: default_mctp_serial now resolves directly from upstream embedded-services main (6d7dbbf, the merged #906 ctor) with no fork [patch] override. Assisted-by: GitHub Copilot:claude-opus-4.8
There was a problem hiding this comment.
Pull request overview
Adds an off-by-default sp-serial feature to dev-qemu to select the UART service’s MCTP serial (DSP0253) medium at compile time, while keeping the default SMBus/eSPI framing for existing ec-test-cli integration flows.
Changes:
- Introduces a
sp-serialCargo feature fordev-qemu(default remains unchanged). - Refactors
dev-qemu’s UART service initialization to conditionally selectDefaultServicevsMctpSerialServiceviacfg(feature = "sp-serial").
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| platform/dev-qemu/src/main.rs | Adds compile-time selection for the uart-service type + constructor based on sp-serial. |
| platform/dev-qemu/Cargo.toml | Defines the off-by-default sp-serial feature and documents its intent. |
| fn new_uart_service(relay: MockOdpRelayHandler) -> EcUartService { | ||
| uart_service::DefaultService::default_smbusespi(relay).unwrap() | ||
| } |
| #[cfg(feature = "sp-serial")] | ||
| fn new_uart_service(relay: MockOdpRelayHandler) -> EcUartService { | ||
| uart_service::MctpSerialService::default_mctp_serial(relay).unwrap() | ||
| } |
There was a problem hiding this comment.
Not necessarily blocking, but I think I'd rather just see everything updated to using your new framing protocol. I don't see any real need to support the smbus framing if we just update the ec-test-cli/tui to use your new one, then we can just update all the platforms here to use default_mctp_serial.
Let me know if you are opposed to that and we can talk, but I think supporting the two framing protocols is unnecessary, better to just pick one.
What
Add an off-by-default
sp-serialfeature todev-qemuthat selects uart-service'sMctpSerialMedium(DSP0253 framing) instead of the defaultSmbusEspiMedium, for the two-QEMU SP ↔ EC serial link. Pure compile-time selector — both medium constructors already live inuart-service; dev-qemu holds no wire addressing.Why
The default build keeps
SmbusEspi(the framingec-test-clispeaks), so the single-QEMUintegration-teststays green. Thesp-serialfeature selects the serial medium the Secure Partition speaks over the two-QEMU link; the qemu-sbsa harness builds--features sp-serial.Context
Builds on #33 (EC modernized to
embedded-servicesmain):default_mctp_serialnow resolves directly from upstreamembedded-servicesmain — no fork[patch].Verification
--features sp-serial(DSP0253).fmt --check+clippyclean.odp-platform-qemu-sbsatest-sp-ec-link): the full UEFI ↔ FFA ↔ SP ↔ DSP0253-serial ↔ EC thermalGetTmpround-trip passes (ffa_version/ffa_id_get/partition_discovery/thermal_get_temperatureall green). Thesp-serialcode path is unchanged by the rebase onto merged main.Assisted-by: GitHub Copilot:claude-opus-4.8