[PATCH] mtd: spi-nor: support eon en25qh256a variant

Michael Walle michael at walle.cc
Mon May 2 04:52:27 PDT 2022


Hi,

> This patch allows accessing the upper 8m on the A variant (EN25QH256A) of

8m? It's a 32MiB flash right? So it should be the upper 16MiB?

> 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.

So the upper 16MiB never really worked, correct?

> 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.

Do you have the A variant only? Where did you get the SFDP from the
non-A variant? datasheet?

> 
> Signed-off-by: Leon M. George <leon at georgemail.eu>
> Tested-by: Leon M. George <leon at georgemail.eu>

No need for the Tested-by:. That is already implied by the SoB (unless
noted otherwise).

> ---
>  drivers/mtd/spi-nor/eon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/eon.c b/drivers/mtd/spi-nor/eon.c
> index 8c1c57530281..50a11053711f 100644
> --- a/drivers/mtd/spi-nor/eon.c
> +++ b/drivers/mtd/spi-nor/eon.c
> @@ -25,7 +25,8 @@ static const struct flash_info eon_nor_parts[] = {
>  	{ "en25qh64",   INFO(0x1c7017, 0, 64 * 1024,  128)
>  		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) },
>  	{ "en25qh128",  INFO(0x1c7018, 0, 64 * 1024,  256) },
> -	{ "en25qh256",  INFO(0x1c7019, 0, 64 * 1024,  512) },
> +	{ "en25qh256",  INFO(0x1c7019, 0, 64 * 1024,  512)
> +		PARSE_SFDP },

Please also submit a SFDP dump, see [1].

-michael

[1] https://lore.kernel.org/linux-mtd/4304e19f3399a0a6e856119d01ccabe0@walle.cc/



More information about the linux-mtd mailing list