From patchwork Fri Oct 14 10:09:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Roversi X-Patchwork-Id: 682200 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 3swNg140bSz9t10 for ; Fri, 14 Oct 2016 21:11:39 +1100 (AEDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1buzRF-0003Y9-97; Fri, 14 Oct 2016 12:10:05 +0200 Received: from m-r1.th.seeweb.it ([5.144.164.170]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1buzR2-0003XR-UJ for flashrom@flashrom.org; Fri, 14 Oct 2016 12:10:03 +0200 Received: from inside.home.trueelena.org (94-39-188-162.adsl-ull.clienti.tiscali.it [94.39.188.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 86B4221629 for ; Fri, 14 Oct 2016 12:09:50 +0200 (CEST) Received: from [192.168.1.129] (helo=thekinks.home.trueelena.org) by inside.home.trueelena.org with smtp (Exim 4.84_2) (envelope-from ) id 1buzR0-0006Cg-15 for flashrom@flashrom.org; Fri, 14 Oct 2016 12:09:50 +0200 Date: Fri, 14 Oct 2016 12:09:49 +0200 From: Diego Roversi To: flashrom@flashrom.org Message-Id: <20161014120949.84ea1cc913879f63952535b8@tiscali.it> X-Mailer: Sylpheed 3.5.0beta1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Spam-Score: -0.6 (/) Subject: [flashrom] [PATCH] adding Adesto at25sf041a serial spi flash 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 Hello, This patch implements the handling of the Adesto AT25SF041A flash chip. This chip is an improved version of the Atmel AT25DF041A, and support the same protcol, but with a different id, 0x8401 insted of 0x4401. Tested on BeagleBone board. Signed-off-by: Diego Roversi Index: flashchips.c =================================================================== --- flashchips.c (revision 1955) +++ flashchips.c (working copy) @@ -1558,10 +1558,48 @@ .read = spi_chip_read, .voltage = {2700, 3600}, /* 2.3-3.6V & 2.7-3.6V models available */ }, { + .vendor = "Adesto", + .name = "AT25SF041A", + .bustype = BUS_SPI, + .manufacture_id = ATMEL_ID, + .model_id = ATMEL_AT25SF041A, + .total_size = 512, + .page_size = 256, + .feature_bits = FEATURE_WRSR_WREN, + .tested = TEST_OK_PREW, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = + { + { + .eraseblocks = { {4 * 1024, 128} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 16} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 8} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {512 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {512 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + } + }, + .printlock = spi_prettyprint_status_register_at25df, + .unlock = spi_disable_blockprotect_at2x_global_unprotect, + .write = spi_chip_write_256, + .read = spi_chip_read, + .voltage = {2700, 3600}, /* 2.3-3.6V & 2.7-3.6V models available */ + }, + + { .vendor = "Atmel", .name = "AT25DF081", .bustype = BUS_SPI, .manufacture_id = ATMEL_ID, .model_id = ATMEL_AT25DF081, Index: flashchips.h =================================================================== --- flashchips.h (revision 1955) +++ flashchips.h (working copy) @@ -131,10 +131,11 @@ #define AMIC_A49LF040A 0x9d #define ATMEL_ID 0x1F /* Atmel (now used by Adesto) */ #define ATMEL_AT25DF021 0x4300 #define ATMEL_AT25DF041A 0x4401 +#define ATMEL_AT25SF041A 0x8401 #define ATMEL_AT25DF081 0x4502 /* EDI 0x00. AT25DL081 has same ID + EDI 0x0100 */ #define ATMEL_AT25DF081A 0x4501 /* Yes, 81A has a lower number than 81 */ #define ATMEL_AT25DF161 0x4602 #define ATMEL_AT25DF321 0x4700 /* Same as 26DF321 */ #define ATMEL_AT25DF321A 0x4701