From patchwork Wed May 4 11:51:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Huber X-Patchwork-Id: 618389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r0GfM5ZD4z9sXR for ; Wed, 4 May 2016 21:54:03 +1000 (AEST) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1axvLp-0006mc-5D; Wed, 04 May 2016 13:52:21 +0200 Received: from a.mx.secunet.com ([62.96.220.36]) by mail.coreboot.org with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86_2) (envelope-from ) id 1axvLb-0006jj-Bq for flashrom@flashrom.org; Wed, 04 May 2016 13:52:19 +0200 Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id A20DB1A070A for ; Wed, 4 May 2016 13:52:04 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mRCFWz1xX1_w for ; Wed, 4 May 2016 13:52:03 +0200 (CEST) Received: from mail-essen-01.secunet.de (unknown [10.53.40.204]) by a.mx.secunet.com (Postfix) with ESMTP id 7DAFA1A0748 for ; Wed, 4 May 2016 13:51:59 +0200 (CEST) Received: from schawa.localdomain (10.182.9.137) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server (TLS) id 14.3.279.2; Wed, 4 May 2016 13:52:00 +0200 From: Nico Huber To: Date: Wed, 4 May 2016 13:51:40 +0200 Message-ID: <1462362706-31216-9-git-send-email-nico.huber@secunet.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1462362706-31216-1-git-send-email-nico.huber@secunet.com> References: <1462362706-31216-1-git-send-email-nico.huber@secunet.com> MIME-Version: 1.0 X-Originating-IP: [10.182.9.137] X-G-Data-MailSecurity-for-Exchange-SpamLevel: 0 X-G-Data-MailSecurity-for-Exchange-SpamFilter: 0; 1; str=0001.0A0C0205.5729E260.0111, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 32 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: 34B66C9C-68DC-4788-A9BD-9C701A279648 X-Spam-Score: -1.6 (-) Subject: [flashrom] [PATCH 08/14] Add option (-A, --noverify-all) to not verify the whole chip after write X-BeenThere: flashrom@flashrom.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: flashrom discussion and development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: flashrom-bounces@flashrom.org Sender: "flashrom" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff This also reduces the data read before the write to the included layout regions. Signed-off-by: Nico Huber --- cli_classic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cli_classic.c b/cli_classic.c index d7e17f7..d23a3a3 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -42,7 +42,7 @@ static void cli_classic_usage(const char *name) "-z|" #endif "-p [:] [-c ]\n" - "[-E|(-r|-w|-v) ] [-l [-i ]...] [-n] [-f]]\n" + "[-E|(-r|-w|-v) ] [-l [-i ]...] [-n] [-A] [-f]]\n" "[-V[V[V]]] [-o ]\n\n", name); printf(" -h | --help print this help text\n" @@ -55,6 +55,7 @@ static void cli_classic_usage(const char *name) " -c | --chip probe only for specified flash chip\n" " -f | --force force specific operations (see man page)\n" " -n | --noverify don't auto-verify\n" + " -A | --noverify-all don't auto-verify whole chip\n" " -l | --layout read ROM layout from \n" " -i | --image only flash image from flash layout\n" " -o | --output log output to \n" @@ -103,17 +104,18 @@ int main(int argc, char *argv[]) int list_supported_wiki = 0; #endif int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; - int dont_verify_it = 0, list_supported = 0, operation_specified = 0; + int dont_verify_it = 0, dont_verify_all = 0, list_supported = 0, operation_specified = 0; enum programmer prog = PROGRAMMER_INVALID; int ret = 0; - static const char optstring[] = "r:Rw:v:nVEfc:l:i:p:Lzho:"; + static const char optstring[] = "r:Rw:v:nAVEfc:l:i:p:Lzho:"; static const struct option long_options[] = { {"read", 1, NULL, 'r'}, {"write", 1, NULL, 'w'}, {"erase", 0, NULL, 'E'}, {"verify", 1, NULL, 'v'}, {"noverify", 0, NULL, 'n'}, + {"noverify-all", 0, NULL, 'A'}, {"chip", 1, NULL, 'c'}, {"verbose", 0, NULL, 'V'}, {"force", 0, NULL, 'f'}, @@ -190,6 +192,9 @@ int main(int argc, char *argv[]) } dont_verify_it = 1; break; + case 'A': + dont_verify_all = 1; + break; case 'c': chip_to_probe = strdup(optarg); break; @@ -536,7 +541,7 @@ int main(int argc, char *argv[]) fl_flag_set(fill_flash, FL_FLAG_FORCE, !!force); fl_flag_set(fill_flash, FL_FLAG_FORCE_BOARDMISMATCH, !!force_boardmismatch); fl_flag_set(fill_flash, FL_FLAG_VERIFY_AFTER_WRITE, !dont_verify_it); - fl_flag_set(fill_flash, FL_FLAG_VERIFY_WHOLE_CHIP, true); + fl_flag_set(fill_flash, FL_FLAG_VERIFY_WHOLE_CHIP, !dont_verify_all); /* FIXME: We should issue an unconditional chip reset here. This can be * done once we have a .reset function in struct flashchip.