Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cPUD5-0004Ez-Si for linux-mtd@lists.infradead.org; Fri, 06 Jan 2017 13:05:33 +0000 Received: by mail-lf0-x244.google.com with SMTP id d16so37633374lfb.1 for ; Fri, 06 Jan 2017 05:05:11 -0800 (PST) Subject: Re: [PATCH v3 1/2] mtd: spi-nor: Fix whole chip erasing in stacked chips. To: cyrille.pitchen@atmel.com, marek.vasut@gmail.com, linux-mtd@lists.infradead.org References: <20170106130302.8074-1-mar.krzeminski@gmail.com> <20170106130302.8074-3-mar.krzeminski@gmail.com> Cc: dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com From: "mar.krzeminski" Message-ID: <34465217-5c07-3d3c-0ee3-31eb53029fe1@gmail.com> Date: Fri, 6 Jan 2017 14:05:08 +0100 MIME-Version: 1.0 In-Reply-To: <20170106130302.8074-3-mar.krzeminski@gmail.com> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Please ingore this one. Sorry! W dniu 06.01.2017 o 14:03, Marcin Krzeminski pisze: > Curretly it is possible to disable chip erase for spi-nor driver. > Some modern stacked (multi die) flash chips does not support chip > erase opcode at all but spi-nor framework need to cope with them too. > This commit extend exising functionality to allow disable > chip erase for a single flash chip. > > Signed-off-by: Marcin Krzeminski > --- > drivers/mtd/spi-nor/spi-nor.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 15fb8af..b6656b2 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -81,6 +81,7 @@ struct flash_info { > * because it has the same value as > * ATMEL flashes) > */ > +#define NO_CHIP_ERASE BIT(10) /* Chip does not support chip erase */ > }; > > #define JEDEC_MFR(info) ((info)->id[0]) > @@ -1545,6 +1546,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) > nor->flags |= SNOR_F_USE_FSR; > if (info->flags & SPI_NOR_HAS_TB) > nor->flags |= SNOR_F_HAS_SR_TB; > + if (info->flags & NO_CHIP_ERASE) > + nor->flags |= SNOR_F_NO_OP_CHIP_ERASE; > > #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS > /* prefer "small sector" erase if possible */