Skip to content
Snippets Groups Projects
Select Git revision
  • c6a3afa1301d0edda4a7eb69a8fc64af220d71d8
  • v2018.2.x default protected
  • 0x4A6F-rpi4
  • 0x4A6F-master
  • master
  • v2018.2.2-ffs
  • v2016.2.4-batmanbug
  • radv-filterd
  • v2016.2.x
  • hoodselector
  • v2016.1.x
  • babel
  • v2015.1.x
  • 2014.4.x
  • 2014.3.x
  • v2018.2.2-ffs0.1
  • v2018.2.1-ffs0.1
  • v2018.2.1
  • v2018.2-ffs0.1
  • v2018.2
  • v2018.1.4
  • v2018.1.3
  • v2018.1.2
  • v2018.1.1
  • v2018.1
  • v2017.1.8
  • v2017.1.7
  • v2017.1.6
  • v2017.1.5
  • v2017.1.4
  • v2017.1.3
  • v2017.1.2
  • v2016.2.7
  • v2017.1.1
  • v2017.1
35 results

0031-generic-mtd-backport-unlock-support-and-asserted-fixes-for-certain-Winbond-Spansion-flash-chips.patch

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    0031-generic-mtd-backport-unlock-support-and-asserted-fixes-for-certain-Winbond-Spansion-flash-chips.patch 5.84 KiB
    From: Matthias Schiffer <mschiffer@universe-factory.net>
    Date: Tue, 20 Jun 2017 11:01:27 +0200
    Subject: generic: mtd: backport unlock support and asserted fixes for certain Winbond/Spansion flash chips
    
    diff --git a/target/linux/generic/patches-4.4/049-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch b/target/linux/generic/patches-4.4/049-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch
    new file mode 100644
    index 0000000000000000000000000000000000000000..c8aafe2ebbf7368f47e8f4d7a24dd5e45583a136
    --- /dev/null
    +++ b/target/linux/generic/patches-4.4/049-0001-mtd-spi-nor-wait-until-lock-unlock-operations-are-re.patch
    @@ -0,0 +1,66 @@
    +From 32321e950d8a237d7e8f3a9b76220007dfa87544 Mon Sep 17 00:00:00 2001
    +Message-Id: <32321e950d8a237d7e8f3a9b76220007dfa87544.1462572686.git.mschiffer@universe-factory.net>
    +From: =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= <ezequiel@vanguardiasur.com.ar>
    +Date: Mon, 28 Dec 2015 17:54:51 -0300
    +Subject: [PATCH] mtd: spi-nor: wait until lock/unlock operations are ready
    +
    +On Micron and Numonyx devices, the status register write command
    +(WRSR), raises a work-in-progress bit (WIP) on the status register.
    +The datasheets for these devices specify that while the status
    +register write is in progress, the status register WIP bit can still
    +be read to check the end of the operation.
    +
    +This commit adds a wait_till_ready call on lock/unlock operations,
    +which is required for Micron and Numonyx but should be harmless for
    +others. This is needed to prevent applications from issuing erase or
    +program operations before the unlock operation is completed.
    +
    +Reported-by: Stas Sergeev <stsp@list.ru>
    +Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
    +Signed-off-by: Brian Norris <computersforpeace@gmail.com>
    +---
    + drivers/mtd/spi-nor/spi-nor.c | 12 ++++++++++--
    + 1 file changed, 10 insertions(+), 2 deletions(-)
    +
    +--- a/drivers/mtd/spi-nor/spi-nor.c
    ++++ b/drivers/mtd/spi-nor/spi-nor.c
    +@@ -463,6 +463,7 @@ static int stm_lock(struct spi_nor *nor,
    + 	u8 status_old, status_new;
    + 	u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
    + 	u8 shift = ffs(mask) - 1, pow, val;
    ++	int ret;
    + 
    + 	status_old = read_sr(nor);
    + 
    +@@ -499,7 +500,10 @@ static int stm_lock(struct spi_nor *nor,
    + 		return -EINVAL;
    + 
    + 	write_enable(nor);
    +-	return write_sr(nor, status_new);
    ++	ret = write_sr(nor, status_new);
    ++	if (ret)
    ++		return ret;
    ++	return spi_nor_wait_till_ready(nor);
    + }
    + 
    + /*
    +@@ -513,6 +517,7 @@ static int stm_unlock(struct spi_nor *no
    + 	uint8_t status_old, status_new;
    + 	u8 mask = SR_BP2 | SR_BP1 | SR_BP0;
    + 	u8 shift = ffs(mask) - 1, pow, val;
    ++	int ret;
    + 
    + 	status_old = read_sr(nor);
    + 
    +@@ -547,7 +552,10 @@ static int stm_unlock(struct spi_nor *no
    + 		return -EINVAL;
    + 
    + 	write_enable(nor);
    +-	return write_sr(nor, status_new);
    ++	ret = write_sr(nor, status_new);