[PATCH] mtd: spi-nor: macronix: add support for Macronix octaflash mx25uw51345g

Tudor Ambarus tudor.ambarus at linaro.org
Thu Dec 14 22:52:36 PST 2023


Hi, Haibo,

Please read the following before sending v2:
https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/tree/Documentation/driver-api/mtd/spi-nor.rst?h=spi-nor/next

On 13.12.2023 10:48, haibo.chen at nxp.com wrote:
> From: Haibo Chen <haibo.chen at nxp.com>
> 
> The octaflash mx25uw51345g is an xSPI compliant octal DTR flash. Here add
> support for using it in octal DTR mode.
> 
> Try to verify the flash ID to check whether the flash memory in octal
> DTR mode and SPI mode are correct. When reading ID in OCTAL DTR mode,
> ID will appear in a repeated manner. ex: ID[0] = 0xc2, ID[1] = 0xc2,
> ID[2] = 0x94, ID[3] = 0x94... Rearrange the order so that the ID check
> can pass.
> 
> Based on the following patch:
> https://patchwork.ozlabs.org/project/linux-mtd/patch/1621232088-12567-2-git-send-email-zhengxunli@mxic.com.tw/

I would have taken the patch from above if I considered it ready to be
integrated. Please sync with Zhengxun/Jaime and find out what's missing.
> 
> Signed-off-by: Zhengxun Li <zhengxunli at mxic.com.tw>
> Signed-off-by: Haibo Chen <haibo.chen at nxp.com>
> ---
>  drivers/mtd/spi-nor/macronix.c | 91 ++++++++++++++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
> index ea6be95e75a5..8a1ce17cff3f 100644
> --- a/drivers/mtd/spi-nor/macronix.c
> +++ b/drivers/mtd/spi-nor/macronix.c
> @@ -8,6 +8,11 @@
>  
> 
cut

> +
>  static const struct flash_info macronix_nor_parts[] = {
>  	{
>  		.id = SNOR_ID(0xc2, 0x20, 0x10),
> @@ -177,6 +261,13 @@ static const struct flash_info macronix_nor_parts[] = {
>  		.name = "mx25uw51245g",
>  		.n_banks = 4,
>  		.flags = SPI_NOR_RWW,
> +	}, {
> +		.id = SNOR_ID(0xc2, 0x84, 0x3a),
> +		.name = "mx25uw51345g",

we'll obsolete the name on new flash additions, drop it.
> +		.size = SZ_64M,
> +		.no_sfdp_flags = SECT_4K | SPI_NOR_OCTAL_DTR_READ | SPI_NOR_OCTAL_DTR_PP,

should be discovered by sfdp, isn't it?
> +		.fixup_flags = SPI_NOR_4B_OPCODES,

these too.
> +		.fixups = &octaflash_fixups,
>  	}, {
>  		.id = SNOR_ID(0xc2, 0x9e, 0x16),
>  		.name = "mx25l3255e",

Cheers,
ta



More information about the linux-mtd mailing list