-
Notifications
You must be signed in to change notification settings - Fork 13
ot_lc_ctrl: Set LC_STATE to POST_TRANSITION after a transition
#260
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
ot_lc_ctrl: Set LC_STATE to POST_TRANSITION after a transition
#260
Conversation
rivos-eblot
left a comment
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.
LGTM, although I have not cross checked with the RTL implementation.
…a transition From <https://opentitan.org/book/hw/ip/lc_ctrl/doc/programmers_guide.html>: "Note that all life cycle state transition increments the LC_TRANSITION_CNT and moves the life cycle state into the temporary POST_TRANSITION state - even if the transition was unsuccessful" This is checked by manufacturing tests (on the host side). Signed-off-by: Luís Marques <luismarques@lowrisc.org>
689d664 to
a02abe0
Compare
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.
Have you double checked that LC_STATE_POST_TRANSITION was properly handled in all cases?
For example, LC_ENC_STATE_POST_TRANSITION is defined but not decoded from ot_lc_ctrl_convert_code_to_state(), which would trigger a g_assert() that would be invalid. I'm not sure this case may happen, but it is weird it is defined and not used.
There are other locations where I think LC_STATE_POST_TRANSITION is guarded behind ot_lc_ctrl_safe_convert_code_to_state() but I have not reviewed all the sequences.
We need to be sure that g_assert() cannot be triggered by the guest SW and that LC_STATE_POST_TRANSITION is not stored into the OTP backend.
I will further check things. |
I haven't found a way to go into a bad state or trip an assertion. |
Safe to merge then. Thanks. |
From https://opentitan.org/book/hw/ip/lc_ctrl/doc/programmers_guide.html:
"Note that all life cycle state transition increments the LC_TRANSITION_CNT and moves the life cycle state into the temporary POST_TRANSITION state - even if the transition was unsuccessful"
This is checked by manufacturing tests (on the host side).