ath79: mikrotik: update nand-rb4xx driver
[openwrt/staging/chunkeey.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 --- a/drivers/mtd/spi-nor/macronix.c
23 +++ b/drivers/mtd/spi-nor/macronix.c
24 @@ -50,7 +50,8 @@ static const struct flash_info macronix_
25 { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) },
26 { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) },
27 { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
28 - { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K) },
29 + { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K |
30 + SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) },
31 { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
32 { "mx25r1635f", INFO(0xc22815, 0, 64 * 1024, 32,
33 SECT_4K | SPI_NOR_DUAL_READ |