From patchwork Mon Jan 14 12:20:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Kaiser X-Patchwork-Id: 1024472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=coreboot.org (client-ip=78.46.105.101; helo=coreboot.org; envelope-from=flashrom-bounces@flashrom.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=genua.de Received: from coreboot.org (coreboot.org [78.46.105.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43dYYC1k9zz9s4s for ; Tue, 15 Jan 2019 00:02:53 +1100 (AEDT) Received: from [172.30.0.99] (mailu_mailman-core_1.mailu_default [172.30.0.99]) by coreboot.org (Postfix) with ESMTP id D45AC10A1840; Mon, 14 Jan 2019 13:02:48 +0000 (UTC) Received: from gg.genua.de (gg-0.genua.de [80.154.94.10]) by coreboot.org (Postfix) with ESMTP id D37E810A183D for ; Mon, 14 Jan 2019 12:20:39 +0000 (UTC) Received: from gg.genua.de (localhost [127.0.0.1]) by gg.genua.de (Postfix) with ESMTP id 4F31D7A1EBE; Mon, 14 Jan 2019 13:20:39 +0100 (CET) Received: (from localhost) by gg.genua.de (MSCAN) id 2/gg.genua.de/smtp-gw/mscan; Mon Jan 14 13:20:39 2019 From: Florian Kaiser To: Nico Huber , flashrom@flashrom.org Date: Mon, 14 Jan 2019 13:20:26 +0100 Message-ID: <70356638.IQTIvWWjPW@varadin> User-Agent: KMail/4.13.0.34 (Linux/4.19.13-200.fc28.x86_64; KDE/4.14.38; x86_64; ; ) In-Reply-To: References: <7573032.zDFEjKL1Lq@varadin> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.71 on 192.168.215.230 X-Scanned-By: MIMEDefang 2.71 on 192.168.215.230 X-MailFrom: florian_kaiser@genua.de X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-flashrom.flashrom.org-0; header-match-flashrom.flashrom.org-1; header-match-flashrom.flashrom.org-2; header-match-flashrom.flashrom.org-3; header-match-flashrom.flashrom.org-4; header-match-flashrom.flashrom.org-5; header-match-flashrom.flashrom.org-6; header-match-flashrom.flashrom.org-7; header-match-flashrom.flashrom.org-8; header-match-flashrom.flashrom.org-9; header-match-flashrom.flashrom.org-10; header-match-flashrom.flashrom.org-11; header-match-flashrom.flashrom.org-12; header-match-flashrom.flashrom.org-13; header-match-flashrom.flashrom.org-14; header-match-flashrom.flashrom.org-15; header-match-flashrom.flashrom.org-16; header-match-flashrom.flashrom.org-17; header-match-flashrom.flashrom.org-18; header-match-flashrom.flashrom.org-19; header-match-flashrom.flashrom.org-20; header-match-flashrom.flashrom.org-21; header-match-flashrom.flashrom.org- 22; header-match-flashrom.flashrom.org-23; header-match-flashrom.flashrom.org-24; header-match-flashrom.flashrom.org-25; header-match-flashrom.flashrom.org-26; header-match-flashrom.flashrom.org-27; header-match-flashrom.flashrom.org-28; header-match-flashrom.flashrom.org-29; header-match-flashrom.flashrom.org-30; header-match-flashrom.flashrom.org-31; header-match-flashrom.flashrom.org-32; header-match-flashrom.flashrom.org-33; header-match-flashrom.flashrom.org-34; header-match-flashrom.flashrom.org-35; header-match-flashrom.flashrom.org-36; header-match-flashrom.flashrom.org-37; header-match-flashrom.flashrom.org-38; header-match-flashrom.flashrom.org-39; header-match-flashrom.flashrom.org-40; header-match-flashrom.flashrom.org-41; header-match-flashrom.flashrom.org-42; header-match-flashrom.flashrom.org-43; header-match-flashrom.flashrom.org-44; header-match-flashrom.flashrom.org-45; header-match-flashrom.flashrom.org-46; header-match-flashrom.flashrom.org-47; header-match-flash rom.flashrom.org-48; header-match-flashrom.flashrom.org-49; header-match-flashrom.flashrom.org-50; header-match-flashrom.flashrom.org-51; header-match-flashrom.flashrom.org-52; header-match-flashrom.flashrom.org-53; header-match-flashrom.flashrom.org-54; header-match-flashrom.flashrom.org-55; header-match-flashrom.flashrom.org-56; header-match-flashrom.flashrom.org-57; header-match-flashrom.flashrom.org-58; header-match-flashrom.flashrom.org-59; header-match-flashrom.flashrom.org-60; header-match-flashrom.flashrom.org-61; header-match-flashrom.flashrom.org-62; header-match-flashrom.flashrom.org-63; header-match-flashrom.flashrom.org-64; header-match-flashrom.flashrom.org-65; header-match-flashrom.flashrom.org-66; header-match-flashrom.flashrom.org-67; header-match-flashrom.flashrom.org-68; header-match-flashrom.flashrom.org-69; header-match-flashrom.flashrom.org-70; header-match-flashrom.flashrom.org-71; header-match-flashrom.flashrom.org-72 Message-ID-Hash: UP6XDBNJGAZWLASY2AKHCLJY7YQLEKXC X-Message-ID-Hash: UP6XDBNJGAZWLASY2AKHCLJY7YQLEKXC X-Mailman-Approved-At: Mon, 14 Jan 2019 13:02:46 +0000 X-Mailman-Version: 3.2.0 Precedence: list Subject: [flashrom] Re: patch for allowing the use of the SOCKET target of the SF600 List-Id: flashrom discussion and development mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-Spamd-Bar: / Authentication-Results: coreboot.org Hello Nico, thanks for your feedback! I attached an improved patch that hopefully solves these issues. Thanks a lot! Florian Am Sonntag, 23. Dezember 2018, 14:34:16 schrieb Nico Huber: > Hello Florian, > > thanks for your patch, I've commented on it inline. > > On 10.12.18 11:05, Florian Kaiser wrote: > > I am using this patch for a while now and I did not encounter any > > problems. I am not sure if this was/is not supported. Is there any reason > > why this is not supported? > > No reason beside that nobody cared about it yet, I guess. > > Nico > > > From 5df0b1ff7bb95f4384c98727a56a03660dde6aaa Mon Sep 17 00:00:00 2001 > > From: Florian Kaiser > > Date: Tue, 31 Jul 2018 13:42:22 +0200 > > Subject: [PATCH] dediprog: allow the use of the programming target > > "socket". > > > > Change-Id: I8c5120ce2151138093be0f27951916ec7f725574 > > Signed-off-by: Florian Kaiser > > --- > > > > dediprog.c | 6 +++++- > > flashrom.8.tmpl | 5 +++-- > > 2 files changed, 8 insertions(+), 3 deletions(-) > > > > diff --git a/dediprog.c b/dediprog.c > > index 72818ea..0eb84ec 100644 > > --- a/dediprog.c > > +++ b/dediprog.c > > @@ -1028,7 +1028,7 @@ int dediprog_init(void) > > > > free(target_str); > > return 1; > > > > } > > > > - if (target < 1 || target > 2) { > > + if (target < 1 || target > 3) { > > > > msg_perr("Error: Value for 'target' is out of range.\n"); > > free(target_str); > > return 1; > > > > @@ -1047,6 +1047,10 @@ int dediprog_init(void) > > > > msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2"); > > target = FLASH_TYPE_APPLICATION_FLASH_2; > > break; > > > > + case 3: > > + msg_pinfo("Using target %s.\n", "FLASH_TYPE_SOCKET"); > > + target = FLASH_TYPE_SOCKET; > > + break; > > This makes a flaw in set_target_flash() obvious now. Not all programmers > have a socket. I just checked set_target_flash() silently fails with an > SF 100. So we should check for compatibility there or at the calling > site. > > > default: > > break; > > > > } > > > > diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl > > index c557af7..04fd1c8 100644 > > --- a/flashrom.8.tmpl > > +++ b/flashrom.8.tmpl > > @@ -946,8 +946,9 @@ parameter specifies which target chip should be used. > > Syntax is> > > where > > .B value > > can be > > > > -.BR 1 " or " 2 > > -to select target chip 1 or 2 respectively. The default is target chip 1. > > +.BR 1 ", " 2 " or " 3 > > +to select target chip 1 or 2 respectively. The default is target chip 1. > > To use the programming socket > This reads confusing now (set 1, 2 or 3 to choose between 1 and 2?). > > > +of the SF600 you need to select target 3. > > > > .SS From f452463c4592f5ef2f7c52929eac885b8c153948 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Tue, 31 Jul 2018 13:42:22 +0200 Subject: [PATCH] dediprog: allow the use of the programming target "socket". Change-Id: I8c5120ce2151138093be0f27951916ec7f725574 Signed-off-by: Florian Kaiser --- dediprog.c | 15 +++++++++++++-- flashrom.8.tmpl | 5 +++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dediprog.c b/dediprog.c index 72818ea..0f7da9f 100644 --- a/dediprog.c +++ b/dediprog.c @@ -860,7 +860,14 @@ static int dediprog_command_b(void) static int set_target_flash(enum dediprog_target target) { - int ret = dediprog_write(CMD_SET_TARGET, target, 0, NULL, 0); + int ret; + + if (dediprog_devicetype != DEV_SF600 && target == FLASH_TYPE_SOCKET) { + msg_perr("Target type 'FLASH_TYPE_SOCKET' can only be used with a SF600 Programmer.\n"); + return 1; + } + + ret = dediprog_write(CMD_SET_TARGET, target, 0, NULL, 0); if (ret != 0) { msg_perr("set_target_flash failed (%s)!\n", libusb_error_name(ret)); return 1; @@ -1028,7 +1035,7 @@ int dediprog_init(void) free(target_str); return 1; } - if (target < 1 || target > 2) { + if (target < 1 || target > 3) { msg_perr("Error: Value for 'target' is out of range.\n"); free(target_str); return 1; @@ -1047,6 +1054,10 @@ int dediprog_init(void) msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2"); target = FLASH_TYPE_APPLICATION_FLASH_2; break; + case 3: + msg_pinfo("Using target %s.\n", "FLASH_TYPE_SOCKET"); + target = FLASH_TYPE_SOCKET; + break; default: break; } diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl index c557af7..c9e6ea2 100644 --- a/flashrom.8.tmpl +++ b/flashrom.8.tmpl @@ -946,8 +946,9 @@ parameter specifies which target chip should be used. Syntax is where .B value can be -.BR 1 " or " 2 -to select target chip 1 or 2 respectively. The default is target chip 1. +.BR 1 ", " 2 " or " 3 +to select target chip 1, 2 or 3 respectively. The default is target chip 1. To use the programming socket +of the SF600 you need to select target 3. .SS .BR "rayer_spi " programmer .IP -- 2.20.1