mtd: spi-nor: Add possibility to disable chip erase
Subsystems (2)
v2 cover mtd: spi-nor: Add possibility to disable chip erase
v2:
* rebased to git://github.com/spi-nor/linux.git
Marcin Krzeminski (2):
Add flag to disable chip erase
Disable chip erase for Micron n25q00
drivers/mtd/spi-nor/spi-nor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.3
PATCH v2 1/2 Add flag to disable chip erase
Extend spi-nor framework to allow disable chip erase command also for selected flash chips.
--- drivers/mtd/spi-nor/spi-nor.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/spi-nor/spi-nor.c +3 -0
@@ -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 */
Signature · 1 line
2.9.3
Re: [PATCH v2 1/2] Add flag to disable chip erase
Hi Marcin,
Globally this patch looks good but for next patches it would be better to add the "mtd: spi-nor: " prefix in the subject line. Hence when reading the git log output we can immediately identify which sub system is modified by some commit.
For this series, if Marek has no other comment, I can take it and fix the subject line. Otherwise, if another version is needed then please fix the subject lines :)
Quoted 3 lines · Marcin Krzeminski
Extend spi-nor framework to allow disable chip erase command also for selected flash chips.
This describes what the patch does, so that's good. However you could also explain why we want/need to disable the chip erase and enforce this is a bug fix for some SPI NOR memories. You could also reword the subject line with something like "mtd: spi-nor: fix erase ...."
Best regards,
Cyrille
Quoted 27 lines
Signed-off-by Marcin Krzeminski <[email protected]>--- drivers/mtd/spi-nor/spi-nor.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mtd/spi-nor/spi-nor.c +3
-0@@ -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 */
Re: [PATCH v2 1/2] Add flag to disable chip erase
W dniu 04.01.2017 o 13:56, Cyrille Pitchen pisze:
Quoted 6 lines
Hi Marcin,
Globally this patch looks good but for next patches it would be better to add the "mtd: spi-nor: " prefix in the subject line. Hence when reading the git log output we can immediately identify which sub system is modified by some commit.
Sorry, I forgot about this.
Quoted 4 lines
For this series, if Marek has no other comment, I can take it and fix the subject line. Otherwise, if another version is needed then please fix the subject lines :)
I'll wait for Marek comments if any, and send fixed subject line.
Quoted 9 lines · Marcin Krzeminski
Quoted 3 lines
Extend spi-nor framework to allow disable chip erase command also for selected flash chips.
This describes what the patch does, so that's good. However you could also explain why we want/need to disable the chip erase and enforce this is a bug fix for some SPI NOR memories. You could also reword the subject line with something like "mtd: spi-nor: fix erase ...."
Sure.
Quoted 33 lines
Best regards,
Cyrille
Quoted 27 lines
Signed-off-by Marcin Krzeminski <[email protected]>--- drivers/mtd/spi-nor/spi-nor.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mtd/spi-nor/spi-nor.c +3
-0@@ -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 */
PATCH v2 2/2 Disable chip erase for Micron n25q00
In reply to Marcin KrzeminskiMicron n25q00 are stacked chips, thus do not support chip erase.
Quoted 1 line
From now spi-nor framework will not send chip erase command.
--- drivers/mtd/spi-nor/spi-nor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/spi-nor/spi-nor.c +2 -2
@@ -950,8 +950,8 @@ static const struct flash_info spi_nor_ids[] = { { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, { "n25q512ax3", INFO(0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, - { "n25q00", INFO(0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, - { "n25q00a", INFO(0x20bb21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, + { "n25q00", INFO(0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) }, + { "n25q00a", INFO(0x20bb21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },/* PMC */ { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
Signature · 1 line
2.9.3