[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAEAJfAnrZCAp+5GakaG36Kcr3dQ2_e-WGOm9e=92Ctq1NyL=Q@mail.gmail.com>
Date: Sun, 28 Feb 2016 16:23:18 -0300
From: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
To: Brian Norris <computersforpeace@...il.com>
Cc: "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
Rafał Miłecki <zajec5@...il.com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Bayi Cheng <bayi.cheng@...iatek.com>,
Marek Vasut <marex@...x.de>,
Daniel Kurtz <djkurtz@...omium.org>
Subject: Re: [PATCH v2 6/8] mtd: spi-nor: add SPI_NOR_HAS_LOCK flag
On 29 January 2016 at 16:25, Brian Norris <computersforpeace@...il.com> wrote:
> We can't determine this purely by manufacturer type (see commit
> 67b9bcd36906 ("mtd: spi-nor: fix Spansion regressions (aliased with
> Winbond)")), and it's not autodetectable by anything like SFDP. So make
> a new flag for it.
>
> Signed-off-by: Brian Norris <computersforpeace@...il.com>
> Reviewed-by: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
> ---
> v2: no change
>
> drivers/mtd/spi-nor/spi-nor.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 9cd92f135fa2..a47e9dd29456 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -69,6 +69,7 @@ struct flash_info {
> #define SPI_NOR_DUAL_READ BIT(5) /* Flash supports Dual Read */
> #define SPI_NOR_QUAD_READ BIT(6) /* Flash supports Quad Read */
> #define USE_FSR BIT(7) /* use flag status register */
> +#define SPI_NOR_HAS_LOCK BIT(8) /* Flash supports lock/unlock via SR */
> };
>
> #define JEDEC_MFR(info) ((info)->id[0])
> @@ -1280,7 +1281,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
>
> if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
> JEDEC_MFR(info) == SNOR_MFR_INTEL ||
> - JEDEC_MFR(info) == SNOR_MFR_SST) {
> + JEDEC_MFR(info) == SNOR_MFR_SST ||
> + info->flags & SPI_NOR_HAS_LOCK) {
> write_enable(nor);
> write_sr(nor, 0);
> spi_nor_wait_till_ready(nor);
> @@ -1297,7 +1299,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
> mtd->_read = spi_nor_read;
>
> /* NOR protection support for STmicro/Micron chips and similar */
> - if (JEDEC_MFR(info) == SNOR_MFR_MICRON) {
> + if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
> + info->flags & SPI_NOR_HAS_LOCK) {
Nitpick: indentation looks off here.
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
Powered by blists - more mailing lists