From patchwork Mon Jun 4 13:02:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 925010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=flashrom.org (client-ip=80.81.252.135; helo=mail.coreboot.org; envelope-from=flashrom-bounces@flashrom.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QeZgabqa"; dkim-atps=neutral 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 40zwC23Jl6z9ry1 for ; Mon, 4 Jun 2018 23:05:01 +1000 (AEST) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1fPpCg-0002ZG-GZ; Mon, 04 Jun 2018 15:07:18 +0200 Received: from mail-wr0-f195.google.com ([209.85.128.195]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1fPpCM-0002XV-9G for flashrom@flashrom.org; Mon, 04 Jun 2018 15:07:16 +0200 Received: by mail-wr0-f195.google.com with SMTP id d2-v6so27750872wrm.10 for ; Mon, 04 Jun 2018 06:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KDAiNF5OlRZOwEftO8TO+kJQ1iHYdrFADqlHFhazBg0=; b=QeZgabqajy9k0Zl+ZyDM5fMmduoAiqniZjeDHOejS4Q/bUlBgoNbplu3++X6/1vVdi aT6uLlDQNROm3Iz7qMdVKnIhIvD8Tq5GMXik81Vo4W+mWdCwVtBOeROttyKUDHY/GIl9 /FIxZpG0KGl2RhEwVibXZhBbv4R8eykwpm2oE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KDAiNF5OlRZOwEftO8TO+kJQ1iHYdrFADqlHFhazBg0=; b=SuvKgfAqllReENuF7LZvA3SBFZ3QADVHgPljA+M4f8vNmdgFlX09D5+0MPsacVZF47 T1BogVbsfVXVBBsswTZUwqRsAtAIbqmnsf2qg3YMqLVkgrYr58ZipV9Qu8xJchYhteDu kxXJ3yx/0OL/u7orcwgokdSv5sb8tpctBdDOF3sPi52Dp08BwI7pVkrK/hgeet076Hax 6NWlF6OIjuuSP80fJETZAAwLV0JV+/xtoemb2UzNlafUaZamNbbAGnDjuZg2OxHb976J ViN+qCMdUeDCK8470R81Go5CH7v8ZxTJVYOG/i7vmNTUbuLAkW2k+2vMI9psXBxepIYx 1Mmg== X-Gm-Message-State: ALKqPwfymD+OOzgryfed0+OTrfq0PL1TCukToS8D6FHUzOOYDPDtZaGz +JE3clg0wHAEsxF17AtKR31RIhIDa/E= X-Google-Smtp-Source: ADUXVKKLrGHb+P5NzUU6n3PRReIhOs1cHEMKbCdxfyYr0i8tJHwIxT4tqa5Ag2Wvy8KC+ltVkro6gg== X-Received: by 2002:adf:8854:: with SMTP id e20-v6mr17524534wre.30.1528117401687; Mon, 04 Jun 2018 06:03:21 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id g88-v6sm207045wmc.27.2018.06.04.06.03.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 06:03:20 -0700 (PDT) From: Daniel Thompson To: flashrom@flashrom.org Date: Mon, 4 Jun 2018 14:02:44 +0100 Message-Id: <20180604130244.23912-3-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180604130244.23912-1-daniel.thompson@linaro.org> References: <20180604130244.23912-1-daniel.thompson@linaro.org> X-Spam-Score: -0.1 (/) Subject: [flashrom] [RFC PATCH 2/2] flashchips: Add Macronix MX25U51245G X-BeenThere: flashrom@flashrom.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: flashrom discussion and development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 Copy 'n paste support for Macronix MX25U51245G. I don't pretend to know a whole lot about SPI FLASH so its mosty copied from other MX25U devices. Currently probe works OK and I can read the first 4MB of FLASH (the remain 60MB is unprogrammed) but its not practical to read the whole chip but with the bit banger I'm using it would take >3 days. What testing is needed? For example is setting up a layout to read/write the first and last megabytes of the flash sufficient to replace TEST_UNTESTED? Change-Id: I2117fc205006088967f3d97644375d10db1791f1 Signed-off-by: Daniel Thompson --- flashchips.c | 40 ++++++++++++++++++++++++++++++++++++++++ flashchips.h | 1 + 2 files changed, 41 insertions(+) diff --git a/flashchips.c b/flashchips.c index 8eda608843e5..89b4faab843f 100644 --- a/flashchips.c +++ b/flashchips.c @@ -8484,6 +8484,46 @@ const struct flashchip flashchips[] = { .voltage = {1650, 2000}, }, + { + .vendor = "Macronix", + .name = "MX25U51245G", + .bustype = BUS_SPI, + .manufacture_id = MACRONIX_ID, + .model_id = MACRONIX_MX25U51245G, + .total_size = 65536, + .page_size = 256, + /* OTP: 512B total; enter 0xB1, exit 0xC1 */ + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI, + .tested = TEST_UNTESTED, + .probe = probe_spi_rdid, + .probe_timing = TIMING_ZERO, + .block_erasers = + { + { + .eraseblocks = { {4 * 1024, 16384} }, + .block_erase = spi_block_erase_20, + }, { + .eraseblocks = { {32 * 1024, 2048} }, + .block_erase = spi_block_erase_52, + }, { + .eraseblocks = { {64 * 1024, 1024} }, + .block_erase = spi_block_erase_d8, + }, { + .eraseblocks = { {64 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_60, + }, { + .eraseblocks = { {64 * 1024 * 1024, 1} }, + .block_erase = spi_block_erase_c7, + } + }, + /* TODO: security register */ + .printlock = spi_prettyprint_status_register_bp3_srwd, /* bit6 is quad enable */ + .unlock = spi_disable_blockprotect_bp3_srwd, + .write = spi_chip_write_256, /* Multi I/O supported */ + .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ + .voltage = {1650, 2000}, + }, + { .vendor = "Macronix", .name = "MX25L6495F", diff --git a/flashchips.h b/flashchips.h index f00be3bc78fa..e0b2c0e72c3d 100644 --- a/flashchips.h +++ b/flashchips.h @@ -489,6 +489,7 @@ #define MACRONIX_MX25U6435E 0x2537 /* Same as MX25U6435F */ #define MACRONIX_MX25U12835E 0x2538 /* Same as MX25U12835F */ #define MACRONIX_MX25U25635F 0x2539 +#define MACRONIX_MX25U51245G 0x253a #define MACRONIX_MX25L3235D 0x5E16 /* MX25L3225D/MX25L3235D/MX25L3237D */ #define MACRONIX_MX25L6495F 0x9517