linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes
@ 2021-10-07 12:08 Matthias Schiffer
  2021-10-07 12:08 ` [PATCH v2 2/2] mtd: spi-nor: micron-st: add support for mt25ql01g and mt25qu01g Matthias Schiffer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Matthias Schiffer @ 2021-10-07 12:08 UTC (permalink / raw)
  To: Tudor Ambarus, Michael Walle, Pratyush Yadav, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Matthias Schiffer

Change the mt25ql02g/mt25qu02g entries to include SPI_NOR_4B_OPCODES. In
addition, the SPI_NOR_DUAL_READ flag is added to mt25ql02g; this seems
to have been an accidental omission, as mt25ql02g and mt25qu02g should
support the same features.

In addition, the entries are made more specific by matching on the mt25q
extended ID, like it is already done for the smaller n25q derivatives.
It is unclear whether n25q derivatives with 2Gbit exist that do not
support 4B opcodes (like it is the case for sizes up to 512MBit), so we
do not have a match for such variants anymore (as we wouldn't even know
how to name such hypothetical models).

The changes were tested with a mt25qu01g, which should support the same
features as the mt25ql02g/mt25qu02g.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2:
- add extended ID match
- add back NO_CHIP_ERASE

 drivers/mtd/spi-nor/micron-st.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index c224e59820a1..a000a0790ecd 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -180,12 +180,14 @@ static const struct flash_info st_parts[] = {
 	{ "n25q00a",     INFO(0x20bb21, 0, 64 * 1024, 2048,
 			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
 			      NO_CHIP_ERASE) },
-	{ "mt25ql02g",   INFO(0x20ba22, 0, 64 * 1024, 4096,
-			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
-			      NO_CHIP_ERASE) },
-	{ "mt25qu02g",   INFO(0x20bb22, 0, 64 * 1024, 4096,
-			      SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
-			      SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
+	{ "mt25ql02g",   INFO6(0x20ba22, 0x104400, 64 * 1024, 4096,
+			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
+			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
+			       NO_CHIP_ERASE) },
+	{ "mt25qu02g",   INFO6(0x20bb22, 0x104400, 64 * 1024, 4096,
+			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
+			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
+			       NO_CHIP_ERASE) },
 
 	{ "m25p05",  INFO(0x202010,  0,  32 * 1024,   2, 0) },
 	{ "m25p10",  INFO(0x202011,  0,  32 * 1024,   4, 0) },
-- 
2.17.1


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

* [PATCH v2 2/2] mtd: spi-nor: micron-st: add support for mt25ql01g and mt25qu01g
  2021-10-07 12:08 [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
@ 2021-10-07 12:08 ` Matthias Schiffer
  2021-12-02  9:20 ` [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
  2021-12-16 18:52 ` Pratyush Yadav
  2 siblings, 0 replies; 6+ messages in thread
From: Matthias Schiffer @ 2021-10-07 12:08 UTC (permalink / raw)
  To: Tudor Ambarus, Michael Walle, Pratyush Yadav, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Matthias Schiffer

Split these mt25q models from the older n25q models by matching their
extended IDs to allow adding support for 4byte opcodes.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---

v2: add NO_CHIP_ERASE

 drivers/mtd/spi-nor/micron-st.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index a000a0790ecd..6593b6ebe0da 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -172,11 +172,19 @@ static const struct flash_info st_parts[] = {
 			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
 			      SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB |
 			      SPI_NOR_4BIT_BP | SPI_NOR_BP3_SR_BIT6) },
+	{ "mt25ql01g",   INFO6(0x20ba21, 0x104400, 64 * 1024, 2048,
+			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
+			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
+			       NO_CHIP_ERASE) },
 	{ "n25q00",      INFO(0x20ba21, 0, 64 * 1024, 2048,
 			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
 			      SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB |
 			      SPI_NOR_4BIT_BP | SPI_NOR_BP3_SR_BIT6 |
 			      NO_CHIP_ERASE) },
+	{ "mt25qu01g",   INFO6(0x20bb21, 0x104400, 64 * 1024, 2048,
+			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
+			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
+			       NO_CHIP_ERASE) },
 	{ "n25q00a",     INFO(0x20bb21, 0, 64 * 1024, 2048,
 			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
 			      NO_CHIP_ERASE) },
-- 
2.17.1


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

