Repository navigation
Conversation
Add a mock power policy so battery _PSR follows a mock wall adapter, plugged in and out by GPIO2 on dev-qemu. Bump QEMU to latest qemu-builder hash for GPIO2 and let qemu-ec.sh set it up for time-alarm-power-input builds. Assisted-by: GitHub Copilot:claude-opus-5.5
tullom
requested review from
RobertZ2011,
dymk,
maxperga-msft and
rogurr
and
a balanced review from Copilot
November 12, 2026 23:59
There was a problem hiding this comment.
🔵 Needs a closer look
End-to-end QEMU validation is needed for cold AC/DC starts and GPIO2 transitions through power policy to host-visible _PSR, which the default-build integration script does not query.
No open issues 🎉
What changed in this PR
This PR connects the shared mock battery service to a mock power policy so battery _PSR follows the wall-adapter state controlled by GPIO2 on dev-qemu.
Changes:
- Add a mock PSU and route power-policy notifications to the battery service.
- Connect GPIO2 AC/DC changes to both TimeAlarm and the mock adapter.
- Update the QEMU runner, pinned image, runtime dependencies, and documentation for power-input builds.
| File | Description |
|---|---|
platform/platform-common/src/mock/time_alarm.rs |
Update mock adapter attachment when the power input changes. |
platform/platform-common/src/mock/power_policy.rs |
Add the mock PSU, adapter control, and power-policy task. |
platform/platform-common/src/mock/mod.rs |
Initialize power policy and expose the PSU control handle. |
platform/platform-common/src/mock/battery.rs |
Process power-policy events through a shared battery service. |
platform/platform-common/Cargo.toml |
Add power-policy dependencies. |
platform/platform-common/Cargo.lock |
Lock the shared library’s power-policy dependencies. |
platform/dev-qemu/src/main.rs |
Pass PSU control to the GPIO2 monitoring task. |
platform/dev-qemu/README.md |
Document runtime power switching and QEMU requirements. |
platform/dev-qemu/qemu-ec.sh |
Configure GPIO2, update QEMU, and cache binaries per image tag. |
platform/dev-qemu/Cargo.lock |
Include power-policy dependencies for QEMU. |
platform/dev-qemu/build.rs |
Mark power-input binaries for runner detection. |
platform/dev-npcx/Cargo.lock |
Include the new shared power-policy dependencies. |
platform/dev-mec/Cargo.lock |
Include the new shared power-policy dependencies. |
platform/dev-mcxa/Cargo.lock |
Include the new shared power-policy dependencies. |
platform/dev-imxrt/Cargo.lock |
Include the new shared power-policy dependencies. |
.github/workflows/check.yml |
Update the QEMU image and install required runtime libraries. |
Review effort: Balanced
kurtjd
approved these changes
Nov 13, 2026
This branch has not been deployed
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.
Add a mock power policy so battery _PSR follows a mock wall adapter, plugged in and out by GPIO2 on dev-qemu. Bump QEMU to latest qemu-builder hash for GPIO2 and let qemu-ec.sh set it up for time-alarm-power-input builds.
Assisted-by: GitHub Copilot:claude-opus-5.5