[PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP

Michael Walle mwalle at kernel.org
Thu Jul 11 02:02:39 PDT 2024


Hi Esben,

> > I actually had the same concern. But currently there is no
> > non-deprecated way to handle this case, right?
> >
> > Right now we have the following cases:
> >  (1) pure SFDP parsing
> >  (2) non-SFDP flashes with static configuration only
> >  (3) legacy implementation, where the magic flags decide whether we
> >      use SFDP
>
> Actually, in the code we have two variants of 2.
>
> (2a) non-SFDP flashes with SPI_NOR_SKIP_SFDP set
> (2b) non-SFDP flashes without SPI_NOR_SKIP_SFDP and with none of the
>      DUAL/QUAD/OCTAL read bits set

Isn't (2b) my case (3)? The SPI_NOR_SKIP_SFDP flag was intended to
be for flashes we know for a fact, there are no SFDP tables.

I'm looking at spi_nor_init_params(). Maybe I'm missing something?

-michael

> These almost handled the same way. But
> spi_nor_manufacturer_init_params() is only called for 2b, and not for
> 2a.
>
> Is this desired behavior, or something that we want to align?
>
> > Which case is eventually used depends on the ID of the flash -
> > assuming there will only be IDs which either fall into (1) *or* (2).
> > That assumption is clearly wrong :)
> >
> > I'd propose a new case in spi_nor_init_params()
> >  (4) try SFDP with a fallback to the static flags from the
> >      flash_info db.
>
> /Esben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 297 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20240711/4dcdc6ec/attachment.sig>


More information about the linux-mtd mailing list