From patchwork Wed May 4 11:37:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Huber X-Patchwork-Id: 618374 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 3r0GJH3F4Wz9t5T for ; Wed, 4 May 2016 21:38:22 +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 1axv7V-0006KA-JA; Wed, 04 May 2016 13:37:33 +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 1axv7K-0006Jb-Uc for flashrom@flashrom.org; Wed, 04 May 2016 13:37:32 +0200 Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 4E3AD1A06BD for ; Wed, 4 May 2016 13:37:20 +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 XGdC0uWIqkS4 for ; Wed, 4 May 2016 13:37:19 +0200 (CEST) Received: from mail-essen-01.secunet.de (unknown [10.53.40.204]) by a.mx.secunet.com (Postfix) with ESMTP id 5C9DD1A065E for ; Wed, 4 May 2016 13:37:19 +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:37:20 +0200 From: Nico Huber To: Date: Wed, 4 May 2016 13:37:10 +0200 Message-ID: <1462361831-30320-1-git-send-email-nico.huber@secunet.com> X-Mailer: git-send-email 2.7.0 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.0A0C0203.5729DEF0.006E, 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: 6EC5D7A4-B157-44AB-9F48-D9F131D0978A X-Spam-Score: -1.6 (-) Subject: [flashrom] [PATCH 1/2] dediprog: Reimplement target chip option 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 Signed-off-by: Nico Huber Acked-by: David Hendricks Acked-by: David Hendricks --- dediprog.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dediprog.c b/dediprog.c index 019de46..b7276e5 100644 --- a/dediprog.c +++ b/dediprog.c @@ -942,7 +942,7 @@ int dediprog_init(void) int spispeed_idx = 1; int millivolt = 3500; long usedevice = 0; - long target = 1; + long target = FLASH_TYPE_APPLICATION_FLASH_1; int i, ret; spispeed = extract_programmer_param("spispeed"); @@ -1014,7 +1014,18 @@ int dediprog_init(void) free(target_str); return 1; } - msg_pinfo("Using target %li.\n", target); + switch (target) { + case 1: + msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_1"); + target = FLASH_TYPE_APPLICATION_FLASH_1; + break; + case 2: + msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2"); + target = FLASH_TYPE_APPLICATION_FLASH_2; + break; + default: + break; + } } free(target_str); @@ -1073,7 +1084,7 @@ int dediprog_init(void) dediprog_set_leds(LED_ALL); /* Select target/socket, frequency and VCC. */ - if (set_target_flash(FLASH_TYPE_APPLICATION_FLASH_1) || + if (set_target_flash(target) || dediprog_set_spi_speed(spispeed_idx) || dediprog_set_spi_voltage(millivolt)) { dediprog_set_leds(LED_ERROR);