ath79: update spi-nor patches
[openwrt/staging/stintel.git] / target / linux / ath79 / patches-5.10 / 0052-mtd-spi-nor-use-4-bit-locking-for-MX25L12805D.patch
1 From a449cd03db4d0e1d292b3734f7676634cfd94f53 Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Sun, 25 Oct 2020 01:14:22 +0200
4 Subject: [PATCH] mtd: spi-nor: use 4 bit locking for MX25L12805D
5
6 Macronix MX25L12805D supports locking with 4 block
7 protection bits in its status register. Add the corresponding
8 flag in order to clear these bits when unloking the flash.
9
10 Otherwise, the flash might not be writable depending on the state
11 left by the bootloader.
12
13 Tested-on: Ubiquiti UniFi AC Lite (ath79)
14
15 Fixes commit 62593cf40b23 ("mtd: spi-nor: refactor block protection functions")
16
17 Signed-off-by: David Bauer <mail@david-bauer.net>
18 ---
19 drivers/mtd/spi-nor/macronix.c | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
21
22 diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
23 index 2d39dd32a64e..ed8b56a0102f 100644
24 --- a/drivers/mtd/spi-nor/macronix.c
25 +++ b/drivers/mtd/spi-nor/macronix.c
26 @@ -50,7 +50,8 @@ static const struct flash_info macronix_parts[] = {
27 { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) },
28 { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) },
29 { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
30 - { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K) },
31 + { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K |
32 + SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) },
33 { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
34 { "mx25r1635f", INFO(0xc22815, 0, 64 * 1024, 32,
35 SECT_4K | SPI_NOR_DUAL_READ |
36 --
37 2.31.1
38