From patchwork Thu Jan 28 05:51:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 574534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EF701140B94 for ; Thu, 28 Jan 2016 16:55:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Y+Fbh1A/; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOfW9-0004ca-99; Thu, 28 Jan 2016 05:53:17 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOfVg-0004Dn-2y for linux-mtd@lists.infradead.org; Thu, 28 Jan 2016 05:52:49 +0000 Received: by mail-pa0-x242.google.com with SMTP id gi1so1444895pac.2 for ; Wed, 27 Jan 2016 21:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TII79T4qXYudxKoQxifcs39HkV2frZnVUZp2T1c3wxY=; b=Y+Fbh1A/cQmBbsO+Y2SrV+cfUpKs8TLFnZPkVj28zVWQ6zsMscY9apNaZ5KEUayNoF K1ToOI6EK/kQAZqUSwwU8IhnGBZC/cEtiouKmz9U8jaSaOuc6oOuHjQkrs4buXgI69v7 ekGDhDkRNId9b0B/MolyIkJRUQebBE4p1WlWNWPmeGMwUXq8+sVOceilBqgbZUySnNb2 QruTv5mXx8EWSTzc1AjkRDaMeuYP7jfsOyu+w9hxerdriOJOgTNblxUC5oVp6PBWzjQZ sGajOB55dE9JMdySfNVQwxZblGRfro193eV36vpg10zRDwT5aC24zp3KtlCxg0fi9BYO FMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TII79T4qXYudxKoQxifcs39HkV2frZnVUZp2T1c3wxY=; b=F3uLvbN5aynGnBstIj/XEB26xE94DnEIq4YNCY9/bKcWa044XpnZoa2Y5Pwgi0SDNG PF7WHRY/kdFX/4FvgksFbOutvOULJ1btsWdPoeZiEveXpmtq0QyIVNMlJJWWCCndYthg OV9mzPTe8uH28wh5pWSV42hReCuwZrgdV6K6Z5zOBdxCEdH9/yDP/KWIKRx2c1OSOPj0 mC3pBWjCBnDd1pFOvONiKZhjPjzPUTgxVxXGxLFVHw65O5V8lUnXstdS6AyFRLZ4KwCd /FjFwudwkBvLWqzaBPI1cFUXjSzcZxmao+a5QrjvJQtQlf4PYTcnJBWSfA5eY3Xq1K9D 6SLA== X-Gm-Message-State: AG10YOTCPozsv/9KU39OmS5SzQqYwTFeMVFpXNaska1hdnsL17hrvsttHsVzAakwcAyQcg== X-Received: by 10.66.150.202 with SMTP id uk10mr1834895pab.73.1453960347428; Wed, 27 Jan 2016 21:52:27 -0800 (PST) Received: from localhost.lan. (c-71-198-3-2.hsd1.ca.comcast.net. [71.198.3.2]) by smtp.gmail.com with ESMTPSA id 6sm2371255pfo.58.2016.01.27.21.52.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2016 21:52:26 -0800 (PST) From: Brian Norris To: Subject: [PATCH 8/8] mtd: spi-nor: support lock/unlock for a few Winbond chips Date: Wed, 27 Jan 2016 21:51:47 -0800 Message-Id: <1453960307-10181-9-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1453960307-10181-1-git-send-email-computersforpeace@gmail.com> References: <1453960307-10181-1-git-send-email-computersforpeace@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160127_215248_376004_EE441AAF X-CRM114-Status: GOOD ( 10.20 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Boris Brezillon , djkurtz@chromium.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-kernel@vger.kernel.org, Bayi Cheng , Ezequiel Garcia , Brian Norris MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org These are recent Winbond models that are known to have lock/unlock support via writing the Status Register, and that also support the TB (Top/Bottom) protection bit. Tested on w25q32dw. [Note on style: these entries are getting pretty long lines, so I picked a style that seems reasonable for splitting up the flags separate from the other mostly-similar fields.] Signed-off-by: Brian Norris --- drivers/mtd/spi-nor/spi-nor.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 5e84e3c543aa..cd3908e26712 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -942,11 +942,23 @@ static const struct flash_info spi_nor_ids[] = { { "w25x16", INFO(0xef3015, 0, 64 * 1024, 32, SECT_4K) }, { "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) }, { "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) }, - { "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { + "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, { "w25x64", INFO(0xef3017, 0, 64 * 1024, 128, SECT_4K) }, { "w25q64", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) }, - { "w25q64dw", INFO(0xef6017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "w25q128fw", INFO(0xef6018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { + "w25q64dw", INFO(0xef6017, 0, 64 * 1024, 128, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, + { + "w25q128fw", INFO(0xef6018, 0, 64 * 1024, 256, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },