fwmanager: Add device-table schema; declare a mock board in target/mock - #367
Merged
Conversation
chrysh
force-pushed
the
add-config
branch
2 times, most recently
from
July 24, 2026 18:05
836b01b to
f9b8233
Compare
Contributor
Author
|
@FerralCoder @rusty1968 @embediver @leongross Can you have a look at a possible target config for the attached downstream and upstream devices? |
fwmanager-api gains the schema for the per-board device table: DeviceConfig (name, reset line, boot timeout), CommitPolicy, and a const validate() so a bad table fails the build. All values are board config and live in the new target/mock/devices.rs — a mock board with one device per archetype (direct-flash SPI "bmc", PLDM "nic") whose declaration order is the boot order; hardware targets declare their own tables later. Kept out of config.rs, which belongs to the kernel. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com> Refs: #1
rusty1968
requested changes
Jul 27, 2026
FerralCoder
reviewed
Jul 27, 2026
FerralCoder
left a comment
Collaborator
There was a problem hiding this comment.
am I correct to assume this is just a starting point showing the concept, and that more config parameters are intended to be added in future commits?
HalBootControl is generic over its controller's ResetId, so a hardcoded u8 only fits controllers whose id type happens to be u8 — and reset may not even be line-addressed. Parameterize the table over the board's reset signal type so a mismatch fails to compile, and call the field reset_signal rather than reset_line. The mock board uses u8. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com> Refs: #1
Everything builds in one tree, so a new CommitPolicy variant should break the orchestrator's match instead of falling into a wildcard arm — and board tables construct DeviceConfig by literal, which #[non_exhaustive] would forbid. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com> Refs: #1
Liveness can be more than one timeout: a device may pass several boot checkpoints, and the signal may be polled or queried rather than device-pushed. Replace boot_timeout with an ordered checkpoint list, each pairing a BootSignal (boot-complete GPIO, heartbeat, MCTP ready, version query) with its own window: last checkpoint reached means booted, an expired window fails the boot. BootSignal is generic over the id its boot monitor reads a boot-complete line by, as DeviceConfig is over its reset signal. The mock nic exercises the multi-checkpoint path. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com> Refs: #1
Board tables run validate() at compile time, where a rejection is a build error nobody can assert on — a vacuous loop would pass every const check silently. Call it at runtime instead and prove each reject path fires: empty device name, empty checkpoint list, empty checkpoint name, zero window. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com> Refs: #1
rusty1968
approved these changes
Jul 28, 2026
Collaborator
4 tasks
4 tasks
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.
fwmanager-api gains the schema for the per-board device table: DeviceConfig (name, reset line, boot timeout), CommitPolicy, and a const validate() so a bad table fails the build. All values are board config and live in the new target/mock/devices.rs — a mock board with one device per archetype (direct-flash SPI "bmc", PLDM "nic") whose declaration order is the boot order; hardware targets declare their own tables later. Kept out of config.rs, which belongs to the kernel.
Part of 9elements#1 (the downstream device definitions; partitioning schemes and verification keys remain open there).