2022-05-10 20:53:41

by Michael Walle

[permalink] [raw]
Subject: [PATCH 0/2] introduce SNOR_ID3()

For support which rely solely on the SFDP data, all we need to know is its
JEDEC ID. All further information should be fetched from SFDP. For this,
introduce a SNOR_ID3() macro which should be used for all new flashes with
SFDP.

The dropped information are page size, number of sectors and sector size.
The number of sectors (together with sector size) is only used to calculate
the total flash size. In case of SFDP, this is read from there. The sector
size is also used to select a proper erase opcode. We can just keep that
one zero and the selection algorithm will select the same erase opcode;
that is the opcode for the largest erase size (which is btw rather odd..).
The page size is also taken from SFDP. There is one exception: older SFDP
tables. These doesn't contain this data. So if there will be flashes with
that, we should assume some sane value.

Shaik, could you please re-test your w25q512nwm support with this patch. I
read through the SFDP data and it should behave exactly the same as before.

Michael Walle (2):
mtd: spi-nor: introduce SNOR_ID3()
mtd: spi-nor: winbond: use SNOR_ID3() for w25q512nwm

drivers/mtd/spi-nor/core.c | 7 +++++--
drivers/mtd/spi-nor/core.h | 9 +++++++++
drivers/mtd/spi-nor/winbond.c | 3 +--
3 files changed, 15 insertions(+), 4 deletions(-)

--
2.30.2