All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mtd: spi-nor: Add possibility to disable chip erase
@ 2016-12-30 13:23 Marcin Krzeminski
  2016-12-30 13:23 ` [PATCH v2 1/2] Add flag " Marcin Krzeminski
  2016-12-30 13:23 ` [PATCH v2 2/2] Disable chip erase for Micron n25q00 Marcin Krzeminski
  0 siblings, 2 replies; 5+ messages in thread
From: Marcin Krzeminski @ 2016-12-30 13:23 UTC (permalink / raw)
  To: cyrille.pitchen, marek.vasut, linux-mtd
  Cc: dwmw2, computersforpeace, boris.brezillon, mar.krzeminski

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(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] Add flag to disable chip erase
  2016-12-30 13:23 [PATCH v2 0/2] mtd: spi-nor: Add possibility to disable chip erase Marcin Krzeminski
@ 2016-12-30 13:23 ` Marcin Krzeminski
  2017-01-04 12:56   ` Cyrille Pitchen
  2016-12-30 13:23 ` [PATCH v2 2/2] Disable chip erase for Micron n25q00 Marcin Krzeminski
  1 sibling, 1 reply; 5+ messages in thread
From: Marcin Krzeminski @ 2016-12-30 13:23 UTC (permalink / raw)
  To: cyrille.pitchen, marek.vasut, linux-mtd
  Cc: dwmw2, computersforpeace, boris.brezillon, mar.krzeminski

Extend spi-nor framework to allow disable chip erase
command also for selected flash chips.

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] Disable chip erase for Micron n25q00
  2016-12-30 13:23 [PATCH v2 0/2] mtd: spi-nor: Add possibility to disable chip erase Marcin Krzeminski
  2016-12-30 13:23 ` [PATCH v2 1/2] Add flag " Marcin Krzeminski
@ 2016-12-30 13:23 ` Marcin Krzeminski
  1 sibling, 0 replies; 5+ messages in thread
From: Marcin Krzeminski @ 2016-12-30 13:23 UTC (permalink / raw)
  To: cyrille.pitchen, marek.vasut, linux-mtd
  Cc: dwmw2, computersforpeace, boris.brezillon, mar.krzeminski

Micron n25q00 are stacked chips, thus do not support chip erase.
>From now spi-nor framework will not send chip erase command.

Signed-off-by: Marcin Krzeminski <mar.krzeminski@gmail.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index b6656b2..3b416d6 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -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) },
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Add flag to disable chip erase
  2016-12-30 13:23 ` [PATCH v2 1/2] Add flag " Marcin Krzeminski
@ 2017-01-04 12:56   ` Cyrille Pitchen
  2017-01-04 16:05     ` mar.krzeminski
  0 siblings, 1 reply; 5+ messages in thread
From: Cyrille Pitchen @ 2017-01-04 12:56 UTC (permalink / raw)
  To: Marcin Krzeminski, marek.vasut, linux-mtd
  Cc: dwmw2, computersforpeace, boris.brezillon

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 :)

Le 30/12/2016 à 14:23, Marcin Krzeminski a écrit :
> 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

> 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 */
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Add flag to disable chip erase
  2017-01-04 12:56   ` Cyrille Pitchen
@ 2017-01-04 16:05     ` mar.krzeminski
  0 siblings, 0 replies; 5+ messages in thread
From: mar.krzeminski @ 2017-01-04 16:05 UTC (permalink / raw)
  To: Cyrille Pitchen, marek.vasut, linux-mtd
  Cc: dwmw2, computersforpeace, boris.brezillon



W dniu 04.01.2017 o 13:56, Cyrille Pitchen pisze:
> 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.
>
> 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.
>
> Le 30/12/2016 à 14:23, Marcin Krzeminski a écrit :
>> 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.
>
> Best regards,
>
> Cyrille
>
>> 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 */
>>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-04 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-30 13:23 [PATCH v2 0/2] mtd: spi-nor: Add possibility to disable chip erase Marcin Krzeminski
2016-12-30 13:23 ` [PATCH v2 1/2] Add flag " Marcin Krzeminski
2017-01-04 12:56   ` Cyrille Pitchen
2017-01-04 16:05     ` mar.krzeminski
2016-12-30 13:23 ` [PATCH v2 2/2] Disable chip erase for Micron n25q00 Marcin Krzeminski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.