aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/mtd/spi-nor.h
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-11-07 08:41:51 +0000
committerTudor Ambarus <tudor.ambarus@microchip.com>2019-11-11 08:55:25 +0200
commit39d1e3340c73e8f7eb1d6a8cae561c255ca7b1b0 (patch)
treecf7b1d2ff233ab73dcaf019d21c2f4e61395b10d /include/linux/mtd/spi-nor.h
parentmtd: spi-nor: Print debug message when the read back test fails (diff)
downloadwireguard-linux-39d1e3340c73e8f7eb1d6a8cae561c255ca7b1b0.tar.xz
wireguard-linux-39d1e3340c73e8f7eb1d6a8cae561c255ca7b1b0.zip
mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()
Make sure that when doing a lock() or an unlock() operation we don't clear the QE bit from Status Register 2. JESD216 revB or later offers information about the *default* Status Register commands to use (see BFPT DWORDS[15], bits 22:20). In this standard, Status Register 1 refers to the first data byte transferred on a Read Status (05h) or Write Status (01h) command. Status register 2 refers to the byte read using instruction 35h. Status register 2 is the second byte transferred in a Write Status (01h) command. Industry naming and definitions of these Status Registers may differ. The definitions are described in JESD216B, BFPT DWORDS[15], bits 22:20. There are cases in which writing only one byte to the Status Register 1 has the side-effect of clearing Status Register 2 and implicitly the Quad Enable bit. This side-effect is hit just by the BFPT_DWORD15_QER_SR2_BIT1_BUGGY and BFPT_DWORD15_QER_SR2_BIT1 cases. Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'include/linux/mtd/spi-nor.h')
-rw-r--r--include/linux/mtd/spi-nor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index d1d736d3c8ab..d6ec55cc6d97 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -243,6 +243,9 @@ enum spi_nor_option_flags {
SNOR_F_4B_OPCODES = BIT(6),
SNOR_F_HAS_4BAIT = BIT(7),
SNOR_F_HAS_LOCK = BIT(8),
+ SNOR_F_HAS_16BIT_SR = BIT(9),
+ SNOR_F_NO_READ_CR = BIT(10),
+
};
/**