public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Marcin Krzeminski <mar.krzeminski@gmail.com>
To: cyrille.pitchen@atmel.com, marek.vasut@gmail.com,
	linux-mtd@lists.infradead.org
Cc: dwmw2@infradead.org, computersforpeace@gmail.com,
	boris.brezillon@free-electrons.com, mar.krzeminski@gmail.com
Subject: [PATCH v3 1/2] mtd: spi-nor: Fix whole chip erasing in stacked chips.
Date: Fri,  6 Jan 2017 14:03:01 +0100	[thread overview]
Message-ID: <20170106130302.8074-3-mar.krzeminski@gmail.com> (raw)
In-Reply-To: <20170106130302.8074-1-mar.krzeminski@gmail.com>

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 <mar.krzeminski@gmail.com>
---
 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 */
-- 
2.9.3

  parent reply	other threads:[~2017-01-06 13:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 13:02 [PATCH v3 0/2] mtd: spi-nor: Add possibility to disable chip erase Marcin Krzeminski
2017-01-06 13:03 ` [PATCH v3 1/2] mtd: spi-nor: Fix whole chip erasing for stacked chips Marcin Krzeminski
2017-01-06 15:03   ` Cyrille Pitchen
2017-01-06 13:03 ` Marcin Krzeminski [this message]
2017-01-06 13:05   ` [PATCH v3 1/2] mtd: spi-nor: Fix whole chip erasing in " mar.krzeminski
2017-01-06 13:03 ` [PATCH v3 2/2] mtd: spi-nor: Disable chip erase for Micron n25q00 Marcin Krzeminski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170106130302.8074-3-mar.krzeminski@gmail.com \
    --to=mar.krzeminski@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox