From patchwork Wed Jan 20 13:19:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1429168 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=XyvOGMZp; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=DxLF2klc; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DLR4S2ghvz9sSs for ; Thu, 21 Jan 2021 00:21:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SUSGs1uQQel53v6ksscHWGXcGl/CLBm76EXTKRob7FI=; b=XyvOGMZp/mAhihiZ90nZZ7yw4X xwJNIIDjN7tOlQqVKVLR60GfhxhDuFTTbcuPipIQabXPThLA/FW3klsinLEJG7UKk/OA8TLQd0f7O 00ikx1EyDoo+CXrU37U9Qkfmztv43kFsfJ2Ur9DRMFdRi+e0aMKE+ySQcA6Gb9vw2r76mm4kcpGUi nszDNQtXZuX5AQhUDiHMprAARutLF0GJKPBRdrSWUW8l+S0hObrT0oKveZsXOAJweuiu7phjvcN3u i+7zK6EdGBX/2Yt9G34+RBCjevI56ptjX1FFN3AgCZdNYR1Df1q6FPrjqOlp6qgz9Ct1DuS2L5F1/ w4xPRNmA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2DP8-0001OG-9n; Wed, 20 Jan 2021 13:20:10 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2DOK-00010l-I8 for linux-mtd@lists.infradead.org; Wed, 20 Jan 2021 13:19:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1611148760; x=1642684760; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=M9E5880rbkqDWAoMAk6+Epr48b7f4qlbZQwhrsdCZdQ=; b=DxLF2klcBIKzHtmq6nTDAT0bAdfPFw32bIjjLY9XyhqIQZHdN0zewm/c kHX/bYZJWrNIj7keDWRIw9l9nE+PS7iJDSVRo1lmTE2gMvPxY56tHOAeS YAuBGNsGg9kibljHz9hzdB8nxNXp7rANTQCpZQu1ziajZDIEYmJkMJIDK I6TGGbSZMGa46eAXqAzkPT08z6DhU6xMrxm8b8PVECS/SEbWrRBaXie+Y YoQUlnV1EgrRSLnbrUOmrX2ULY/F5V5WqX2HOJypQBpptR8aQ7P2SMAbM j2cntvXxOqhuk/z4QQG/op9LWog04yBeFqrZcoWtv+E4KzX1O4xeE2DfY g==; IronPort-SDR: xce6QlcHO2gpzF0hBMhz9DVXqyfJM32Bzd4e4j3GSvL6UZ2a3N0Evf4dIhzE9P1+ty3DXvcUuF PBt5qAHaqq/IGxgGUIJIg3dxYy94q7KkY1XHH+HrAn6PehYcFr9p+1J7o1+8wFng1WDatxGfjE I28XsSMmKFhkaSP7InrtWC8MVXCn3US2gK1dJIUk6V3UFpFyK+hFnAODKw5LLJ0UlzRhnyCH2q N7I8mvurhIfneBVNWIW0diw18AnP/nBzMwQLkbKFwqxS5VRb6oh0xr2jjhdfP4a4ocFdjVzt90 stE= X-IronPort-AV: E=Sophos;i="5.79,361,1602572400"; d="scan'208";a="111769214" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jan 2021 06:19:18 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 20 Jan 2021 06:19:18 -0700 Received: from atudor-ThinkPad-T470p.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 20 Jan 2021 06:19:16 -0700 From: Tudor Ambarus To: , , Subject: [PATCH v2 1/2] mtd: spi-nor: Add Global Block Unlock command Date: Wed, 20 Jan 2021 15:19:13 +0200 Message-ID: <20210120131914.277363-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_081920_777672_4DC8AF7B X-CRM114-Status: GOOD ( 14.07 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.153.233 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tudor Ambarus , richard@nod.at, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Kavyasree.Kotagiri@microchip.com, miquel.raynal@bootlin.com Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The Global Block Unlock command has different names depending on the manufacturer, but always the same command value: 0x98. Macronix's MX25U12835F names it Gang Block Unlock, Winbound's W25Q128FV names it Global Block Unlock and Microchip's SST26VF064B names it Global Block Protection Unlock. Used in the Individual Block Protection mode, which is mutually exclusive with the Block Protection mode (BP0-3). Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle --- v2: - s/mutual/mutually/ - set the GBULK cmd buswidth to 0 and call spi_nor_spimem_setup_op() to update the it, because the op can can be issued in QPI mode as well. - add Pratyush's R-b tag drivers/mtd/spi-nor/core.c | 37 +++++++++++++++++++++++++++++++++++++ drivers/mtd/spi-nor/core.h | 1 + include/linux/mtd/spi-nor.h | 1 + 3 files changed, 39 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 20df44b753da..e82732dd31e1 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -853,6 +853,43 @@ int spi_nor_wait_till_ready(struct spi_nor *nor) DEFAULT_READY_WAIT_JIFFIES); } +/** + * spi_nor_global_block_unlock() - Unlock Global Block Protection. + * @nor: pointer to 'struct spi_nor'. + * + * Return: 0 on success, -errno otherwise. + */ +int spi_nor_global_block_unlock(struct spi_nor *nor) +{ + int ret; + + ret = spi_nor_write_enable(nor); + if (ret) + return ret; + + if (nor->spimem) { + struct spi_mem_op op = + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_GBULK, 0), + SPI_MEM_OP_NO_ADDR, + SPI_MEM_OP_NO_DUMMY, + SPI_MEM_OP_NO_DATA); + + spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); + + ret = spi_mem_exec_op(nor->spimem, &op); + } else { + ret = spi_nor_controller_ops_write_reg(nor, SPINOR_OP_GBULK, + NULL, 0); + } + + if (ret) { + dev_dbg(nor->dev, "error %d on Global Block Unlock\n", ret); + return ret; + } + + return spi_nor_wait_till_ready(nor); +} + /** * spi_nor_write_sr() - Write the Status Register. * @nor: pointer to 'struct spi_nor'. diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index d631ee299de3..eb26796db026 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -434,6 +434,7 @@ int spi_nor_write_disable(struct spi_nor *nor); int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable); int spi_nor_write_ear(struct spi_nor *nor, u8 ear); int spi_nor_wait_till_ready(struct spi_nor *nor); +int spi_nor_global_block_unlock(struct spi_nor *nor); int spi_nor_lock_and_prep(struct spi_nor *nor); void spi_nor_unlock_and_unprep(struct spi_nor *nor); int spi_nor_sr1_bit6_quad_enable(struct spi_nor *nor); diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index d13958de6d8a..a0d572855444 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -53,6 +53,7 @@ #define SPINOR_OP_WREAR 0xc5 /* Write Extended Address Register */ #define SPINOR_OP_SRSTEN 0x66 /* Software Reset Enable */ #define SPINOR_OP_SRST 0x99 /* Software Reset */ +#define SPINOR_OP_GBULK 0x98 /* Global Block Unlock */ /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ #define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ From patchwork Wed Jan 20 13:19:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1429167 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=R5oAScFQ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=crAzldpc; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DLR483P3zz9sSs for ; Thu, 21 Jan 2021 00:21:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JzXtaswdF4uJnSnHynY3VgBvdCTskHIsx7CO8tb3yEM=; b=R5oAScFQ7gJqUO+kPkqQfo+Ll 31fkuPzkfqaDvZ0MB3QtKQk/wJbnMumA3b/X3PlQ2+4dUbPeu3EZHsqqag4vL+auj9F3LuXzg+XA2 BnDCw4xrUCEwJQmUwTLyENEC0Tn4gZ5YqqWPzTPeRslvHqDW/Y/67yOM0DvxVpyoXhbGV3XYDee5L 4CoH1VXH22Is9A3/E0LhUYEojuAXzwNjOLzSbZ8Dc6E6+FBgGfTSwR4NLy6IETYGcn+HhgOt/y+Ev 9lW6dpF9PQjTDd5d9OICgNH7xEVqeJXOcjuPAQts07TgK+0H/oDNl8erhUmv3GSSajmK0cGh05Bmk IFf7YyvMg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2DPD-0001RZ-PB; Wed, 20 Jan 2021 13:20:15 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2DOX-00016E-19 for linux-mtd@lists.infradead.org; Wed, 20 Jan 2021 13:19:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1611148773; x=1642684773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Nu0DWecPAvplEFUztuBszcCe7KUNT4UBQzzQs4ZKFo0=; b=crAzldpc2C5orPCZzVcztdrFFytEjzw79GLGwE7lkEPW8f5OWVN9jDB5 XBz3a1MlkiUaFyOZ2JKQtsamn8UFgOidBRwYWJ62j4e2B/EveO3N5yxXS 4TpPx8oL47Q0d2uRwCFBxJDYtkMW1S4S1Yz0hLvc3DZE2HpG/l3MI3jol df7sKLMfR2mptW6hsLeCkwAtqOchm9+fiXrDLQ5R5X7DmNMmSJkJmbdo2 m0xY0KSz+s9A/ZYw1x3D1llbNu5d2qV/qV8jBGan5YtvzHXRSffzZ+yRO XqGbJs6GrWQeKg17XtwdOaj2f44OzRTYBDB8GR4264G/UDg1yL/OnRleU g==; IronPort-SDR: RMswkpPqUOQAYorY/yLoY5ZCKWZHqUaXFqjyw0qI2mjtYZrhZ0mhPPfKtzCeAmVZScD+8Kn0J9 HOFXxCvz1i57rGbCHpMH7OjHa7EcHdHX5ozMBXtCfobV5eTM7mkw+r4vXIIG7vhpa1cWj3JWW6 XBHZz/FPdSSCcajgcy9EdGee0Med7SelV15D25cVVrU7dqKjmguuvLTDTAdFRVgFX0JuXxbCRG qPS8ot51TmUmyzEb7r+ThB3I6mhhtR5wSu9F5UfCieU4/2tOhZEceSNzxUC1CncvkJwnX8bXqT Khw= X-IronPort-AV: E=Sophos;i="5.79,361,1602572400"; d="scan'208";a="106102990" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jan 2021 06:19:32 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 20 Jan 2021 06:19:21 -0700 Received: from atudor-ThinkPad-T470p.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 20 Jan 2021 06:19:19 -0700 From: Tudor Ambarus To: , , Subject: [PATCH v2 2/2] mtd: spi-nor: sst: Add support for Global Unlock on sst26vf Date: Wed, 20 Jan 2021 15:19:14 +0200 Message-ID: <20210120131914.277363-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210120131914.277363-1-tudor.ambarus@microchip.com> References: <20210120131914.277363-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_081933_249104_C05B52D4 X-CRM114-Status: GOOD ( 15.05 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tudor Ambarus , richard@nod.at, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Kavyasree.Kotagiri@microchip.com, miquel.raynal@bootlin.com Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Even if sst26vf shares the SPINOR_OP_GBULK opcode with Macronix (ex. MX25U12835F) and Winbound (ex. W25Q128FV), it has its own Individual Block Protection scheme, which is also capable to read-lock individual parameter blocks. Thus the sst26vf's Individual Block Protection scheme will reside in the sst.c manufacturer driver. Add support to unlock the entire flash memory. The device is write-protected by default after a power-on reset cycle (volatile software protection), in order to avoid inadvertent writes during power-up. Could do an erase, write, read back, and compare when MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle --- v2: s/!ofs/ofs == 0/ drivers/mtd/spi-nor/sst.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c index 00e48da0744a..d6e1396abb96 100644 --- a/drivers/mtd/spi-nor/sst.c +++ b/drivers/mtd/spi-nor/sst.c @@ -8,6 +8,39 @@ #include "core.h" +static int sst26vf_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) +{ + return -EOPNOTSUPP; +} + +static int sst26vf_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) +{ + if (ofs == 0 && len == nor->params->size) + return spi_nor_global_block_unlock(nor); + + return -EOPNOTSUPP; +} + +static int sst26vf_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) +{ + return -EOPNOTSUPP; +} + +static const struct spi_nor_locking_ops sst26vf_locking_ops = { + .lock = sst26vf_lock, + .unlock = sst26vf_unlock, + .is_locked = sst26vf_is_locked, +}; + +static void sst26vf_default_init(struct spi_nor *nor) +{ + nor->params->locking_ops = &sst26vf_locking_ops; +} + +static const struct spi_nor_fixups sst26vf_fixups = { + .default_init = sst26vf_default_init, +}; + static const struct flash_info sst_parts[] = { /* SST -- large erase sizes are "overlays", "sectors" are 4K */ { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024, 8, @@ -39,8 +72,9 @@ static const struct flash_info sst_parts[] = { { "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_DUAL_READ) }, { "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128, - SECT_4K | SPI_NOR_DUAL_READ | - SPI_NOR_QUAD_READ) }, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) + .fixups = &sst26vf_fixups }, }; static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,