* Re: [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes
  2021-10-07 12:08 [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
  2021-10-07 12:08 ` [PATCH v2 2/2] mtd: spi-nor: micron-st: add support for mt25ql01g and mt25qu01g Matthias Schiffer
@ 2021-12-02  9:20 ` Matthias Schiffer
  2021-12-16 18:52 ` Pratyush Yadav
  2 siblings, 0 replies; 6+ messages in thread
From: Matthias Schiffer @ 2021-12-02  9:20 UTC (permalink / raw)
  To: Tudor Ambarus, Michael Walle, Pratyush Yadav, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel

On Thu, 2021-10-07 at 14:08 +0200, Matthias Schiffer wrote:
> Change the mt25ql02g/mt25qu02g entries to include SPI_NOR_4B_OPCODES.
> In
> addition, the SPI_NOR_DUAL_READ flag is added to mt25ql02g; this
> seems
> to have been an accidental omission, as mt25ql02g and mt25qu02g
> should
> support the same features.
> 
> In addition, the entries are made more specific by matching on the
> mt25q
> extended ID, like it is already done for the smaller n25q
> derivatives.
> It is unclear whether n25q derivatives with 2Gbit exist that do not
> support 4B opcodes (like it is the case for sizes up to 512MBit), so
> we
> do not have a match for such variants anymore (as we wouldn't even
> know
> how to name such hypothetical models).
> 
> The changes were tested with a mt25qu01g, which should support the
> same
> features as the mt25ql02g/mt25qu02g.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---

ping


> 
> v2:
> - add extended ID match
> - add back NO_CHIP_ERASE
> 
>  drivers/mtd/spi-nor/micron-st.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-
> nor/micron-st.c
> index c224e59820a1..a000a0790ecd 100644
> --- a/drivers/mtd/spi-nor/micron-st.c
> +++ b/drivers/mtd/spi-nor/micron-st.c
> @@ -180,12 +180,14 @@ static const struct flash_info st_parts[] = {
>  	{ "n25q00a",     INFO(0x20bb21, 0, 64 * 1024, 2048,
>  			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
>  			      NO_CHIP_ERASE) },
> -	{ "mt25ql02g",   INFO(0x20ba22, 0, 64 * 1024, 4096,
> -			      SECT_4K | USE_FSR | SPI_NOR_QUAD_READ |
> -			      NO_CHIP_ERASE) },
> -	{ "mt25qu02g",   INFO(0x20bb22, 0, 64 * 1024, 4096,
> -			      SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
> -			      SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
> +	{ "mt25ql02g",   INFO6(0x20ba22, 0x104400, 64 * 1024, 4096,
> +			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
> +			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
> +			       NO_CHIP_ERASE) },
> +	{ "mt25qu02g",   INFO6(0x20bb22, 0x104400, 64 * 1024, 4096,
> +			       SECT_4K | USE_FSR | SPI_NOR_DUAL_READ |
> +			       SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES |
> +			       NO_CHIP_ERASE) },
>  
>  	{ "m25p05",  INFO(0x202010,  0,  32 * 1024,   2, 0) },
>  	{ "m25p10",  INFO(0x202011,  0,  32 * 1024,   4, 0) },


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

* Re: [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes
  2021-10-07 12:08 [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
  2021-10-07 12:08 ` [PATCH v2 2/2] mtd: spi-nor: micron-st: add support for mt25ql01g and mt25qu01g Matthias Schiffer
  2021-12-02  9:20 ` [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
@ 2021-12-16 18:52 ` Pratyush Yadav
  2021-12-17 10:07   ` Matthias Schiffer
  2 siblings, 1 reply; 6+ messages in thread
From: Pratyush Yadav @ 2021-12-16 18:52 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Tudor Ambarus, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

Hi Matthias,

On 07/10/21 02:08PM, Matthias Schiffer wrote:
> Change the mt25ql02g/mt25qu02g entries to include SPI_NOR_4B_OPCODES. In
> addition, the SPI_NOR_DUAL_READ flag is added to mt25ql02g; this seems
> to have been an accidental omission, as mt25ql02g and mt25qu02g should
> support the same features.

The way flags are specified are changed a bit. See [0]. Please re-roll 
your patch to use the new flag types. If this flash supports SFDP you 
should ideally just need to set the sfdp flag to true and the core 
should take care of the rest. Test reports with the new changes would be 
much appreciated :-)

> 
> In addition, the entries are made more specific by matching on the mt25q
> extended ID, like it is already done for the smaller n25q derivatives.
> It is unclear whether n25q derivatives with 2Gbit exist that do not
> support 4B opcodes (like it is the case for sizes up to 512MBit), so we
> do not have a match for such variants anymore (as we wouldn't even know
> how to name such hypothetical models).

Sounds good to me.

> 
> The changes were tested with a mt25qu01g, which should support the same
> features as the mt25ql02g/mt25qu02g.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> 

[0] https://patchwork.ozlabs.org/project/linux-mtd/list/?series=275622&state=%2A&archive=both

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

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

* Re: [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes
  2021-12-16 18:52 ` Pratyush Yadav
@ 2021-12-17 10:07   ` Matthias Schiffer
  2021-12-17 10:37     ` Pratyush Yadav
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Schiffer @ 2021-12-17 10:07 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Tudor Ambarus, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

On Fri, 2021-12-17 at 00:22 +0530, Pratyush Yadav wrote:
> Hi Matthias,
> 
> On 07/10/21 02:08PM, Matthias Schiffer wrote:
> > Change the mt25ql02g/mt25qu02g entries to include
> > SPI_NOR_4B_OPCODES. In
> > addition, the SPI_NOR_DUAL_READ flag is added to mt25ql02g; this
> > seems
> > to have been an accidental omission, as mt25ql02g and mt25qu02g
> > should
> > support the same features.
> 
> The way flags are specified are changed a bit. See [0]. Please re-
> roll 
> your patch to use the new flag types. If this flash supports SFDP
> you 
> should ideally just need to set the sfdp flag to true and the core 
> should take care of the rest. Test reports with the new changes would
> be 
> much appreciated :-)

Will do. Is there an easy way to check which features the kernel
detected from the SFDP with the new code?


> 
> > In addition, the entries are made more specific by matching on the
> > mt25q
> > extended ID, like it is already done for the smaller n25q
> > derivatives.
> > It is unclear whether n25q derivatives with 2Gbit exist that do not
> > support 4B opcodes (like it is the case for sizes up to 512MBit),
> > so we
> > do not have a match for such variants anymore (as we wouldn't even
> > know
> > how to name such hypothetical models).
> 
> Sounds good to me.
> 
> > The changes were tested with a mt25qu01g, which should support the
> > same
> > features as the mt25ql02g/mt25qu02g.
> > 
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com
> > >
> > ---
> > 
> 
> [0] 
> https://patchwork.ozlabs.org/project/linux-mtd/list/?series=275622&state=%2A&archive=both
> 


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

* Re: [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes
  2021-12-17 10:07   ` Matthias Schiffer
@ 2021-12-17 10:37     ` Pratyush Yadav
  0 siblings, 0 replies; 6+ messages in thread
From: Pratyush Yadav @ 2021-12-17 10:37 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Tudor Ambarus, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

On 17/12/21 11:07AM, Matthias Schiffer wrote:
> On Fri, 2021-12-17 at 00:22 +0530, Pratyush Yadav wrote:
> > Hi Matthias,
> > 
> > On 07/10/21 02:08PM, Matthias Schiffer wrote:
> > > Change the mt25ql02g/mt25qu02g entries to include
> > > SPI_NOR_4B_OPCODES. In
> > > addition, the SPI_NOR_DUAL_READ flag is added to mt25ql02g; this
> > > seems
> > > to have been an accidental omission, as mt25ql02g and mt25qu02g
> > > should
> > > support the same features.
> > 
> > The way flags are specified are changed a bit. See [0]. Please re-
> > roll 
> > your patch to use the new flag types. If this flash supports SFDP
> > you 
> > should ideally just need to set the sfdp flag to true and the core 
> > should take care of the rest. Test reports with the new changes would
> > be 
> > much appreciated :-)
> 
> Will do. Is there an easy way to check which features the kernel
> detected from the SFDP with the new code?

Hm, I don't think so. I think you would have to add debug prints in the 
driver to know which flags were discovered by SFDP.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

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

end of thread, other threads:[~2021-12-17 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 12:08 [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
2021-10-07 12:08 ` [PATCH v2 2/2] mtd: spi-nor: micron-st: add support for mt25ql01g and mt25qu01g Matthias Schiffer
2021-12-02  9:20 ` [PATCH v2 1/2] mtd: spi-nor: micron-st: make mt25ql02g/mt25qu02g match more specific, add 4B opcodes Matthias Schiffer
2021-12-16 18:52 ` Pratyush Yadav
2021-12-17 10:07   ` Matthias Schiffer
2021-12-17 10:37     ` Pratyush Yadav

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