]> git.baikalelectronics.ru Git - kernel.git/commitdiff
spi: intel: Fix the offset to get the 64K erase opcode
authorMauro Lima <mauro.lima@eclypsium.com>
Wed, 12 Oct 2022 15:21:35 +0000 (12:21 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:11 +0000 (17:42 +0100)
[ Upstream commit 8548c1b70741a9060b129a0bf3a7a1c516ea33d4 ]

According to documentation, the 64K erase opcode is located in VSCC
range [16:23] instead of [8:15].
Use the proper value to shift the mask over the correct range.

Signed-off-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20221012152135.28353-1-mauro.lima@eclypsium.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/spi-nor/intel-spi.c

index 43e55a2e9b2714a9a2ea818f629d0c822c63948e..21b98c82e1960dcda7d3ac73ec7b5ad1652feb53 100644 (file)
 #define ERASE_OPCODE_SHIFT             8
 #define ERASE_OPCODE_MASK              (0xff << ERASE_OPCODE_SHIFT)
 #define ERASE_64K_OPCODE_SHIFT         16
-#define ERASE_64K_OPCODE_MASK          (0xff << ERASE_OPCODE_SHIFT)
+#define ERASE_64K_OPCODE_MASK          (0xff << ERASE_64K_OPCODE_SHIFT)
 
 #define INTEL_SPI_TIMEOUT              5000 /* ms */
 #define INTEL_SPI_FIFO_SZ              64