zynqmp: Fix decoding errors in DisplayBhAttributes#49
Open
bradfa wants to merge 1 commit into
Open
Conversation
DisplayBhAttributes decodes the fsblAttributes word (boot header offset 0x44, UG1085 Table 11-5 "Image Attributes") for display. Four fields were decoded incorrectly; none affect image generation but proper decoding may help debug secure boot failures. opt_key ([3:2]) was extracted using AUTH_ONLY_BIT_SHIFT instead of OPT_KEY_BIT_SHIFT, and its value was then overwritten before the DisplayAttributes call, so it was never shown. auth_hash ([13:12], "SHA2 select") was not shown at all. The core/CPU select field ([11:10]) was treated as a boolean, producing [enabled] or [disabled]. It is a four-value field per the Core enum and UG1085 v2.5 Table 11-5. puf_mode was extracted from AUTH_HASH_BIT_SHIFT ([13:12]) instead of BH_PUF_MODE_BIT_SHIFT ([17:16]), and used case constant 2 where the PufMode enum defines 0 as puf-12k. The value was also overwritten by the bh_auth switch before display. All attribute decodings now consistently match the flow of "set val, copy to val1, set val, display attributes" which already existed for some attributes. Signed-off-by: Andrew Bradford <andrew.bradford@konsulko.com>
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.
DisplayBhAttributes decodes the fsblAttributes word (boot header offset 0x44, UG1085 Table 11-5 "Image Attributes") for display. Four fields were decoded incorrectly; none affect image generation but proper decoding may help debug secure boot failures.
opt_key ([3:2]) was extracted using AUTH_ONLY_BIT_SHIFT instead of OPT_KEY_BIT_SHIFT, and its value was then overwritten before the DisplayAttributes call, so it was never shown.
auth_hash ([13:12], "SHA2 select") was not shown at all.
The core/CPU select field ([11:10]) was treated as a boolean, producing [enabled] or [disabled]. It is a four-value field per the Core enum and UG1085 v2.5 Table 11-5.
puf_mode was extracted from AUTH_HASH_BIT_SHIFT ([13:12]) instead of BH_PUF_MODE_BIT_SHIFT ([17:16]), and used case constant 2 where the PufMode enum defines 0 as puf-12k. The value was also overwritten by the bh_auth switch before display.
All attribute decodings now consistently match the flow of "set val, copy to val1, set val, display attributes" which already existed for some attributes.