Skip to content

Switch all platforms to the MctpSerial uart-service#36

Merged
dymk merged 1 commit into
OpenDevicePartnership:mainfrom
dymk:dymk/unify-ec-platforms-serial
Jul 2, 2026
Merged

Switch all platforms to the MctpSerial uart-service#36
dymk merged 1 commit into
OpenDevicePartnership:mainfrom
dymk:dymk/unify-ec-platforms-serial

Conversation

@dymk

@dymk dymk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Every platform drove its uart-service through DefaultService::default_smbusespi (SMBus/eSPI framing). This switches all five — dev-imxrt, dev-mcxa, dev-mec, dev-npcx, dev-qemu — to MctpSerialService::default_mctp_serial, so the EC link speaks DSP0253 serial (MctpSerialMedium), the same framing the rest of the stack now uses, and retires the SMBus/eSPI path.

This is the EC step of unifying the EC link on DSP0253 serial:

  • odp-platform-commonec-test-lib/ec-test-cli → DSP0253 (OpenDevicePartnership/odp-platform-common#132, merged).
  • This PR — all EC platforms → default_mctp_serial, and bump the ec-test-cli pin to that merge.
  • Next — embedded-services: retire the now-unused uart_service::default_smbusespi.

What changed

  • platform/*/src/main.rs (all 5): uart_service::DefaultService::default_smbusespi(relay).unwrap()uart_service::MctpSerialService::default_mctp_serial(relay).expect("failed to init MctpSerial uart-service"), and the matching StaticCell type. The diff is identical across all five platforms.
  • .github/workflows/check.yml: EC_TEST_CLI_REV2034778 (the merged DSP0253 ec-test-cli), so the dev-qemu integration-test job exercises the unified wire format end to end.

Testing

  • cargo build --locked --release, cargo clippy --locked -- -D warnings, and cargo fmt --check pass for all five platforms.
  • Integration test: scripts/integration-test.sh (builds dev-qemu and drives it with the bumped ec-test-cli) passes — all thermal/battery/RTC commands round-trip over DSP0253, including the multi-packet battery get-bix response.

Note

dev-mec is switched here for consistency (and so it doesn't break when default_smbusespi is later removed), but note it is not currently part of the CI matrix in check.yml — its build/lint are not exercised by CI.

Copilot AI review requested due to automatic review settings July 2, 2026 19:45
@dymk dymk requested a review from a team as a code owner July 2, 2026 19:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates all embedded controller platforms to drive uart-service using DSP0253 serial framing by switching from uart_service::DefaultService::default_smbusespi to uart_service::MctpSerialService::default_mctp_serial, aligning the EC link with the rest of the stack’s MCTP serial medium. It also bumps the pinned ec-test-cli revision used by the dev-qemu integration test workflow so CI exercises the new framing end-to-end.

Changes:

  • Switch uart-service initialization across all five platforms to MctpSerialService::default_mctp_serial(...) and update the corresponding StaticCell type.
  • Replace unwrap() with a descriptive expect(...) on uart-service initialization failure paths.
  • Update the GitHub Actions integration-test workflow to use a newer pinned ec-test-cli revision.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
platform/dev-qemu/src/main.rs Switch QEMU platform uart-service initialization to MctpSerialService::default_mctp_serial.
platform/dev-npcx/src/main.rs Switch NPCX platform uart-service initialization to MctpSerialService::default_mctp_serial.
platform/dev-mec/src/main.rs Switch MEC platform uart-service initialization to MctpSerialService::default_mctp_serial.
platform/dev-mcxa/src/main.rs Switch MCXA platform uart-service initialization to MctpSerialService::default_mctp_serial.
platform/dev-imxrt/src/main.rs Switch i.MXRT platform uart-service initialization to MctpSerialService::default_mctp_serial.
.github/workflows/check.yml Update the pinned ec-test-cli revision used by the dev-qemu integration-test job.

Comment thread .github/workflows/check.yml Outdated
Every platform drove its uart-service through
`DefaultService::default_smbusespi` (SMBus/eSPI framing). Switch all
five to `MctpSerialService::default_mctp_serial` so the EC link speaks
DSP0253 serial (`MctpSerialMedium`) — the same framing the rest of the
stack now uses — and retire the SMBus/eSPI path.

`ec-test-cli` was updated to speak DSP0253 in odp-platform-common; bump
`EC_TEST_CLI_REV` to that revision so the dev-qemu integration test
exercises the unified wire format end to end.

Assisted-by: GitHub Copilot:claude-opus-4.8
@dymk dymk force-pushed the dymk/unify-ec-platforms-serial branch from a2941cd to d1ec9f0 Compare July 2, 2026 19:59
@dymk dymk merged commit ed17dde into OpenDevicePartnership:main Jul 2, 2026
40 checks passed
dymk added a commit to OpenDevicePartnership/embedded-services that referenced this pull request Jul 6, 2026
Final step of the DSP0253 serial-framing unification: the SMBus/eSPI
uart-service convenience path has no remaining callers, so this removes
it.

## Context
This completes the cascade that moved the EC ↔ SP UART relay off the
hand-rolled SMBus/eSPI framing and onto DSP0253 serial
(`MctpSerialMedium`):
- OpenDevicePartnership/odp-platform-common#132 — `ec-test-lib` →
DSP0253
- OpenDevicePartnership/odp-embedded-controller#36 — all 5 EC platforms
→ `default_mctp_serial`
- #906 — added the `default_mctp_serial` constructor

With every consumer now on `MctpSerialService::default_mctp_serial`,
`default_smbusespi` and the `DefaultService` alias are dead code.

## Change
`uart-service/src/lib.rs` only:
- Remove the `DefaultService<R>` alias and its `default_smbusespi`
constructor.
- Drop the now-unused `SmbusEspiMedium` / `SmbusEspiReplyContext`
imports.
- Update the module doc to point at `MctpSerialService`.

`SmbusEspiMedium` itself is untouched — it stays in `mctp-rs` and
remains in use by `espi-service` and the relay layer. Only the
uart-service convenience wrapper is retired; the generic `Service<R, M>`
can still be built with any medium via `Service::new`.

## Verification
- `cargo build` / `cargo clippy --all-targets` — clean
- `cargo test` — 245 passed / 5 ignored
- `cargo deny check advisories` + `cargo vet` — pass
- Confirmed zero remaining `default_smbusespi` / `DefaultService`
references (incl. examples)

Assisted-by: GitHub Copilot:claude-opus-4.8
dymk added a commit to dymk/odp-platform-qemu-sbsa that referenced this pull request Jul 7, 2026
Point mod/ec at the upstream EC that builds every platform on
MctpSerialMedium unconditionally
(OpenDevicePartnership/odp-embedded-controller#36), so the harness builds
dev-qemu with the SP DSP0253 serial framing by default -- no sp-serial
feature flag needed. Restore the mod/ec .gitmodules url to
OpenDevicePartnership now that the EC change is upstream, so the
check-submodules guard passes.

Assisted-by: GitHub Copilot:claude-opus-4.8
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.

4 participants