Raul Rangel has submitted this change. ( https://review.coreboot.org/c/coreboot/+/66573 )
(
13 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: util/amdfwtool/amdfwread: Fix AMDFW_OPT* bit mask ......................................................................
util/amdfwtool/amdfwread: Fix AMDFW_OPT* bit mask
Optional arguments that involve printing information from the firmware image is mapped to bit fields with bit 31 set. But instead of just setting bit 31, bits 27 - 31 are set. Fix AMDFW_OPT* bit mask.
BUG=None TEST=Build and use amdfwread to read the Soft-fuse bits from Guybrush BIOS image. Observed no changes before and after the changes.
Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com Change-Id: I0d88669bace45f3332c5e56527516b2f38295a48 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66573 Reviewed-by: Robert Zieba robertzieba@google.com Reviewed-by: Raul Rangel rrangel@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/amdfwtool/amdfwread.c 1 file changed, 32 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Raul Rangel: Looks good to me, approved Robert Zieba: Looks good to me, but someone else must approve
diff --git a/util/amdfwtool/amdfwread.c b/util/amdfwtool/amdfwread.c index ccb81b3..1701e20 100644 --- a/util/amdfwtool/amdfwread.c +++ b/util/amdfwtool/amdfwread.c @@ -162,10 +162,7 @@
enum { AMDFW_OPT_HELP = 'h', - - /* When bit 31 is set, options are a bitfield of info to print from the - firmware image. */ - AMDFW_OPT_SOFT_FUSE = 0xF0000001, + AMDFW_OPT_SOFT_FUSE = 1UL << 0, /* Print Softfuse */ };
static char const optstring[] = {AMDFW_OPT_HELP}; @@ -202,12 +199,18 @@ break; }
- if (opt == AMDFW_OPT_HELP) { + switch (opt) { + case AMDFW_OPT_HELP: print_usage(); return 0; - }
- selected_functions |= opt; + case AMDFW_OPT_SOFT_FUSE: + selected_functions |= opt; + break; + + default: + break; + } }
FILE *fw = fopen(fw_file, "rb");