[PATCH v2 3/3] mtd: spi-nand: macronix: Add randomizer support

Miquel Raynal miquel.raynal at bootlin.com
Wed Sep 10 02:12:29 PDT 2025


> +static int macronix_set_randomizer(struct spinand_device *spinand)
> +{
> +	struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
> +	struct nand_device *nand = spinand_to_nand(spinand);
> +	struct device_node *dn = nanddev_get_of_node(nand);
> +	int randopt, ret;
> +	u8 cfg, status;
> +
> +	ret = spinand_read_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, &cfg);
> +	if (ret)
> +		return ret;
> +	if (cfg)
> +		return 0;
> +
> +	cfg = MACRONIX_CFG_ENPGM | MACRONIX_CFG_RANDEN;
> +	randopt = of_property_read_bool(dn, "mxic,randopt");

Isn't that a leftover?

Thanks,
Miquèl



More information about the linux-mtd mailing list