[PATCH] mtd: spi-nor: macronix: Add support for mx66l2g45g

Michael Walle mwalle at kernel.org
Thu Feb 15 08:13:03 PST 2024


Hi,

On Thu Feb 15, 2024 at 4:55 PM CET, Sebastian Falbesoner wrote:
> From: Sebastian Falbesoner <s.falbesoner at schrack-seconet.com>
>
> For reference, see the corresponding entry in u-boot,
> introduced in commit baef13ec9d592a27b5d3bf03967bfd2bebd65157:

Please keep in mind that you still need a proper commit message,
SFDP dumps and test have it included in linux, see [1].

>
> [ in drivers/mtd/spi/spi-nor-ids.c:274 ]
> ----
> { INFO("mx66l2g45g",  0xc2201c, 0, 64 * 1024, 4096,
>   SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) },
> ----
>
> Signed-off-by: Sebastian Falbesoner <s.falbesoner at schrack-seconet.com>
> ---
>  drivers/mtd/spi-nor/macronix.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
> index ea6be95e75a5..1a8f8b654dda 100644
> --- a/drivers/mtd/spi-nor/macronix.c
> +++ b/drivers/mtd/spi-nor/macronix.c
> @@ -90,6 +90,12 @@ static const struct flash_info macronix_nor_parts[] = {
>  		.name = "mx66l1g45g",
>  		.size = SZ_128M,
>  		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
> +	}, {
> +		.id = SNOR_ID(0xc2, 0x20, 0x1c),
> +		.name = "mx66l2g45g",
> +		.size = SZ_256M,
> +		.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
> +		.fixup_flags = SPI_NOR_4B_OPCODES,
>  	}, {
>  		.id = SNOR_ID(0xc2, 0x23, 0x14),
>  		.name = "mx25v8035f",

I'm pretty sure, this flash will work without any modification by
using the generic driver (and maybe using the vendor fixups). See
also previous discussions [2]. Thus, I think the following should be
enough:
+	{ .id = SNOR_ID(0xc2, 0x20, 0x1c) }

*But* there is already a patchset under review to add SNOR_ID(0xc2)
to match any macronix flashes. Therefore, with the patch in [2]
applied, this flash should work without any further entries.

-michael

[1] https://docs.kernel.org/driver-api/mtd/spi-nor.html
[2] https://lore.kernel.org/linux-mtd/?q=mx66l2g45g
[3] https://lore.kernel.org/r/8b80cf233ea0065adf9841408e59f6a2@kernel.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20240215/24753b02/attachment-0001.sig>


More information about the linux-mtd mailing list