-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sw/opentitantool] Add otp alert-digest subcommand #15872
Conversation
I haven't hooked this up to serde-annotate yet. I made a small deserializer for OTP field values just to get this off the ground. I do ultimately intend to use lowRISC/serde-annotate#7 for these fields instead, thank you @cfrantz! Also note that the output will be in decimal unless JSON5 or YAML is specified as the output format. |
13fd74d
to
e40dab9
Compare
While trying to integrate this into the OTP bazel rules I found that having the digest value presented in stdout isn't ideal. Since the schema for |
dfa8fc2
to
a58706b
Compare
Outputting the The current state of this PR contains a workaround for a bug in serde-annotate to get hex serialization working, and this is now blocked on lowRISC/serde-annotate#10. |
// This attribute shouldn't be here, it should be in `OtpImgValue`, but due to a bug in | ||
// serde_annotate this is needed to get values serialized in hex. | ||
#[annotate(format = hex)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this? Asking because of the recent update to serde_annotate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've filed an issue for this, see cfrantz/serde-annotate#5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @jon-flatley! Just some minor comments.
@jon-flatley can you check CI logs? Also, it would be nice to modify this to print/update values for all lifecycle states at once. |
I don't expect this to pass CI until we update to the most recent version of serde-annotate #15951. I'll update this and #15890 to populate the OTP words for all lifecycle states. |
0c9af49
to
96c919c
Compare
Ah, sounds good, thanks! |
OTP support in opentitantool is moving away from end to end vmem generation. Instead, opentitantool will serve as a front end utility for generating some software values (such as for alert_handler configuration) and for providing an way to specifying OTP values using named constants. Signed-off-by: Jon Flatley <jflat@google.com>
Adds a new command, `opentitantool otp alert-crc`, for generating the magic value used to validate alert_handler register values during shutdown_init in ROM. Signed-off-by: Jon Flatley <jflat@google.com>
Signed-off-by: Jon Flatley <jflat@google.com>
96c919c
to
5d25613
Compare
Adds a new command/subcommand
opentitantool otp alert-digest <alert-cfg> <lc-state>
that takes an HJSON OTP image file that defines theOWNER_SW_CFG_ROM_ALERT_*
OTP fields and prints the corresponding value forOWNER_SW_CFG_ROM_ALERT_DIGEST_*
used by ROM to verify alert_handler initialization.