[PATCH 2/2] mtd: spi-nor: disable 16-bit-sr for macronix

Michael Walle michael at walle.cc
Thu Jan 20 00:08:09 PST 2022


Hi David,

Am 2022-01-19 21:36, schrieb David Bauer:
> On 1/19/22 16:49, Michael Walle wrote:

>> That being said. I'd prefer to have a sane default for that
>> flag - which is to _not_ set it by default. For now, we can
>> just remove the flag from spi_nor_init_default_params() and
>> move it into the manufacturer default init. Then we can
>> go through the flashes and remove the flag there.
> 
> I was working on a similar series in parallel - and i just want to
> confirm this before i submit it. [0]
> 
> Your take would be to remove the flag from spi_nor_init_default_params
> and place it in all vendor init-calls, right?

correct.

> My current take would be to add a new flag which denotes flashes that
> only have a single 8-bit SR, no second SR / CR.

but that new flag has the same meaning as the current one, no? In fact
I see you are just clearing the 16bit flag if the 8bit one is set.

Therefore, you have to bits for just two states. We want to
use less flags and IMHO this isn't good for readability.

Also it doesn't fix the bad default. I doubt anyone adding
a new vendor/flash is aware that the default is a WRSR with
16bit SR. Eg. I just had a quick look at gigadevice and it
doesn't seem to support this neither. Now depending on the
SFDP content the flag is overwritten anyways. But still.
I'd really like to get rid of this and just identify the
flashes that doesn't have an opcode to write the second
status register/configuration register.

-michael



More information about the linux-mtd mailing list