Re: [PATCH v3 1/2] mtd: spi-nor: issi: is25wp256: Init flash based on SFDP

From: Sudip Mukherjee
Date: Fri Sep 23 2022 - 14:31:24 EST


HI Michael,

On Thu, Sep 22, 2022 at 3:19 PM Michael Walle <michael@xxxxxxxx> wrote:
>
> Am 2022-09-20 20:48, schrieb Sudip Mukherjee:
> > The datasheet of is25wp256 says it supports SFDP. Get rid of the static
> > initialization of the flash parameters and init them when parsing SFDP.
> >
> > Testing showed the flash using SPINOR_OP_READ_1_1_4_4B 0x6c,
> > SPINOR_OP_PP_4B 0x12 and SPINOR_OP_BE_4K_4B 0x21 before enabling SFDP.
> > After this patch, it parses the SFDP information and still uses the
> > same opcodes.
> >
> > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@xxxxxxxxxx>
> > ---
> >
> > No change from v2, just resending again with the next patch.
> > Results from the tests given by Tudor in the following mail.
> >
> >
> > drivers/mtd/spi-nor/issi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c
> > index 89a66a19d754f..8b48459b5054c 100644
> > --- a/drivers/mtd/spi-nor/issi.c
> > +++ b/drivers/mtd/spi-nor/issi.c
> > @@ -71,7 +71,7 @@ static const struct flash_info issi_nor_parts[] = {
> > { "is25wp128", INFO(0x9d7018, 0, 64 * 1024, 256)
> > NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> > { "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512)
>
> I'm curious, does it also work with:
> { "is25wp256", INFO(0x9d7019, 0, 0, 0)
> PARSE_SFDP

Applied this on top of my patch series:

diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c
index 014cd9038bed..a0ddad2afffc 100644
--- a/drivers/mtd/spi-nor/issi.c
+++ b/drivers/mtd/spi-nor/issi.c
@@ -70,7 +70,7 @@ static const struct flash_info issi_nor_parts[] = {
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
SPI_NOR_QUAD_READ) },
{ "is25wp128", INFO(0x9d7018, 0, 64 * 1024, 256)
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
SPI_NOR_QUAD_READ) },
- { "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512)
+ { "is25wp256", INFO(0x9d7019, 0, 0, 0)
PARSE_SFDP
FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
FLAGS(SPI_NOR_QUAD_PP)

And, I can see it working. dmesg showed:
[ 35.299888] spi-nor spi0.0: is25wp256 (32768 Kbytes)
[ 35.403858] spi-nor spi0.0: mtd .name = spi0.0, .size = 0x2000000
(32MiB), .erasesize = 0x00001000 (4KiB) .numeraseregions = 0

The system booted and I can see all the partitions.

--
Regards
Sudip