Re: [PATCH] mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA

From: Miquel Raynal
Date: Mon Dec 08 2025 - 03:53:47 EST


Hi Ahmed, thanks for this contribution.

> +static SPINAND_OP_VARIANTS(read_cache_variants,
> + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
> + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
> + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
> + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));

These macros have been renamed, please rebase at -rc1.

> +
> +static SPINAND_OP_VARIANTS(write_cache_variants,
> + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
> + SPINAND_PROG_LOAD(true, 0, NULL, 0));
> +
> +static SPINAND_OP_VARIANTS(update_cache_variants,
> + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
> + SPINAND_PROG_LOAD(false, 0, NULL, 0));
> +
> +static int ds35xx_ooblayout_ecc(struct mtd_info *mtd, int section,
> + struct mtd_oob_region *region)
> +{
> + return -ERANGE;
> +}

This is strange, there is usually some spare area used for storing the
ECC. Are you sure none of the bytes in the spare area are being smashed
when you write them?

> +static int ds35xx_ooblayout_free(struct mtd_info *mtd, int section,
> + struct mtd_oob_region *region)
> +{
> + if (section)
> + return -ERANGE;
> + region->offset = 2;
> + region->length = 62;
> + return 0;
> +}
> +

LGTM otherwise.

Thanks,
Miquèl