From f8e618606a231b3c00e3fced3699627f60dbbec5 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Wed, 19 Jun 2024 18:36:54 +1000 Subject: [PATCH] print.c: Print B (block-protect) test status of the chips This also expands the column for test status by 1 more char, since now maximum status is longer, PREWB vs PREW. print.c runs when command line option `flashrom -L` is invoked. Change-Id: If697fe3ba93dbe34bb8f7a9a4b1686fdb8b3ee58 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/83131 Reviewed-by: Sergii Dmytruk Tested-by: build bot (Jenkins) --- print.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/print.c b/print.c index 015f4a8fe..892471d43 100644 --- a/print.c +++ b/print.c @@ -122,7 +122,7 @@ static int print_supported_chips(void) for (i = strlen("Device"); i < maxchiplen; i++) msg_ginfo(" "); - msg_ginfo("Test"); + msg_ginfo("Test "); for (i = 0; i < border; i++) msg_ginfo(" "); msg_ginfo("Known"); @@ -140,7 +140,7 @@ static int print_supported_chips(void) for (i = 0; i < maxvendorlen + maxchiplen; i++) msg_ginfo(" "); - msg_ginfo("OK "); + msg_ginfo("OK "); for (i = 0; i < border; i++) msg_ginfo(" "); msg_ginfo("Broken"); @@ -151,7 +151,7 @@ static int print_supported_chips(void) msg_ginfo(" "); msg_gdbg("range [V]"); msg_ginfo("\n\n"); - msg_ginfo("(P = PROBE, R = READ, E = ERASE, W = WRITE, - = N/A)\n\n"); + msg_ginfo("(P = PROBE, R = READ, E = ERASE, W = WRITE, B = block-protect, - = N/A)\n\n"); for (chip = flashchips; chip->name != NULL; chip++) { /* Don't print generic entries. */ @@ -242,6 +242,12 @@ static int print_supported_chips(void) msg_ginfo("-"); else msg_ginfo(" "); + if (chip->tested.wp == OK) + msg_ginfo("B"); + else if (chip->tested.wp == NA) + msg_ginfo("-"); + else + msg_ginfo(" "); for (i = 0; i < border; i++) msg_ginfo(" "); @@ -261,6 +267,10 @@ static int print_supported_chips(void) msg_ginfo("W"); else msg_ginfo(" "); + if (chip->tested.wp == BAD) + msg_ginfo("B"); + else + msg_ginfo(" "); for (i = 0; i < border + 1; i++) msg_ginfo(" ");