From patchwork Fri May 8 07:58:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 469913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0F5681402A0 for ; Fri, 8 May 2015 18:09:05 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id E649B1A0E39 for ; Fri, 8 May 2015 18:09:04 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 240381A0272 for ; Fri, 8 May 2015 18:08:56 +1000 (AEST) Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 May 2015 18:08:55 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 8 May 2015 18:08:53 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 3C7252BB0040 for ; Fri, 8 May 2015 18:08:53 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4888j9c30670908 for ; Fri, 8 May 2015 18:08:53 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4888LJ4014392 for ; Fri, 8 May 2015 18:08:21 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t4888K1U013610 for ; Fri, 8 May 2015 18:08:20 +1000 Received: from cyril.ozlabs.ibm.com (unknown [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 137B5A038B for ; Fri, 8 May 2015 17:58:52 +1000 (AEST) From: Cyril Bur To: skiboot@lists.ozlabs.org Date: Fri, 8 May 2015 17:58:32 +1000 Message-Id: <1431071915-3917-2-git-send-email-cyril.bur@au1.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431071915-3917-1-git-send-email-cyril.bur@au1.ibm.com> References: <1431071915-3917-1-git-send-email-cyril.bur@au1.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050808-1618-0000-0000-0000020D4200 Subject: [Skiboot] [PATCH 1/4] external/pflash: report if a flash partition is ECC protected X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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); } }