[Skiboot] [PATCH 1/4] external/pflash: report if a flash partition is ECC protected

Cyril Bur cyril.bur at au1.ibm.com
Fri May 8 17:58:32 AEST 2015


Currently pflash doesn't display if a flash partition contains ECC bits or not
when dumping the flash layout.  libffs has all this information it's just that
pflash doesn't relay it.

Trivial change to add to the information pflash prints about each partition

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 external/pflash/pflash.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index fb783a2..d6f46d3 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -99,9 +99,10 @@ static void print_flash_info(void)
 
 	for (i = 0;; i++) {
 		uint32_t start, size, act, end;
+		bool ecc;
 		char *name;
 
-		rc = ffs_part_info(ffsh, i, &name, &start, &size, &act, NULL);
+		rc = ffs_part_info(ffsh, i, &name, &start, &size, &act, &ecc);
 		if (rc == FFS_ERR_PART_NOT_FOUND)
 			break;
 		if (rc) {
@@ -109,8 +110,12 @@ static void print_flash_info(void)
 			break;
 		}
 		end = start + size;
-		printf("ID=%02d %15s %08x..%08x (actual=%08x)\n",
-		       i, name, start, end, act);
+		printf("ID=%02d %15s %08x..%08x (actual=%08x) %s\n",
+		       i, name, start, end, act, ecc ? "[ECC]" : "");
+
+		if (strcmp(name, "OTHER_SIDE") == 0)
+			other_side_offset = start;
+
 		free(name);
 	}
 }
-- 
1.9.1



More information about the Skiboot mailing list