fwmanager: Add BootControl trait and HAL adapter - #355
Merged
Conversation
Closed
chrysh
marked this pull request as ready for review
July 17, 2026 10:23
Contributor
Author
|
@rusty1968 @leongross Can you have a look? |
chrysh
force-pushed
the
add-boot-reset-control_v2
branch
from
July 17, 2026 13:54
b6b55ae to
d55e95f
Compare
embediver
reviewed
Jul 20, 2026
Introduce the Boot Orchestrator's actuation capability: the BootControl trait (hold_in_reset / release) and HalBootControl, which binds one HAL ResetControl line to a managed device. Includes a host unit test verifying that holding a device in reset asserts exactly its configured line. Includes tests that release deasserts the device's configured line and that a controller error surfaces through BootControl unchanged. Extend the fake reset controller with opt-in failure injection to drive the error case. Closes: #2 Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christina Quast <christina.quast@9elements.com>
Co-authored-by: Marvin Gudel <marvin@gudel.org>
chrysh
force-pushed
the
add-boot-reset-control_v2
branch
from
July 21, 2026 12:04
e10f4c6 to
daa9aa7
Compare
Tighten BootControl::Error from Debug-only to `core::error::Error + system_control::Error` so the orchestrator gets Display and a source() cause chain instead of just the Debug dump, and so generic `BootControl` consumers can categorize failures via kind() without downcasting to a concrete error type. HAL reset controllers keep the existing Error/kind() pattern unchanged; the new BootError adapter supplies the core::error::Error machinery over any HAL error, so no per-implementation work is required. Cover the combined bound with a compile-time fence and tests for Display output, source(), dyn downcast, and kind() reached through a generic BootControl. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christina Quast <christina.quast@9elements.com>
embediver
reviewed
Jul 22, 2026
Split the HAL-backed adapter out of fwmanager-api so the api crate is a dependency-free leaf holding only the BootControl capability contract, matching the layout of #20. HalBootControl and the BootError wrapper move to the new fwmanager-hal-adapters crate, which depends on //hal/blocking and the api crate. Drop the system_control::Error bound from BootControl::Error, keeping core::error::Error only: requiring the HAL error trait in the api crate would keep the HAL dependency the split is meant to remove. BootError still exposes kind(), and the generic-consumer test now recovers the error category by downcasting the dyn core::error::Error instead of relying on the removed bound. Add impl From<E> for BootError<E> so implementations forwarding HAL calls can use ? instead of .map_err(BootError), and switch HalBootControl over to it. Add api-side tests proving the contract stays implementable with no HAL in sight, and cover the release error path in the adapter. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com>
chrysh
force-pushed
the
add-boot-reset-control_v2
branch
from
July 22, 2026 09:50
e190335 to
19942a9
Compare
leongross
approved these changes
Jul 23, 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.
Introduce the Boot Orchestrator's actuation capability: the BootControl trait (hold_in_reset / release) and HalBootControl, which binds one HAL ResetControl line to a managed device. Includes a host unit test verifying that holding a device in reset asserts exactly its configured line.
Includes tests that release deasserts the device's configured line and that a controller error surfaces through BootControl unchanged. Extend the fake reset controller with opt-in failure injection to drive the error case.
Closes: 9elements#2
Assisted-by: Claude:claude-opus-4-8