linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] mtd: spi-nor: issi: Add IS25WP512 device
  2022-04-14 13:00 [PATCH] mtd: spi-nor: issi: Add IS25WP512 device niravkumar.l.rabara
@ 2022-04-14 10:09 ` Michael Walle
  2022-04-17 19:31   ` Michael Walle
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Walle @ 2022-04-14 10:09 UTC (permalink / raw)
  To: niravkumar.l.rabara
  Cc: Tudor Ambarus, Pratyush Yadav, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

> Add is25wp512 info to spi_nor_ids[] table entry.
> 
> Rename is25lp256_post_bfpt_fixups to is25xx_post_bfpt_fixups
> as a common function for all is25xx post_bfpt fixups.
> 
> Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>

We require SFDP dumps of new flashes. Therefore, you can only add
flashes which you actually have (and have tested). See [1] how to
provide such a dump.

> ---
>  drivers/mtd/spi-nor/issi.c | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c
> index c012bc2486e1..14fe07e55f85 100644
> --- a/drivers/mtd/spi-nor/issi.c
> +++ b/drivers/mtd/spi-nor/issi.c
> @@ -9,24 +9,27 @@
>  #include "core.h"
> 
>  static int
> -is25lp256_post_bfpt_fixups(struct spi_nor *nor,
> +is25xx_post_bfpt_fixups(struct spi_nor *nor,

Please use is25_post_bfpt_fixups. But how sure are you that
this affects their whole nor flash line? is25 is the prefix
for all their SPI NOR flashes, no?

I'm not arguing against using this name and it can certainly
be changed in the future if we know more.

-michael

[1] 
https://lore.kernel.org/linux-mtd/4304e19f3399a0a6e856119d01ccabe0@walle.cc/

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

* [PATCH] mtd: spi-nor: issi: Add IS25WP512 device
@ 2022-04-14 13:00 niravkumar.l.rabara
  2022-04-14 10:09 ` Michael Walle
  0 siblings, 1 reply; 4+ messages in thread
From: niravkumar.l.rabara @ 2022-04-14 13:00 UTC (permalink / raw)
  To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Niravkumar L Rabara
  Cc: linux-mtd, linux-kernel

From: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>

Add is25wp512 info to spi_nor_ids[] table entry.

Rename is25lp256_post_bfpt_fixups to is25xx_post_bfpt_fixups
as a common function for all is25xx post_bfpt fixups.

Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
---
 drivers/mtd/spi-nor/issi.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c
index c012bc2486e1..14fe07e55f85 100644
--- a/drivers/mtd/spi-nor/issi.c
+++ b/drivers/mtd/spi-nor/issi.c
@@ -9,24 +9,27 @@
 #include "core.h"
 
 static int
-is25lp256_post_bfpt_fixups(struct spi_nor *nor,
+is25xx_post_bfpt_fixups(struct spi_nor *nor,
 			   const struct sfdp_parameter_header *bfpt_header,
 			   const struct sfdp_bfpt *bfpt)
 {
 	/*
-	 * IS25LP256 supports 4B opcodes, but the BFPT advertises a
-	 * BFPT_DWORD1_ADDRESS_BYTES_3_ONLY address width.
+	 * IS25XX256 & IS25XX512 supports 4B opcodes,
+	 * but the BFPT advertises BFPT_DWORD1_ADDRESS_BYTES_3_ONLY and
+	 * BFPT_DWORD1_ADDRESS_BYTES_3_OR_4 address width repectively.
 	 * Overwrite the address width advertised by the BFPT.
 	 */
-	if ((bfpt->dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) ==
-		BFPT_DWORD1_ADDRESS_BYTES_3_ONLY)
+	if (((bfpt->dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) ==
+		BFPT_DWORD1_ADDRESS_BYTES_3_ONLY) ||
+		((bfpt->dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) ==
+		BFPT_DWORD1_ADDRESS_BYTES_3_OR_4))
 		nor->addr_width = 4;
 
 	return 0;
 }
 
-static const struct spi_nor_fixups is25lp256_fixups = {
-	.post_bfpt = is25lp256_post_bfpt_fixups,
+static struct spi_nor_fixups is25xx_fixups = {
+	.post_bfpt = is25xx_post_bfpt_fixups,
 };
 
 static const struct flash_info issi_nor_parts[] = {
@@ -48,7 +51,7 @@ static const struct flash_info issi_nor_parts[] = {
 	{ "is25lp256",  INFO(0x9d6019, 0, 64 * 1024, 512)
 		PARSE_SFDP
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
-		.fixups = &is25lp256_fixups },
+		.fixups = &is25xx_fixups },
 	{ "is25wp032",  INFO(0x9d7016, 0, 64 * 1024,  64)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
 	{ "is25wp064",  INFO(0x9d7017, 0, 64 * 1024, 128)
@@ -58,7 +61,11 @@ static const struct flash_info issi_nor_parts[] = {
 	{ "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
-		.fixups = &is25lp256_fixups },
+		.fixups = &is25xx_fixups },
+	{ "is25wp512", INFO(0x9d701a, 0, 64 * 1024, 1024)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
+		.fixups = &is25xx_fixups },
 
 	/* PMC */
 	{ "pm25lv512",   INFO(0,        0, 32 * 1024,    2)
-- 
2.25.1


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

* Re: [PATCH] mtd: spi-nor: issi: Add IS25WP512 device
  2022-04-14 10:09 ` Michael Walle
@ 2022-04-17 19:31   ` Michael Walle
  2022-04-27  8:06     ` Rabara, Niravkumar L
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Walle @ 2022-04-17 19:31 UTC (permalink / raw)
  To: niravkumar.l.rabara
  Cc: Tudor Ambarus, Pratyush Yadav, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

Am 2022-04-14 12:09, schrieb Michael Walle:
>> +is25xx_post_bfpt_fixups(struct spi_nor *nor,
> 
> Please use is25_post_bfpt_fixups.

Sorry, this should be is25_nor_post_bfpt_fixups.

-michael

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

* RE: [PATCH] mtd: spi-nor: issi: Add IS25WP512 device
  2022-04-17 19:31   ` Michael Walle
@ 2022-04-27  8:06     ` Rabara, Niravkumar L
  0 siblings, 0 replies; 4+ messages in thread
From: Rabara, Niravkumar L @ 2022-04-27  8:06 UTC (permalink / raw)
  To: Michael Walle
  Cc: Tudor Ambarus, Pratyush Yadav, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel



>-----Original Message-----
>From: Michael Walle <michael@walle.cc> 
>Sent: Monday, 18 April, 2022 3:31 AM
>To: Rabara, Niravkumar L <niravkumar.l.rabara@intel.com>
>Cc: Tudor Ambarus <tudor.ambarus@microchip.com>; Pratyush Yadav <p.yadav@ti.com>; Miquel Raynal <miquel.raynal@bootlin.com>; Richard >Weinberger <richard@nod.at>; Vignesh Raghavendra <vigneshr@ti.com>; linux-mtd@lists.infradead.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] mtd: spi-nor: issi: Add IS25WP512 device

>Am 2022-04-14 12:09, schrieb Michael Walle:
>>> +is25xx_post_bfpt_fixups(struct spi_nor *nor,
>> 
>> Please use is25_post_bfpt_fixups.

>Sorry, this should be is25_nor_post_bfpt_fixups.

I will change the function name to is25_nor_post_bfpt_fixups in the next patch and provide the SFDP dump of flash.

Thanks,
Nirav

>-michael

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

end of thread, other threads:[~2022-04-27  8:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 13:00 [PATCH] mtd: spi-nor: issi: Add IS25WP512 device niravkumar.l.rabara
2022-04-14 10:09 ` Michael Walle
2022-04-17 19:31   ` Michael Walle
2022-04-27  8:06     ` Rabara, Niravkumar L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).