Modernize EC to embedded-services main#33
Open
dymk wants to merge 1 commit into
Open
Conversation
philgweber
previously approved these changes
Jun 26, 2026
tullom
reviewed
Jun 26, 2026
tullom
reviewed
Jun 26, 2026
tullom
previously approved these changes
Jun 26, 2026
tullom
left a comment
Contributor
There was a problem hiding this comment.
Two nit nb comments, otherwise looks good
kurtjd
requested changes
Jun 26, 2026
Bump the embedded-services git pin off the stale 62d4ea9 onto current
main (6d7dbbf, which carries the new default_mctp_serial constructor),
porting the shared mock to the new battery Registration model and the
new spawn_service! init-closure form.
platform-common/src/mock:
- battery.rs: rewrite to the fuel-gauge Registration model. The OEM
owns a Mutex<GlobalRawMutex, MockFuelGauge> and drives it directly;
the service is bs::Service::new(ArrayRegistration{..}). Replaces the
removed Device / MockBattery / execute_event API.
- thermal.rs: wrap the sensor and fan spawn_service! args in the new
|resources| Service::new(resources, InitParams{..}) closures.
- time_alarm.rs: switch to the positional tas::Service::new closure.
- mod.rs: update the relay-handler battery type argument.
Bump all five platform locks (dev-mec was at 5cc395f1) and add
crc / crc-catalog / embedded-mcu-hal 0.3.0 cargo-vet exemptions to the
four CI platforms (dev-mec has no supply-chain store). No per-platform
code changes: every platform consumes platform_common::mock only.
dev-qemu unifies embedded-mcu-hal on crates.io: time-alarm-service
(from embedded-services main), embassy-qemu-riscv, and dev-qemu's own
HID dep all use the crates.io 0.3.0 rather than mixing crates.io and
git sources of the identical crate, which collide on defmt's derive
symbols under LTO (surfaces only in the release build, not cargo check).
Unblocks dropping the F1.1 fork [patch] override.
Assisted-by: GitHub Copilot:claude-opus-4.8
aef5429 to
3563771
Compare
There was a problem hiding this comment.
Pull request overview
Updates the EC firmware to track the current embedded-services main and ports the shared dev-platform mocks in platform-common to newer upstream service initialization APIs (battery registration + spawn_service! init-closure form), while updating platform lockfiles and cargo-vet supply-chain exemptions accordingly.
Changes:
- Port
platform_common::mockbattery to the new fuel-gauge registration model (ArrayRegistration+ OEM-ownedMutex<GlobalRawMutex, MockFuelGauge>driving viaFuelGaugetrait). - Update thermal and time-alarm mock service initialization to the new
spawn_service!closure-based constructor pattern. - Bump
embedded-services(and related git deps) across platformCargo.lockfiles, plus add cargo-vet exemptions for new crates; switchdev-qemutoembedded-mcu-hal = "0.3.0".
Reviewed changes
Copilot reviewed 9 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| platform/platform-common/src/mock/battery.rs | Replace removed mock battery/device API usage with mutex-backed MockFuelGauge registration + update task driving the gauge directly. |
| platform/platform-common/src/mock/thermal.rs | Update spawn_service! calls to the new init-closure form for sensor + fan services. |
| platform/platform-common/src/mock/time_alarm.rs | Update spawn_service! call to the new init-closure form and new tas::Service::new(...) signature. |
| platform/platform-common/src/mock/mod.rs | Update relay handler macro instantiation to use the new BatteryService type alias. |
| platform/dev-qemu/Cargo.toml | Switch embedded-mcu-hal dependency to crates.io 0.3.0. |
| platform/dev-qemu/Cargo.lock | Update embedded-services pin to 6d7dbbf... and reflect updated dependency graph (including registry embedded-mcu-hal 0.3.0). |
| platform/dev-qemu/supply-chain/config.toml | Add cargo-vet exemptions for crc 3.4.0, crc-catalog 2.5.0, and embedded-mcu-hal 0.3.0. |
| platform/dev-npcx/Cargo.lock | Update embedded-services pin and dependency graph. |
| platform/dev-npcx/supply-chain/config.toml | Add cargo-vet exemptions for crc, crc-catalog, embedded-mcu-hal. |
| platform/dev-mec/Cargo.lock | Update embedded-services pin and dependency graph (non-CI platform noted in PR description). |
| platform/dev-mcxa/Cargo.lock | Update embedded-services pin and dependency graph. |
| platform/dev-mcxa/supply-chain/config.toml | Add cargo-vet exemptions for crc, crc-catalog, embedded-mcu-hal. |
| platform/dev-imxrt/Cargo.lock | Update embedded-services pin and dependency graph. |
| platform/dev-imxrt/supply-chain/config.toml | Add cargo-vet exemptions for crc, crc-catalog, embedded-mcu-hal. |
kurtjd
approved these changes
Jun 26, 2026
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.
What
Bump
odp-embedded-controlleroff the staleembedded-services@62d4ea9pin onto currentmain(6d7dbbf), porting the shared dev-platform mock to:Mutex<GlobalRawMutex, MockFuelGauge>and drives it directly via theFuelGaugetrait; the service isbs::Service::new(bs::ArrayRegistration { fuel_gauges: [..] }). Replaces the removedDevice/MockBattery/execute_eventAPI.spawn_service!init-closure form —|resources| Service::new(resources, InitParams{..})for the thermal sensor/fan services, and the positionaltas::Service::new(resources, clock, ..)for time-alarm.Why
The EC was 8 commits behind
embedded-servicesmain and could not consume new upstream features (e.g.uart_service::default_mctp_serial). This unblocks adopting the serial MCTP medium for the QEMU SP↔EC link.Scope
platform/platform-common/src/mock/{battery,thermal,time_alarm,mod}.rs. No per-platform code changes — every dev platform consumesplatform_common::mockonly.embedded-serviceslock bump on all 5 dev platforms; cargo-vet exemptions (crc 3.4.0,crc-catalog 2.5.0,embedded-mcu-hal 0.3.0) on the 4 CI platforms.time-alarm-service(from embedded-services main),embassy-qemu-riscv, and dev-qemu's own HID dep all resolveembedded-mcu-hal 0.3.0from crates.io — previously they mixed crates.io and git sources of the identical crate, which collided on defmt's derive symbols under LTO (surfaces only in the release build, notcargo check).Verification
dev-qemuintegration-test (exercises battery + thermal + time-alarmec-test-clicommands at runtime over SmbusEspi).odp-platform-qemu-sbsa): built this EC--features sp-serialand ran the full UEFI ↔ FFA ↔ SP ↔ DSP0253-serial ↔ EC path —ffa_version,ffa_id_get,partition_discovery, and the EC-originthermal_get_temperatureround-trip all PASS.Notes
dev-mecis not in the CI matrix and has nosupply-chain/store; it's lock-bumped (it consumes the sharedplatform-common) but gets no vet exemptions.MockFuelGaugevalues rather than the oldMockBatteryconstants — relevant to any test asserting specific battery readings.Assisted-by: GitHub Copilot:claude-opus-4.8