Re: [PATCH v5 1/5] mtd: spi-nor: core: add manufacturer flags

Erez
2024-09-23T13:26:08Z

On Mon, 23 Sept 2024 at 12:46, Michael Walle <mwalle@kernel.org> wrote:
>
> Hi,
>
> > I would gladly remove the obsolete mx25l12805d.
>
> Why? I don't see any need for that.

Maybe because we do not want compatibility table?

>
> > > If there isn't any way to distinguish the flashes at runtime (which I
> > > doubt/challenge btw), then as a last resort we introduce a dedicated
> > > compatible for the flash in cause and specify all needed parameters in a
> > > dedicated flash entry. This shall be more generic as further flash
> > > parameters can be statically specified in the dedicated flash entry,
> > > less invasive for dt, and less confusing for people when they decide
> > > whether to use OTP or not. OTP params in device tree is a no-go.
> > >
> > > But again, you have to prove why you can't distinguish the flash at
> > > runtime before introducing a new flash compatible. So don't go this path
> > > before sharing with us what you're trying to achieve.
> >
> > You keep sending me contradictory messages.
> >
> > I told you we can not "guess" OTP settings based on JEDEC ID and
> > SFDP existence.
>
> What are you trying to achieve here? I've told you we are trying
> hard to figure out everything out at runtime. I'd suggest you start
> with one particular device where you want OTP support for. If the
> flash id is already in our database, find a way to distinguish
> between the old and the new one; probably by looking at some SFDP
> parameters. No need for any new compatibility. Don't try to solve the
> problem for all the chips out there.

I start with "Add support for SPI-NOR Macronix OTP".
With one flash chip and move to another one chip.
I never suggested adding multiple.

Yet, after some research I find that all Macronix chips in the last 15
years have SFDP.
So I added a second patch to always read the SFDP of Macronix chips.
Perhaps I should send it separately,as it seems to confuse you.

And no, I do not try to support all chips, just to remove the
restriction that if
Macronix reuses an old chip JEDEC ID, we skip the SFDP of the new
chip, because we have the old chip in the compatibility table,
although there are two distinct chips. They use different model names.
There is no reason to differentiate chips in that way, at least not
with Macronix chips.

>
> Again, the reason why we are trying hard to determine that at
> runtime is that these flashes are usually second source devices and
> a manufacturer might just replace it with a (more or less)
> compatible one. Therefore, the less information we put into the
> devicetree the better. So before you are sending a new version with
> the flash compatibles, you actually have to convince us that there
> is no other way of knowing what kind of flash there is on your
> board except for providing the name by the firmware.

No, reading the SFDP is great.
Except for OTP parameters/configuration.
As there is not way to find OTP parameters using JEDEC ID/SFDP
So as I understand there are only 2 ways to set the OTP parameters:
* Use a compatibility.
* Use dynamic OTP configuration, through DT, sysfs,

Erez

>
> -michael