mtd: spi-nor: support eon en25qh256a variant
authorLeon M. George <leon@georgemail.eu>
Mon, 2 May 2022 23:33:10 +0000 (01:33 +0200)
committerPratyush Yadav <p.yadav@ti.com>
Mon, 9 May 2022 11:28:24 +0000 (16:58 +0530)
commitcdbc44dbb2c73d8bafa1a8ae0d780608be5dbd40
treefc0f1d07af441459e234114fe3a9fd7ec8992eaf
parent89051ff5dd3bfbdc95c315dc3377fc46dadddc7c
mtd: spi-nor: support eon en25qh256a variant

This patch allows accessing the upper 16m on the A variant (EN25QH256A) of
the EN25QH256 that shares same JEDEC ID.

Without this patch, addr_with is detected to be '4' but the read_opcode is
a plain READ (supporting only 3 byte addresses).
Setting PARSE_SFDP is enough to detect the read_opcode READ_4B on the A
variant. READ_4B is not available on the no-A variant.

Both variants support 4-byte address mode (spi_nor_set_4byte_addr_mode)
but that is prone to breaking on unexpected reboots if the reset pin isn't
connected (broken-flash-reset).

The no-A variant supports a 'high bank latch mode' that affects read,
program, and erase commands - similar to the extended address register
(EAR).
The HBL bit is manipulated using the ENHBL (0x67) and EXHBL (0x98)
opcodes.

Should it become necessary to distinguish the two variants in the future,
the A variant sets the SNOR_HWCAPS_READ_1_1_4 SFDP param - the no-A
variant doesn't.

Tested with and without fast read on the A variant only.

Signed-off-by: Leon M. George <leon@georgemail.eu>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220502233310.791565-2-leon@georgemail.eu
drivers/mtd/spi-nor/eon.c